Skip to main content
Solved

How to change app to unsubscribed state in sanbox testing?

  • March 17, 2024
  • 1 reply
  • 151 views

Forum|alt.badge.img+3

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?

Best answer by Ryan Glanz

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.

View original
Did this post help you find an answer to your question?
This post has been closed for comments

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • March 20, 2024

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings