How to programmatically open the App Store app’s subscription page?

If you have a subscription with two different possible sizes in the iOS application, and the user who purchased the shorter subscription decides to buy a longer subscription, they receive a request with this dialog:

enter image description here

Pressing the settings takes the user to the App Store app and opens a page on which they can manage their subscriptions. Most likely, Cocoa simply uses the URL of a custom schema (e.g. appstore: // pages / subscriptions) to achieve this.

What is this URL? Is there any other way to open the subscription page in the App Store app programmatically?

+6
source share
3 answers

Subscription documents assume that you can open the subscription 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) 

it works; although this is somewhat indirect. The link opens in Safari, which then redirects to the store link. Actually redirecting to

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

therefore, I use it directly in my application - although, of course, it is not guaranteed to be stable.

NB. Sandbox subscriptions will not be displayed on this page. You will need to do a trial registration in some other online service in order to have something you can see when testing.

+2
source

I really think this is not possible because when you add a payment to your SKPaymentQueue and alertView appears, your application ceases to be active - the application store manages eveything outside of your application because applicationWillResignActive callback called.

This means that it was inActive, and what you want to do may not be available in your application.

+3
source

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

For the URLs in the accepted answer, you must install the iTunes Store app. If the user has uninstalled the application, clicking on the link will display a warning about the restoration of the application. The link above opens the app store without opening Safari and without relying on the iTunes Store app.

0
source

Source: https://habr.com/ru/post/908865/


All Articles