react-native-iap
react-native-iap copied to clipboard
How can I determine if a subscription is ongoing or has been cancelled?
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
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).
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.