AyaBaghdadi / Share-RateApp

Using Swift How to Handle Rate & Share App in Apple store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Technicalisto

How to Handle Rate & Share App in Apple store

Result

Follow Steps :

  1. Add your UIViewController With two button and connect for display both function .

  2. In file of view controller define variables of itunes :

    var itunesBaseUrl = "itms-apps://itunes.apple.com/app/"

& apple apps url

    var appsBaseUrl = "https://apps.apple.com/us/app/"

& your app id want to use .

    var appId = "app_name/id00000000?"

& if you want to define language

    var appLang = "l=ar"
  1. When tap to share use this method : note , Should sender to be button
    let myurlstring = self.appsBaseUrl + self.appId + self.appLang
    let objectsToShare = [myurlstring]
    let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
    activityVC.popoverPresentationController?.sourceView = self.view
    activityVC.popoverPresentationController?.sourceRect = sender.frame
    self.present(activityVC, animated: true, completion: nil)
       
  1. When tap to Rate use this method :
    guard let url = URL(string: self.itunesBaseUrl + self.appId + self.appLang ) else {
       return
    }
    if #available(iOS 10, *) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
        UIApplication.shared.openURL(url)
    }

For Test result of Rate need Physical device

Thanks

This app is inspired by Aya Baghdadi” and copyright for @Technicalisto

About

Using Swift How to Handle Rate & Share App in Apple store


Languages

Language:Swift 100.0%