如何链接到应用商店中的应用
我正在创建我的 iPhone 游戏的免费版本。 我想在免费版本中添加一个按钮,将人们带到应用商店中的付费版本。 如果我使用标准链接
http://itunes .apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8
iPhone 首先打开 Safari,然后打开应用商店。 我使用过其他直接打开应用程序商店的应用程序,所以我知道这是可能的。
有任何想法吗? 应用商店的 URL 方案是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(28)
对我来说(2023 年)
itms-apps://
不起作用,但itms-appss://
可以!我怀疑苹果添加了额外的
s
因为他们不希望我们再使用它,但在一些边缘情况下它仍然非常有用。对于 99% 的情况,您需要使用常规链接:
For me (in 2023)
itms-apps://
doesn't work butitms-appss://
does!I suspect Apple added the extra
s
because they don't want us using it any more but there are some edge cases where it's still extremely helpful.For 99% of cases you'll want to use the regular link:
尝试这样
http://itunes.apple.com/lookup?id=“您的应用ID here”返回 json。从中找到键“trackViewUrl”,值是所需的 url。 使用此网址(只需将
https://
替换为itms-apps://
)。这效果很好。例如,如果您的应用程序 ID 是 xyz,则转到此链接
http://itunes.apple.com/lookup?id=xyz
然后找到网址对于键“trackViewUrl”。这是您的应用程序在应用程序商店中的网址,要在 xcode 中使用此网址,请尝试此
谢谢
Try this way
http://itunes.apple.com/lookup?id="your app ID here" return json.From this, find key "trackViewUrl" and value is the desired url. use this url(just replace
https://
withitms-apps://
).This works just fine.For example if your app ID is xyz then go to this link
http://itunes.apple.com/lookup?id=xyz
Then find the url for key "trackViewUrl".This is the url for your app in app store and to use this url in xcode try this
Thanks
在 SwiftUI - iOS 15.0 中
in SwiftUI - IOS 15.0
编辑于 2016-02-02
从 iOS 6 开始 SKStoreProductViewController 类。 您无需离开应用程序即可链接应用程序。 Swift 3.x/2.x 和 Objective-C 中的代码片段为 在这里。
来自针对 Apple 开发者的新闻和公告。
其他说明:
您可以将
http://
替换为itms://
或itms-apps://
以避免重定向。请注意,
itms://
会将用户引导至 iTunes 商店 和itms-apps://
将它们发送到 App Store!有关命名的信息,请参阅 Apple QA1633:
https://developer.apple.com/library/content/qa/qa1633/_index.html。
编辑(截至 2015 年 1 月):
itunes.com/apps 链接应更新为 appstore.com/apps。 请参阅上面的 QA1633,该内容已更新。 新的 QA1629 建议了以下启动商店的步骤和代码应用程序:
NSURL
对象,然后将此对象传递给UIApplication
的openURL
: 方法以打开您的项目在应用商店中。示例代码:
iOS10+:
Swift 4.2
Edited on 2016-02-02
Starting from iOS 6 SKStoreProductViewController class was introduced. You can link an app without leaving your app. Code snippet in Swift 3.x/2.x and Objective-C is here.
From News and Announcement For Apple Developers.
Additional notes:
You can replace
http://
withitms://
oritms-apps://
to avoid redirects.Please note that
itms://
will send the user to the iTunes store anditms-apps://
with send them to the App Store!For info on naming, see Apple QA1633:
https://developer.apple.com/library/content/qa/qa1633/_index.html.
Edit (as of January 2015):
itunes.com/apps links should be updated to appstore.com/apps. See QA1633 above, which has been updated. A new QA1629 suggests these steps and code for launching the store from an app:
NSURL
object with the copied iTunes URL, then pass this object toUIApplication
' sopenURL
: method to open your item in the App Store.Sample code:
iOS10+:
Swift 4.2
如果你想直接打开一个应用程序到App Store,你应该使用:
itms-apps://...
这样就会直接打开设备中的App Store应用程序,而不是先去iTunes,然后才打开App Store(仅使用 itms:// 时)
编辑:2017 年 4 月。
itms-apps:// 实际上在 iOS10 中又可以工作了。 我测试过。
编辑:2013 年 4 月。
这在 iOS5 及更高版本中不再起作用。 只需使用
,就不再有重定向。
If you want to open an app directly to the App Store, you should use:
itms-apps://...
This way it will directly open the App Store app in the device, instead of going to iTunes first, then only open the App Store (when using just itms://)
EDIT: APR, 2017.
itms-apps:// actually works again in iOS10. I tested it.
EDIT: APR, 2013.
This no longer works in iOS5 and above. Just use
and there are no more redirects.
从 iOS 6 开始,正确的方法是使用 SKStoreProductViewController 类。
Swift 5.x:
Swift 3.x:
Swift 3.2
Swift 2.x:
objective-C:
Starting from iOS 6 right way to do it by using SKStoreProductViewController class.
Swift 5.x:
Swift 3.x:
Swift 3.2
Swift 2.x:
objective-C:
Apple 刚刚公布了 appstore.com 网址。
https://developer.apple.com/library/ios/qa/qa1633 /_index.html
Apple just announced the appstore.com urls.
https://developer.apple.com/library/ios/qa/qa1633/_index.html
从 2015 年夏季开始...
将“id1234567890”替换为“id”和“您的十位数字”
这在所有设备上完美运行。
它确实直接进入应用商店,没有重定向。
适用于所有全国商店。
确实,您应该转向使用
loadProductWithParameters
,但是如果链接的目的是更新您实际所在的应用程序:使用这种“老式”方法可能会更好。For summer 2015 onwards ...
replace 'id1234567890' with 'id' and 'your ten digit number'
This works perfectly on all devices.
It does go straight to the app store, no redirects.
Is OK for all national stores.
It's true you should move to using
loadProductWithParameters
, but if the purpose of the link is to update the app you are actually inside of: it's possibly better to use this "old-fashioned" approach.要获得不重定向的直接链接:
https://
替换为itms-apps://
UIApplication.shared.open(url, options: [:])
请注意,这些链接仅适用于实际设备,不适用于模拟器。
资料来源:
To have a direct link without redirection :
https://
withitms-apps://
UIApplication.shared.open(url, options: [:])
Be careful, those links only works on actual devices, not in simulator.
Source :
此代码在 iOS 上生成 App Store 链接 在
Mac 上将 itms-apps 替换为 http:
在 iOS 上打开 URL:
Mac:
This code generates the App Store link on iOS
Replace itms-apps with http on Mac:
Open URL on iOS:
Mac:
只需在应用程序链接中将“itunes”更改为“phobos”即可。
http://phobos.apple.com/WebObjects /MZStore.woa/wa/viewSoftware?id=300136119&mt=8
现在会直接打开App Store
Simply change 'itunes' to 'phobos' in the app link.
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300136119&mt=8
Now it will open the App Store directly
这对我来说非常有效,仅使用 APP ID:
重定向数量为零。
This worked for me perfectly using only APP ID:
The number of redirects is ZERO.
许多答案建议使用“itms”或“itms-apps”,但 Apple 并未特别推荐这种做法。 他们仅提供以下方式打开 App Store:
清单 1 从 iOS 应用程序启动 App Store
请参阅https://developer.apple.com/library/ios/qa/qa1629/_index.html 最后更新于 2014 年 3 月截至此答案。
对于支持 iOS 6 及更高版本的应用程序,Apple 提供了一种应用程序内机制来呈现 App Store:
SKStoreProductViewController
请注意,在 iOS6 上,如果出现错误,可能不会调用完成块。 这似乎是 iOS 7 中解决的一个错误。
A number of answers suggest using 'itms' or 'itms-apps' but this practice is not specifically recommended by Apple. They only offer the following way to open the App Store:
Listing 1 Launching the App Store from an iOS application
See https://developer.apple.com/library/ios/qa/qa1629/_index.html last updated March, 2014 as of this answer.
For apps that support iOS 6 and above, Apple offers a in-app mechanism for presenting the App Store:
SKStoreProductViewController
Note that on iOS6, the completion block may not be called if there are errors. This appears to be a bug that was resolved in iOS 7.
如果您想链接到开发人员的应用程序,并且开发人员的名称包含标点符号或空格(例如 Development Company, LLC),请像这样形成您的 URL:
否则,它会在 iOS 4.3.3 上返回“无法处理此请求”
If you want to link to a developer's apps and the developer's name has punctuation or spaces (e.g. Development Company, LLC) form your URL like this:
Otherwise it returns "This request cannot be processed" on iOS 4.3.3
您可以通过链接创建器获取应用商店或 iTunes 中特定项目的链接:
http://itunes.apple.com/linkmaker/
You can get a link to a specific item in the app store or iTunes through the link maker at:
http://itunes.apple.com/linkmaker/
这在 ios5 中可以正常工作并直接链接
This is working and directly linking in ios5
所有的答案都已经过时并且不起作用; 使用下面的方法。
开发者的所有应用程序:
itms-apps://apps.apple.com/developer/developer-name/developerId
单个应用程序:
itms-apps://itunes.apple.com/app/appId
All the answers are outdated and don't work; use the below method.
All apps of a developer:
itms-apps://apps.apple.com/developer/developer-name/developerId
Single app:
itms-apps://itunes.apple.com/app/appId
这是重定向/链接应用商店中其他现有应用程序的简单而简短的方法。
This is simple and short way to redirect/link other existing application on app store.
对于 Xcode 9.1 和 Swift 4:
2.遵守协议
3.执行协议
3.1
笔记:
For Xcode 9.1 and Swift 4:
2.Conform the protocol
3.Implement the protocol
3.1
Note:
我可以确认,如果您在 iTunes connect 中创建应用程序,您会在提交之前获取您的应用程序 ID。
因此..
工作是一种享受
I can confirm that if you create an app in iTunes connect you get your app id before you submit it.
Therefore..
Works a treat
我认为苹果已经为应用程序链接提供了一个新的链接:
https://apps.apple.com/app/id1445530088 或 https://apps.apple.com/app/ {your_app_id}
I think Apple has provided a new link for the app link:
https://apps.apple.com/app/id1445530088 or https://apps.apple.com/app/ {your_app_id}
当支持多个操作系统和多个平台时,创建链接可能会成为一个复杂的问题。 例如,iOS 7(其中一些)不支持 WebObjects,您创建的某些链接会打开另一个国家/地区的商店,然后打开用户的商店等。
有一个名为 iLink 可以帮助您。
该库的优点是将在运行时找到并创建链接(该库将检查应用程序 ID 及其运行的操作系统,并确定应创建哪个链接)。 最好的一点是,您在使用它之前几乎不需要配置任何内容,这样就不会出现错误并且始终可以工作。 如果您在同一项目上只有很少的目标,那么这也很棒,这样您就不必记住要使用哪个应用程序 ID 或链接。 如果商店中有新版本(这是内置的,您可以通过简单的标志将其关闭),该库还会提示用户升级应用程序,如果用户同意,则直接指向应用程序的升级页面。
将 2 个库文件复制到您的项目中 (iLink.h 和 iLink.m)。
在您的 appDelegate.m:
以及您想要打开评级页面的位置,例如,只需使用:
不要忘记在同一文件中导入 iLink.h。
那里有一个非常好的整个库的文档,还有一个适用于 iPhone 和 Mac 的示例项目。
Creating a link could become a complex issue when supporting multiple OS and multiple platform. For example the WebObjects isn't supported on iOS 7 (some of them), some links you create would open another country store then the user's etc.
There is an open source library called iLink that could help you.
There advantages of this library is that the links would be found and created at run time (the library would check the app ID and the OS it is running on and would figure out what link should be created). The best point in this is that you don't need to configure almost anything before using it so that is error free and would work always. That's great also if you have few targets on same project so you don't have to remember which app ID or link to use. This library also would prompt the user to upgrade the app if there is a new version on the store (this is built in and you turn this off by a simple flag) directly pointing to the upgrade page for the app if user agrees.
Copy the 2 library files to your project (iLink.h & iLink.m).
On your appDelegate.m:
and on the place you want to open the rating page for example just use:
Don't forget to import iLink.h on the same file.
There is a very good doc for the whole library there and an example projects for iPhone and for Mac.
至少 iOS 9 及以上版本
应用程序列表
应用程序 开发者
At least iOS 9 and above
An app
List of developer's apps
根据Apple最新文档
您需要使用
或
According to Apple's latest document
You need to use
or
尽管这里有很多答案,但链接到开发人员应用程序的建议似乎都不再有效。
当我上次访问时,我能够使用以下格式使其工作:
这不再有效,但删除开发人员名称可以:
Despite there being loads of answers here, none of the suggestions for linking to the developers apps seem to work anymore.
When I last visited I was able to get it working using the format:
This no longer works, but removing the developer name does:
如果您有应用程序商店 ID,则最好使用它。 特别是如果您将来可能更改应用程序的名称。
如果您没有应用商店 ID,您可以根据此文档创建一个 url https://developer.apple.com/library/ios/qa/qa1633/_index.html
通过此测试
If you have the app store id you are best off using it. Especially if you in the future might change the name of the application.
If you don't have tha app store id you can create an url based on this documentation https://developer.apple.com/library/ios/qa/qa1633/_index.html
Passes this test
对于那些寻找更新的工作解决方案的人来说,
For those looking for the updated working solution
它将直接打开App Store
it will open the App Store directly