I want to open my app from an email URL, basically like the example shown below for Twitter.com.
Email with link:
Selection to open app or browser:
After you click on the app choice, the Twitter app opens:
I tried the following code, but it is not working:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.twitter.com" android:scheme="http"></data>
</intent-filter>
If anyone has a proper answer, please write some examples here.
For me, none of the answers posted here worked. I tried tens of different syntaxes without any success. I was getting a parsing error while building the app via Cordova.
I finally encountered this answered which led me on the right track.
So I created a hook in the
PROJECT_ROOT/hooks/after_prepare/
folder called010_add_intent_filters.sh
. Here is the content of this hook :This finally worked. No modification to
config.xml
is required if you take the hook path. I hope this helps someone in need.PS: I am convinced Cordova is a great technology, but I have rarely seen such a badly documented library... How painful it is to work with it is just unbelievable.
The following code worked for me:
With the email link set as
http://www.my.app.com/launch
.Ref: Launching Android Application from link or email
Ex: Your url will be something like https://roadies.com and you have the intent filter in manifest as below