I found an answer to implement a link to get rated on the app store (App store link for "rate/review this app"). Answer is:
let appID = "Your App ID on App Store"
let urlStr = "itms-apps://itunes.apple.com/app/id\(appID)" //
(Option 1) Open App Page
let urlStr = "itms-apps://itunes.apple.com/app/viewContentsUserReviews?
id=\(appID)" // (Option 2) Open App Review Tab
if let url = URL(string: urlStr), UIApplication.shared.canOpenURL(url)
{
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler:
nil)
} else {
UIApplication.shared.openURL(url)
}
}
I am having trouble understanding how to implement this. Particularly I don't understand how the if statement will take the user to the app store.
Thanks.