Restoring auto-renewable subscriptions

I need help with Expo In App Purchases. I implemented buying of auto-renewable usbscriptions in my app using Expo In App Purchases library, but during review Apple wrote:

Users restore transactions to maintain access to content they’ve already purchased. For example, when they upgrade to a new phone, they don’t lose all of the items they purchased on the old phone. Include some mechanism in your app to let the user restore their purchases, such as a Restore Purchases button.

I see in docs, that there is getPurchaseHistoryAsync method, that can be used to restore user’s purchases. Questions I have are:

  1. When user loggs in to my app, how can I detect that his subscription must be restored, so that I can show the “restore” button? Apple said that automatic restoration will not go through review.
  2. Is it enough to call getPurchaseHistoryAsync method and it will automatically restore user’s purchases?
  3. What is the exact scenario when restoration is needed? Is it this one:
  • Application user loggs into my app and buys subscription as an iTunes user “A”
  • The same application user loggs into my app on different device, using iTunes user “B”
  • I should detect somehow that subscription for my app has been bought on different iTunes account/device and show “restore” button
  • Restore payments for iTunes user “B” if application user mentioned above clicks the button.

Thanks in advance!

Nobody? Really?

hi there! we get a lot of questions on the forums and handle them as we can with our small team. the forums are a great place for community folks to help each other out. we also provide more direct support via enterprise support contracts, which you can get more information here: Get Support — Expo