I have my custom website where my android app will get data.
Lets call it example.com
.
My android app can share links via other applications like WhatsApp. When link is shared, it creates link like http://example.com/my/path/to/information
.
I want to open my own application when this link is clicked. In my AndroidManifest
file I have added these lines of code for my intent:
<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="example.com" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
My Activity handles its intent like this:
Intent intent = getIntent();
Log.d("My_intent", intent.toString());
mainNewsId = intent.getStringExtra("news_info");
Log.d("News_result", mainNewsId);
When I use other applications where link is shared and click it, it must suggest to me applications that can open this link.
However, it does not suggest my application that shared this link.
What did I miss? Do I need to add meta
tags to my webpage for android?
========================UPDATE=================================
I have found an interesting outcome. In my intent filter, if I write on android:host
some other popular site, which has its own android app, it suggests to open my applcation along with its own application when I click to link.
Does it mean that I need to write something in my webpage?