I have a WKWebView, the webview will load a link like https://qr.payme.hsbc.com/2/XXXXYYYZZZ.
And there two possible results when the link is loaded,
case 1 is an app called Payme will be opened when user has installed Payme app;
case 2 is webview will be redirected to a static page https://payme.hsbc.com/ when user has not installed Payme app.
My question is how can I know if the Payme app is opened?
You could use
deep linkingor the apple recommendeduniversal linkingto check if an app is installed in a device. Withdeep linkingwhat you need to do is to acquire a schema of the app that the app has already added. And you could check if the schema can be opened just like you would do for any other type of URLs. Here is an example:You need to update your
info.plistfile to include the schemes you'll be opening in the application. You should append this:Here is an entire youtube video link regarding this. Also, checkout universal-linking.