【问题标题】:skstoreproductviewcontroller: how to open "rating and review" at launchskstoreproductviewcontroller:如何在启动时打开“评级和评论”
【发布时间】:2013-02-12 07:56:07
【问题描述】:

我看到一些关于SKStoreProductViewController的教程,例如: Open a list of my apps in the App Store within my App

但是,它总是在启动时以“详细信息”打开 SKStoreProductViewController,我如何以编程方式打开“评分和评论”

【问题讨论】:

  • 您找到解决方案了吗?
  • 这在 iOS6 中似乎是不可能的。但是iOS5调用URL的解决方案确实出现了在评分页面启动App Storestackoverflow.com/questions/3654144/…
  • IOS 8.4 怎么样。运气好吗?

标签: ios rating storekit review


【解决方案1】:

下面的代码 sn-p 将打开本地 AppStore 应用的评论和评分部分

struct AppStoreURLs {
    static let templateReviewURLiOS8 = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software"
}


func showAppReivewScreen(_ appId: String?)  {

        guard let applicaitonIdentifier = appId, (applicaitonIdentifier.isEmpty == false) else { return }

                let reivewURL = String(format: AppStoreURLs.templateReviewURLiOS8, applicaitonIdentifier)

        if let url = URL(string: reivewURL), UIApplication.shared.canOpenURL(url) {

            if #available(iOS 10.0, *) {
                UIApplication.shared.open(url, options: [UIApplicationOpenURLOptionUniversalLinksOnly : false], completionHandler: nil)
            } else {
                UIApplication.shared.openURL(url)
            }
        }

    }

使用应用程序标识符调用此函数

self.showAppReivewScreen("951627022")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-13
    • 2014-09-10
    • 2011-07-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多