Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open app store in ios app?

Tags:

ios

swift

I'm using this code to rate app from an ios application.

let appLink = "https://itunes.apple.com/us/app/[name of the app]/id[idnumber]?mt=8"
let url = URL(string: appLink)
UIApplication.shared.openURL(url!)

the problem is Safari says "the page address is invalid"

Is there any way to make it work? I'm using xcode 9 and swift 4

like image 764
soer Avatar asked Oct 06 '17 01:10

soer


1 Answers

Your URL can simply be:

https://itunes.apple.com/app/id<App ID Here>?mt=8

Better yet, use SKStoreProductViewController so you can show the app in an App Store page without the need to leave your app.

And as of iOS 10.3 you can SKStoreReviewController specifically to allow a user to post a review or rate an app.

like image 195
rmaddy Avatar answered Sep 22 '22 07:09

rmaddy