7

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!

Trev14
  • 3,626
  • 2
  • 31
  • 40
  • http://stackoverflow.com/questions/3124080/app-store-link-for-rate-review-this-app?noredirect=1&lq=1 – matt Feb 14 '17 at 19:12

1 Answers1

16

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)
     }     
}
Laszlo
  • 2,803
  • 2
  • 28
  • 33
Collin
  • 478
  • 5
  • 7