Kebechet / Maui.RevenueCat.InAppBilling

MIT License
10 stars 4 forks source link

Details about Entitlements missing #16

Closed CameronVetter closed 1 year ago

CameronVetter commented 1 year ago

In the current release, we find out what entitlements the user has purchased by retrieving CustomerInfoDto. At the moment this gives just the string identifier of each that the customer owns. This leaves a lot of information behind that may be critical to the application. For my current project, in our user testing, we found that we had no way currently to tell if the user has unsubscribed but still has some of their subscription left. Currently, we can only find out that they have an active entitlement but have no way of knowing that they have unsubscribed.

To fix this I propose adding Entitlements to the CustomInfoDto. This follows the pattern of the native RevenueCat SDK and how it presents the information. This would make a ton of information available to the user. The info available would look like this:

public sealed record EntitlementInfoDto
{
    public required DateTime? BillingIssueDetectedAt { get; init; }
    public required DateTime? ExpirationDate { get; init; }
    public required string Identifier { get; init; }
    public required bool IsActive { get; init; }
    public required bool IsSandbox { get; init; }
    public required DateTime? LatestPurchaseDate { get; init; }
    public required DateTime? OriginalPurchaseDate { get; init; }
    public required OwnershipId OwnershipType { get; init; }
    public required PeriodId PeriodType { get; init; }
    public required string ProductIdentifier { get; init; }
    public required string ProductPlanIdentifier { get; init; }
    public required StoreId Store { get; init; }
    public required DateTime? UnsubscribeDetectedAt { get; init; }
    public required bool WillRenew { get; init; }
}
CameronVetter commented 1 year ago

This again is a blocker for my project being able to release, so I will submit a PR for this either tonight or tomorrow, I'm currently testing these changes.

Kebechet commented 1 year ago

PR accepted and released: https://www.nuget.org/packages/Kebechet.Maui.RevenueCat.InAppBilling/2.1.0

Thank you for the contribution