Kebechet / Maui.RevenueCat.InAppBilling

MIT License
12 stars 6 forks source link

LoadOfferings only shows current offering and discards the rest #14

Closed CameronVetter closed 1 year ago

CameronVetter commented 1 year ago

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.

CameronVetter commented 1 year ago

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.

Kebechet commented 1 year ago

published https://www.nuget.org/packages/Kebechet.Maui.RevenueCat.InAppBilling/2.0.0