react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

How can I determine if a subscription is ongoing or has been cancelled?

Open SajidQ opened this issue 7 months ago • 1 comments

Description

How can I determine if a subscription is ongoing or has been cancelled? Is this something that should be validated through a backend or can I do it through the UI? What is the benefit of receipt validation?

Environment:

  • Platforms (iOS, Android, emulator, simulator, device): Android

SajidQ avatar Dec 06 '23 05:12 SajidQ

Each platform has its own methods of verifying purchases/subscriptions. I will try to give a quick rundown to the best of my knowledge but each platform (and I believe this package) have documentation on it. Honestly, the hardest thing with IAP is that every thing you read will tell you a different way of doing it (since Play Store, App Store, and IAPs in general are always rapidly evolving).

Verification should be done on the backend (although I believe iOS now has a new way to do it on the device itself (so it could be client I believe but react-native-iap warns against it).

RN-IAP Documentation

Android

You will need to reach out to the Play Store Developer API by authenticating with an OAuth2 token and then make a request to one of the proper endpoints for whatever you are doing.

Apple

Pretty much the same thing but you authorize with a JWT (apples preferred method) but with their own implementation methods. Here is all of their relevant documentation.

ian-hank avatar Dec 15 '23 03:12 ian-hank