Swift 4.1. One developer can have more than one app on AppStore. So, I need to check if user has installed other apps or not by the same developer. I had Bundle ID's of other apps. Although you can use **Appname** instead of **Bundle Id**. So I followed the following steps.
1. In your current app add LSApplicationQueriesSchemes key of type Array in your info.plist file. Make entry of bundle id or Appname of app there which you want to open from your app.
[![enter image description here][1]][1]
2. Other app should have their bundle id or Appname entry in that app URL Scheme.
[![enter image description here][2]][2]
3. In your current app check if that app in installed in iPhone or not and can open accordingly.
> let app = UIApplication.shared
> let bundleID = "some.Bundle.Id://"
> if app.canOpenURL(URL(string: bundleID)!) {
> print("App is install and can be opened")
> let url = URL(string:bundleID)!
> if #available(iOS 10.0, *) {
> UIApplication.shared.open(url, options: [:], completionHandler: nil)
> } else {
> UIApplication.shared.openURL(url)
> }
> } else {
> print("App in not installed. Go to AppStore")
> }
4. You can also test it from Safari browser. Just type the following in search bar
> URL_scheme:// or Bundle_Id://
If app is installed the it will show alert with Appname to open it in app.
[![enter image description here][3]][3]
[1]:
[2]:
[3]: