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
精彩评论