[英]How can I launch app store from my application
Im trying to implement button which opens app store application from my app. 我正在尝试实现从我的应用程序打开应用程序商店应用程序的按钮。 I use this simple line of code, which opens safari but not app store application.
我使用此简单的代码行来打开safari,但不打开应用商店应用程序。
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://itunes.apple.com/sk/app/tweetie-2/id333903271?mt=8"]];
I dont know whats wrong, is the URL format correct? 我不知道怎么了,URL格式正确吗? I was following this document .
我正在关注这份文件 。
All related questions in stackoverflow are outofdate I suppose. 我认为stackoverflow中的所有相关问题都已过时。
According to the documentation, iTunes affiliate links have to process several redirects in order to wind up in iTunes. 根据文档,iTunes会员链接必须处理多个重定向才能在iTunes中结束。 Follow the example to create an
NSURLConnection
, set yourself as its delegate, and use the string it ends up with to open with UIApplication
. 按照示例创建一个
NSURLConnection
,将自己设置为它的委托,并使用最终使用的字符串通过UIApplication
打开。
If you want to bypass Safari, change 'itunes' in the URL to 'phobos'. 如果要绕过Safari,请将URL中的“ itunes”更改为“ phobos”。 Note that this will fail in the simulator, but most definitely works on the device.
请注意,这将在模拟器中失败,但是绝对可以在设备上使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.