如何在ios应用程序中打开应用程序商店?

问题描述:

我正在使用此代码来为ios应用程序评分应用程序。如何在ios应用程序中打开应用程序商店?

let appLink = "https://itunes.apple.com/us/app/[name of the app]/id[idnumber]?mt=8" 
let url = URL(string: appLink) 
UIApplication.shared.openURL(url!) 

的问题是Safari浏览器显示“该网页的地址是无效的”

有没有什么办法让它工作吗?我使用的Xcode 9快捷4

+0

的可能的复制[如何链接到应用程序在App Store(https://*.com/questions/433907/how-链接到应用程序在应用程序商店) – GeneCode

你的URL可以简单地是:

https://itunes.apple.com/app/id<App ID Here>?mt=8 

更重要的是,使用SKStoreProductViewController这样你就可以显示出一个App Store页面的应用程序,而无需离开应用程式。

而且从iOS 10.3开始,您可以专门为SKStoreReviewController发布评论或评分应用。

+0

谢谢!我使用SKStoreProductViewController解决了我的问题 – ercgh

使用STORE KIT根据此处找到的新指南和文档进行请求审查。

https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview

在老版本,你可以使用

itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=<AppId>&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software