开发者

Direct link to App Store on iPad?

开发者 https://www.devze.com 2022-12-31 04:14 出处:网络
Is there an URL that will directly open an application in the App Store on the iPad without redirecting through Safari? I am interested in http:// links, not itms://, as I want th开发者_开发问答em to

Is there an URL that will directly open an application in the App Store on the iPad without redirecting through Safari? I am interested in http:// links, not itms://, as I want th开发者_开发问答em to be usable outside the device. The phobos links used on iPhone do not seem to work on the iPad.


My current workaround is this:

NSURLRequest *myRequest = theRequest;
NSURL *urlFromMyRequest = [theRequest URL];

NSRange foundPhobosServer = [[urlFromMyRequest host] rangeOfString:@"phobos.apple.com"];
NSRange foundItunesServer = [[urlFromMyRequest host] rangeOfString:@"itunes.apple.com"];

    if(foundPhobosServer.location != NSNotFound || foundItunesServer.location != NSNotFound)
        [[UIApplication sharedApplication] openURL:[request URL]];

Basically I check the URL to see if it's coming from phobos.apple.com or itunes.apple.com. If it is, then I just ask the system to open it for me. The system can recognize if the URL is from the App Store and will do the right thing and open the App Store app.

Additional note: This will quit your app.

0

精彩评论

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