RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.22k stars 295 forks source link

CustomerInfo needs subscriptions. #3881

Closed c128128 closed 1 month ago

c128128 commented 2 months ago

Currently, CustomerInfo is returning [NonSubscriptionTransaction] for nonSubscriptions, which is good. However, for activeSubscriptions, it is returning Set<String>. Now, imagine a situation where a Customer has purchased from one app a product app1.product1 that has entitlement ent1, and from another app, a product app2.product1 that has the same entitlement. In my apps, I know that the user has ent1, but I can't get all the products that were bought (I am in this situation because of a wrong implementation in previous versions of my app).

Currently, there are no options to get the Subscription array; you can get only the productIdentifiers. But with productIdentifiers, you can't get the PeriodType, and more than this, nonSubscription currently is mapped to NonSubscriptionTransaction, but Subscription is not, and it looks like an unfinished idea.

RCGitBot commented 2 months ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

michaelAtRC commented 2 months ago

Hey @c128128 ,

This is returned like this because users can have multiple subscriptions at once and in these subscriptions it is more the expiration time and purchase time associated with the entitlement that will give you information on the exact subscription. This instance property is used more to track the identifiers of current subscriptions, but if you want more info on the subscription itself you will likely need to set up webhooks or look into the entitlement object.

You can also use our API endpoint here which should have this information in the subscriptions object.

Let me know if that helps!

c128128 commented 2 months ago

Hey @michaelAtRC,

You already have all this information inside the client SDK, just that info is not public.

c128128 commented 2 months ago

More than this, you can get that data from rawData that is public.

kmurphy-rc commented 1 month ago

Hey @c128128, Sorry for the delay on this - I'll add this request to our internal feedback tracker. Hopefully it's something we can support going forward. Appreciate you taking the time to reach out!

github-actions[bot] commented 3 weeks ago

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.