Solved

How to change app to unsubscribed state in sanbox testing?

  • 17 March 2024
  • 1 reply
  • 19 views

Badge +1

From the The ultimate guide to iOS subscription testing I found this approach to test subscription restore:

One big caveat with iOS testing in the sandbox environment is that there is no receipt file on the device until a purchase is made. This differs from the production sandbox and production environments, where a receipt file is generated at the time of installation. To fully test restoring a purchase in the sandbox, you need to add a button, gesture, or some other means to revert the app to the unsubscribed state.

  1. Sign up for a monthly subscription.
  2. Use a button or gesture to revert the app to the unsubscribed state.
  3. Tap the Restore Purchases button.
  4. If you do this before the 35-minute subscription cycle is over, an active subscription should be found, and the app should change to the subscribed state.

 

Question is, how do I perform step 2? Is there any API call I can make to do that?

icon

Best answer by Ryan Glanz 20 March 2024, 16:19

View original

This post has been closed for comments

1 reply

Userlevel 3
Badge +8

Hi,

The simplest way to do that is to call the login method and log in with a different appUserId. You should then be missing the entitlement until you press restore purchases.