32

I want to create a button where a user can cancel a auto-renewal subscription (or get redirected to App Store).

Is that possible without the user having to go through the whole purchase process first? If it is, how would you go about doing it?

halfer
  • 19,824
  • 17
  • 99
  • 186
Nikolaj Simonsen
  • 1,650
  • 3
  • 18
  • 34

5 Answers5

48

December 2019

The correct URL is now https://apps.apple.com/account/subscriptions according to Apple's Handling Subscriptions Billing Documentation.

So just use:

UIApplication.shared.open(URL(string: "https://apps.apple.com/account/subscriptions")!)
vfxdev
  • 678
  • 6
  • 13
36

From the Apple In-App Purchase Programming Guide -

Rather than needing to code your own subscription management UI, your app can open the following URL:

https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions Opening this URL launches iTunes or iTunes Store, and then displays the Manage Subscription page.

So, simply create a button that launches that URL.

UIApplication.shared.openURL(URL(string: "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions")!)
Isuru
  • 30,617
  • 60
  • 187
  • 303
Paulw11
  • 108,386
  • 14
  • 159
  • 186
3

As mentioned in the documentation: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW19

So for Swift 3/4 just use this

UIApplication.shared.openURL(URL(string: "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions")!)
Joseph
  • 9,171
  • 8
  • 41
  • 67
0

iOS 10 and above

UIApplication.shared.open(URL(string: "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions")!, options: [:], completionHandler: nil)
daviddna
  • 163
  • 2
  • 7
-1

April 2021

According to the Apple Document, the URL has been updated to

https://apps.apple.com/account/subscriptions

So the following code can be used to redirect the user to manage subscriptions page.

DispatchQueue.main.async {
      UIApplication.shared.open(URL(string: "https://apps.apple.com/account/subscriptions")!, options: [:], completionHandler: nil)
    }
Nikhil Lihla
  • 607
  • 6
  • 21