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:
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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With