0

i need to open an external app from my app, my backend give me data like com.whatsapp or com.facebook.Facebook etc .

when I look for this on the internet , it suggests answers using url scheme like whatsapp:// .. but it is not what I need.

this is my code

func openApp(app : String) {

        if let url = URL(string: app),
            UIApplication.shared.canOpenURL(url) {
            if #available(iOS 10, *) {
                UIApplication.shared.open(url, options: [:], completionHandler:nil)
            } else {
                UIApplication.shared.openURL(url)
            }
        } else {
            customAlert(title: "error", message: "Failed to open \(app)")
        }



    }
Mike_Jr
  • 335
  • 1
  • 2
  • 18
alex
  • 35
  • 7
  • 2
    https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272 – mag_zbc May 15 '19 at 08:55
  • 2
    on iOS platform, it is only allowed to open third party app from your app using URL schemes. There is no other way. If you try to manipulate it then you may face rejection in App Store approval process. – Mahendra May 15 '19 at 08:57
  • https://stackoverflow.com/questions/29902534/how-to-open-fb-and-instagram-app-by-tapping-on-button-in-swift – Naresh May 15 '19 at 12:01

0 Answers0