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

Community
  • 1
  • 1
Ricky
  • 569
  • 4
  • 16
  • 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 http://stackoverflow.com/questions/3654144/direct-rate-in-itunes-link-in-my-app/4382571#4382571 – lschult2 Jun 12 '13 at 22:21
  • What about IOS 8.4. Any luck? – Hugo Alonso Jul 30 '15 at 16:53

1 Answers1

-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")
Draken
  • 3,134
  • 13
  • 34
  • 54
gsachar
  • 19
  • 5