39

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!

Ulysses Alves
  • 2,297
  • 3
  • 24
  • 34
white0702
  • 391
  • 1
  • 3
  • 4

3 Answers3

35

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.

algrid
  • 5,600
  • 3
  • 34
  • 37
  • Will i get this status through webhook? – iosdev1111 Mar 24 '21 at 04:51
  • @iosdev1111 if by "webhook" you mean https://developer.apple.com/documentation/appstoreservernotifications then yes, that's what I'm calling "server notification" in my response :) – algrid Mar 24 '21 at 20:11
  • 6
    there's no such thing of section sandbox account – JBarros35 Jul 02 '21 at 13:24
  • @JBarros35 "In iOS and iPadOS, the sandbox account appears in Settings after the first time you use the device to attempt a purchase in a development-signed app." see https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_in-app_purchases_with_sandbox – algrid Jul 02 '21 at 19:02
  • No such thing as "Cancel subscription" – ekashking Jul 12 '21 at 22:14
  • Can't find the Cancel button – oliverbytes Aug 24 '21 at 01:44
  • 3
    Still no "Cancel subscription" on the "Edit subscription" page, with iOS 14.7 and iOS 15.0.2 – StoneLam Oct 20 '21 at 07:45
  • 1
    This works on iOS, thanks. How about Mac? Where do I achieve the same on Mac, please? – Houman Jul 02 '22 at 11:20
  • No cancel or edit subscription on my ipad ios 12. Why can't they just add a decent testing facility in appstore connect. Utterly useless. – Kenny Jul 06 '22 at 13:53
  • Thanks, but how to cancel subscriptions (sandbox,production) from the appstoreconnect? – Nathan B Dec 13 '22 at 14:28
30

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.

om-ha
  • 3,102
  • 24
  • 37
lorenzo
  • 1,487
  • 1
  • 17
  • 25
  • 9
    Can we now cancel auto-renewable subscription in sandbox environment? or still have to wait? – Wei Loon Wong Jul 18 '18 at 08:49
  • 1
    Link has changed. Can't find the renewal times chart in Apple's docs but did find where they mention the *auto-renewable subscriptions renew a maximum of six times per day*: https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html – Daniel Storm Dec 10 '18 at 21:19
  • 3
    new link : https://help.apple.com/app-store-connect/#/dev7e89e149d Duration times are shortened when test your auto-renewable subscriptions. Additionally, test subscriptions only auto-renew a maximum of six times. – apsuva Sep 12 '19 at 14:38
  • 2
    I believe this is an outdated answer now. @algrid's answer works – craft Nov 20 '21 at 00:59
2

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.

z.lawson
  • 21
  • 3
  • Just to add to this, if all you can tap on are the subscription options under OPTIONS, and the only thing it lets you do is resubscribe, then resubscribe. After resubscribing the cancel button magically appeared. – Julian K Aug 31 '22 at 01:34