How to get a notification to subscribe to auto-renew using RMStore in iOS

In my iOS app, I used an auto-renew subscription. We need a cross platform solution. I use RMStore in iOS to purchase a product.

In the current scenario : I get the latest receipts from didFinishLaunchingWithOptions and check on the AppStore with RMStoreAppReceiptVerifier than the expiration date for the server. We are constantly updating server data from both platforms (iOS and Android). And on the iOS side, we need to check the receipt all the time when the application is running. When do I receive a push notification when payment resumes? If possible, then we updated the server data at this time

Q-1) How can I verify that my new update process is complete?

Q-2) , if the User has canceled the auto-renewal subscription from iTunes, how can I receive notifications so that I can update my database? Do I need a daemon that checks expired subscriptions to see if the user is updated?

Q-3) on iOS. If I logged in from another device, how can I verify receipt from another device?

Please introduce yourself as I can handle automatic cross-platform subscription renewal using a server database. I hope someone can help me. Thanks!

+5
source share
1 answer

You can check receipts on your server using crontab so you know when the subscription has been renewed / canceled, etc.

How to do it: https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

And from: IAP Cross-Platform Subscription on iTunes - How Does Netflix Do It?

To sync a server with an iTunes subscription:

  • Set up a cron job to get expiring receipts from a database or something daily
  • Confirm every receipt with Apple
  • Apple will respond with an updated version of the receipt, containing detailed information on whether the / etc subscription has been canceled / renewed.
  • The server replaces the original receipt with this updated version in the database
0
source

Source: https://habr.com/ru/post/1243662/


All Articles