开发者

How to get to "Manage Subscriptions" from my app

开发者 https://www.devze.com 2023-03-20 08:34 出处:网络
Is there any method to get to Manage Subscriptions in settings by clicking a button from my a开发者_JAVA百科pp??you can open Subscription section of AppStore by opening this link in iphone/ipad safari

Is there any method to get to Manage Subscriptions in settings by clicking a button from my a开发者_JAVA百科pp??


you can open Subscription section of AppStore by opening this link in iphone/ipad safari:

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

or simply use this code:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions"]];

Doing this will first open safari, then will redirect it to Appstore subscriptions.

EDIT:

Replace https with itms-apps will open subscriptions directly

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/manageSubscriptions"]];


There is no way to access the settings app from inside a sandboxed app -- i.e. any apps but Apple's -- without using a private API.


Since iOS 15, you can now use:

if let window = UIApplication.shared.connectedScenes.first as? UIWindowScene {
    Task {
        do {
            try await AppStore.showManageSubscriptions(in: window)
        }
    }
}

As documented here:
https://developer.apple.com/documentation/storekit/appstore/3803198-showmanagesubscriptions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号