skstoreproductviewcontroller: how to open "rating and review" at launch
Asked Answered
M

1

15

I see some tutorial about SKStoreProductViewController, such as: Open a list of my apps in the App Store within my App

However, it always opens SKStoreProductViewController with "Details" at launch, how can I open "rating and review" programmatically

Mancuso answered 26/2, 2013 at 18:17 Comment(2)
This appears to not be possible in iOS6. But the iOS5 solution of calling the URL does appear to launch the App Store in the rating page #3654644Lassitude
What about IOS 8.4. Any luck?Intravasation
C
-1

Below code snippet will open the reviews & ratings section on native AppStore app

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)
            }
        }

    }

call this function using application identifier

self.showAppReivewScreen("951627022")
Conditioner answered 6/6, 2017 at 15:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.