Search code examples
iosiphoneswift3review

Swift 3 - Open App Store Review Tab Directly (NOT the iTunes Store Review Tab)


I've searched for a way to open the App Store review tab either inside my own app or in the App Store app, to no avail. Any help on how to do this?

Notes: This is specifically for SWIFT 3, not Objective-C. I have seen old answers to open the app review tab in the iTunes store with the "purple software" url but I really dislike that it's not opening the App Store. I've used apps that open the App Store review tab directly but haven't found the code to do it.

Thanks!


Solution

  • You need to use the itms-apps:// URL scheme (instead of itms://) in order to go to the App Store instead of opening in the iTunes app.

    if let reviewURL = URL(string: "itms-apps://itunes.apple.com/us/app/apple-store/YOUR_APP_ID?mt=8"), UIApplication.shared.canOpenURL(reviewURL) {
         if #available(iOS 10.0, *) {
           UIApplication.shared.open(reviewURL, options: [:], completionHandler: nil)
         } else {
           UIApplication.shared.openURL(reviewURL)
         }     
    }