iPhone sdk - open app store to specific app?

喜欢而已 提交于 2019-12-18 03:55:18

问题


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".


回答1:


Apparently this issue only affects the simulator. A build an go on the device works perfect.




回答2:


Use http://itunes.com/app/YourAppNameWithoutSpaces

See also this.




回答3:


Another simple way is:

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"itms-apps://itunes.com/app/YourAppNameWithoutSpaces"]];

This is very clean




回答4:


You can open app without opening 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]];



回答5:


Replace iTunesLink with your App URL.

 NSString *iTunesLink = @"https://itunes.apple.com/us/app/digital-speedometer-pro/id1021728349?mt=8";

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];



回答6:


Starting from iOS 6 right way to go is using SKStoreProductViewController class.

Code is here: https://stackoverflow.com/a/32008404/1151916



来源:https://stackoverflow.com/questions/1517260/iphone-sdk-open-app-store-to-specific-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!