how to open app when clicked on link which is shared in whatsapp or any social app through phonegap?

試著忘記壹切 提交于 2019-12-10 15:20:32

问题


1)When i share a link through phonegap plugin to whatsapp. When user clicks on link. it should check whether a particular app is installed or not. If yes, open that link in the application or else open play store link showing to download the app


回答1:


The scenario you're describing, where the device intercepts an HTTP protocol link http://example.com (as opposed to a custom URL scheme using example://), is called "Deep Linking" on Android and "Universal Links" on iOS.

It's most easily achieved in a Cordova app for iOS and Android using the cordova-universal-links-plugin - full details and usage are on the plugin GitHub page.

I'm not aware of any currently existing plugins that make equivalent functionality available on the Windows platform




回答2:


The standard solution to do mobile deep linking is now (on iOS9 and recent Android versions) the interception of http links by specific apps, as described in the answer by @DaveAlden...

However, that solution does not allow you to achieve exactly what you want, since users who do not have the target app installed are directed to the normal website instead of the app store...

To achieve what you want you have to implement "old-style" deep linking with a custom URL scheme and some Javascript magic. It is easiest to do this by using one of the many deep linking solutions, e.g. deeplink.me, branch.io or Shortcut Media (disclaimer: I currently work for Shortcut Media).



来源:https://stackoverflow.com/questions/33103555/how-to-open-app-when-clicked-on-link-which-is-shared-in-whatsapp-or-any-social-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!