1

I have created an application which is similar to the website. When a user visits the website on their iOS or Android device I want to output a link which lets them open or download the application.

For example when you visit Youtube on your mobile device a popup appears saying Open this page in "YouTube":

enter image description here If you click this popup it opens the YouTube app on my phone.

I want to do this with my website and application. The app is created using Cordova. Does anyone know how to do this? I found this question which is similar, but it is for native iOS. I need a cross platform Cordova solution.

smj2393
  • 1,929
  • 1
  • 23
  • 50

2 Answers2

2

Try this :

<activity android:name=".MyActivity">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:host="www.myapp.com" android:scheme="MyApp" />
    </intent-filter>
</activity>
SANAT
  • 8,489
  • 55
  • 66
  • Yeah I found a few solutions native, struggling to find one Cordova specific. Thanks though! – smj2393 Aug 14 '15 at 11:27
  • 1
    @smj2393 use this : http://stackoverflow.com/questions/23977451/cordova-plugin-for-launch-app-from-browser-using-url-schemas – SANAT Aug 14 '15 at 11:39
1

In case someone is looking for a similar solution in the future.

As @sanat shukla mentioned in the comments there is a plugin created by EddyVebruggen which allows you to do this:

https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin

smj2393
  • 1,929
  • 1
  • 23
  • 50