简体   繁体   中英

Testing In-App-Purchases in TestFlight/Sandbox purchase modal issue

We are experiencing a very weird behavior when testing In-App-Purchases via TestFlight/Sandbox. The tooling used for the implementation in React Native is: Expo In App purchases

We have configured multiple renewable subscriptions as our offered products.

After a successful subscription purchase, almost all testers are experiencing a very rare interaction with the purchase modal, even happening when the app is in the background. We are steadily trying to find what could be wrong with our implementation, but the fact that the modal is appearing randomly presenting the confirm purchase dialog multiple times, and with a random plan, we are a bit lost on the cause. Especially because with the app in background mode, app code should not be executing/running since we don't have background mode capabilities set up for that to work.

Is this by chance a wrong/known behavior of the Sandbox environment?

In any case, any clue or idea to re-orientate the efforts in that direction is very valuable at this point.

EDIT 1:

The modal appearing is the following one:

模态屏幕截图

You can get this behavior if you test auto renewable subscriptions in a test environment (such as when launched from Xcode).

In order to make it easier to test the nature of auto renewable subscriptions, the renewal time has been shortened when in a test environment, so that 5 minutes in real time represents 1 month in subscription time, 1 hour in real time represents one year in subscription time and so on...

When in test mode, a subscription is renewed up to six times by default and then it will be allowed to expire. Since iOS 14, you can change some of these test parameters.

The reason you get these calls to your app in both foreground and in the background, is most likely because StoreKit tries to simulate calls that your app would normally receive whenever a subscription is renewed.

In a test environment, this often prompts the user to enter their account credentials, in order for iOS to be able to sync the subscription status with AppStore; so this behavior with password dialogs popping up every now and then, is not something your real users will normally experience from the actual release.

If you test a lot of different auto renewable subscriptions on one account, these password dialogs that pop up can be a real hassle, but they will eventually stop appearing once all your test subscriptions has expired.

You can read all about testing auto renewable subscriptions here: https://help.apple.com/app-store-connect/#/dev7e89e149d

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM