How to Programmatically check and open an existing app in iOS 8?

后端 未结 6 2007
执笔经年
执笔经年 2021-02-08 04:14

I want to check whether an app is present in my iphone or not. If it is present I want to launch it else open the App Store link of the app.

Please suggest the required

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-08 05:04

    let naviURL = NSURL(string: "yandexnavi://build_route_on_map?lat_from=55.751802&lon_from=37.586684&lat_to=55.758192&lon_to=37.642817")!
                    let res = UIApplication.sharedApplication().openURL(naviURL)
                    if !res {
                        let appStoreURL = NSURL(string: "itms://itunes.apple.com/ru/app/andeks.navigator/id474500851?mt=8")!
                        UIApplication.sharedApplication().openURL(appStoreURL)
    
                    }
    

提交回复
热议问题