How to open the subscriptions page of the App Store app programmatically?
Asked Answered
C

4

8

If you have a subscription with two different possible lengths in your iOS app, and the user, who has purchased the shorter subscription, decides to purchase the longer subscription instead, they get prompted with this dialog:

enter image description here

Tapping Settings takes the user to the App Store app and opens the page where they can manage their subscriptions. Most probably Cocoa simply uses a custom scheme URL (e.g. appstore://pages/subscriptions) to achieve this.

What is this URL? Is there another way to open the subscriptions page in the App Store app programmatically?

Carisacarissa answered 20/2, 2012 at 3:56 Comment(0)
T
2

The subscription docs suggest that you can open the subscriptions management page using the following URL

https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW8

So something like

        let subscriptionURL = URL.init(string: "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions")!
        UIApplication.shared.open(subscriptionURL)

this does work; though it's somewhat indirect. The link opens in Safari which then redirects through to the store link. The redirect is actually to

itmss://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions

so I'm using that directly in my app - though of course it isn't guaranteed to be stable.

NB: Sandbox Subscriptions will not appear in this page. You'll have to do a trial signup to some other live service to have anything to see when you test.

Tabshey answered 4/7, 2018 at 9:34 Comment(0)
T
4

It seems that we can now use the following URL to directly open the subscriptions page (tested with iOS 12.4): https://apps.apple.com/account/subscriptions

The URLs in the accepted answer need the iTunes Store app to be installed. If the user has deleted the app, tapping on the link will just display an alert to restore the app. The link above opens the App Store without opening Safari first or relying on the iTunes Store app.

Tribble answered 26/7, 2019 at 17:0 Comment(0)
H
3

I really think that this is impossible, because when you add a payment to your SKPaymentQueue, and the alertView shows up, your app is no longer active – app store manages eveything outside your app, because later applicationWillResignActive callback is called.

That means, that it was inActive, and the thing you want to do can't be accessed inside your app.

Harrietharriett answered 2/4, 2012 at 13:13 Comment(0)
T
2

The subscription docs suggest that you can open the subscriptions management page using the following URL

https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW8

So something like

        let subscriptionURL = URL.init(string: "https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions")!
        UIApplication.shared.open(subscriptionURL)

this does work; though it's somewhat indirect. The link opens in Safari which then redirects through to the store link. The redirect is actually to

itmss://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions

so I'm using that directly in my app - though of course it isn't guaranteed to be stable.

NB: Sandbox Subscriptions will not appear in this page. You'll have to do a trial signup to some other live service to have anything to see when you test.

Tabshey answered 4/7, 2018 at 9:34 Comment(0)
M
2

In iOS 15 they added: showManageSubscriptions(in:)

For earlier versions open the URI: itms-apps://apps.apple.com/account/subscriptions in Safari (deep link)

Malayalam answered 28/5, 2023 at 9:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.