white0702
white0702

Reputation: 431

How to cancel Auto-renewable subscription by using test user in sandbox environment?

I use Auto-Renewable Subscription in my application. When I test it I want to cancel Auto-Renewable Subscription in Sandbox environment, but I find out Auto-Renewable could not be canceled by a test user. How to cancel Auto-Renewable Subscription in Sandbox environment? And how to get the cancellation date in Sandbox environment? Thank you!

Upvotes: 43

Views: 29112

Answers (4)

Tuhin
Tuhin

Reputation: 400

for iOS 18.2.1--> Settings-->Developer---> select Sandbox account--->then your appSubscription

enter image description here

Upvotes: 3

z.lawson
z.lawson

Reputation: 21

I had a similar issue where the "Cancel Subscription" button wasn't appearing as documented here: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox/testing_disabling_auto-renew.

For me, the "Cancel Subscription" button wasn't appearing because I had subscribed within the app rather via the Subscriptions page within settings as documented. After I subscribed via the settings page, the "Cancel Subscription" button appeared. Hope this helps.

Upvotes: 2

algrid
algrid

Reputation: 5954

You can do it in the following way:

  1. Open iOS Settings
  2. Go to "App Store"
  3. Tap your sandbox account ("SANDBOX ACCOUNT" section at the bottom of the screen)
  4. Select "Manage"
  5. "Edit subscription" screen will open and there you'll have a "Cancel subscription" option for your Sandbox subscription.

With a small delay (it was several minutes for me) you'll get a server notification with "notification_type": "DID_CHANGE_RENEWAL_STATUS" and "auto_renew_status": "false". This means that the subscription is still valid, but it won't be automatically renewed when the current subscription period expires.

If you want to test refund (not a regular cancellation), then it's impossible as far as I know.

Upvotes: 44

lorenzo
lorenzo

Reputation: 1743

You just have to wait. From Apple's documentation:

Additionally, test subscriptions only auto-renew a maximum of six times.

Your test subscription lasts way less than the real duration, from 3 minutes to one hour. All renewing durations can be found on the following page:

https://help.apple.com/app-store-connect/#/dev7e89e149d

The cancel date can be found in the receipt.

Upvotes: 30

Related Questions