Kebechet/Maui.RevenueCat.InAppBilling

LoadOfferings only shows current offering and discards the rest

Closed this issue · 2 comments

In LoadOfferings the code looks about like this:

using var offerings = await Purchases.SharedInstance.GetOfferingsAsync(cancellationToken);
using var currentOffering = offerings.Current;
_cachedOfferingPackages = currentOffering.AvailablePackages.ToList();
return _cachedOfferingPackages.ToOfferDtoList();

On the surface this seems to be in alignment with the idea that you can mark the offering you mark "current" in the backend to become the default in your app without any changes. This code will always return the one offering that is marked current and no others.

This ignores the possibility that you might have multiple offerings within your app that you want to offer simultaneously. This makes them inaccessible. The common scenario and the one I ran into is having in app purchases and a subscription available at the same time, but it could show up with just having multiple in app purchases, or different subscription tiers as well.

This is a show stopper for me so I will be creating a PR around this. My intent is to have LoadOfferings return all of them instead of just Current and to give access to just the Current one via a property. This will mirror the return results of the underlying native code, and enable all of the same scenarios.