objective-c iPhone sdk - 打开应用商店到特定应用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1517260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPhone sdk - open app store to specific app?
提问by Kyle
Is there a way to open the app store to a specific application? I tried using something like the following:
有没有办法打开应用商店到特定的应用程序?我尝试使用以下内容:
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284417350&mt=8&uo=6"]];
But got the following: "Safari cannot open the page because to many redirects occurred".
但得到以下信息:“Safari 无法打开页面,因为发生了许多重定向”。
回答by Kyle
Apparently this issue only affects the simulator. A build an go on the device works perfect.
显然这个问题只影响模拟器。在设备上构建运行完美。
回答by MrMage
回答by Dima Deplov
Another simple way is:
另一种简单的方法是:
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"itms-apps://itunes.com/app/YourAppNameWithoutSpaces"]];
This is very clean
这很干净
回答by comonitos
You can open app without opening safari
您可以在不打开 safari 的情况下打开应用程序
NSString *appId = @"you appid"; //like 999999999
NSString *link = [@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=" stringByAppendingString:appId];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString:link]];
回答by PRITAM SATPUTE
Replace iTunesLink with your App URL.
将 iTunesLink 替换为您的应用程序 URL。
NSString *iTunesLink = @"https://itunes.apple.com/us/app/digital-speedometer-pro/id1021728349?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
回答by Ramis
Starting from iOS 6 right way to go is using SKStoreProductViewController class.
从 iOS 6 开始,正确的方法是使用 SKStoreProductViewController 类。
Code is here: https://stackoverflow.com/a/32008404/1151916

