Not able to download enterprise build inside the App?

32 Views Asked by At

I have done following to make user force update Enterprise App (if current version is out dated). But, when I click on Update button, nothing opens. What may be the issue?

let currentVersion : String = (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "")

func checkVersionUpdate(info: NSDictionary)
{
    if let serverVersion = info.value(forKeyPath: "Data.AppVersion") as? String,
        let appURL = info.value(forKeyPath: "Data.AppURL") as? String 
    {
        if serverVersion.compare(currentVersion, options: .numeric) == .orderedDescending {
            
            self.lblVersionMsg.text = "Your App is out of date."
            
            AppDel.showAlert(title: "A new version of this App is available.", 
                message: "Please update to version \(serverVersion) now.",
                controller: self) 
            { 
                self.updateApp(url: appURL)
            }
        } 
        else {
            self.lblVersionMsg.text = "Your App is up to date."
        }
    }
}

func updateApp(url: String)
{
    // url = "https://www.dropbox.com/s/................/manifest.plist?dl=0"
    
    if let installationUrl = URL(string : "itms-services://?action=download-manifest&url=\(url)") {
        UIApplication.shared.open(installationUrl, options: [:], completionHandler: nil)
    }
}  

plist file contains the URL to IPA and both the files are in same DropBox folder.

0

There are 0 best solutions below