BRDroid
BRDroid

Reputation: 4388

How to open android app by clicking on a link in the email

i want to open my android app by clicking on a weblink, I sent this web link to my email/slack and tried to click the link but android app did not open.

I followed https://developer.android.com/training/app-links to create the link

links i tried - http://xxxxappdemo.com

    <!-- Activities -->
    <activity
        android:name=".splash.ui.SplashActivity"
        android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="http" />
            <data android:scheme="https" />

            <data android:host="xxxxappdemo.com" />
        </intent-filter>
    </activity>

Could you suggest what I might be wrong here please

thanks R

Upvotes: 2

Views: 3292

Answers (1)

Amy
Amy

Reputation: 1390

On here it mentions that you need a json file under the website you're using app links for. So first, it looks like you'll need to add a json file named assetlinks.json under the folder well-known (under your website).

Then, in Android Studio, go to Tools > App link assistant. Once it opens, click the "Open digital asset links file generator"

enter image description here

Then on the right side fill the details, and click "Generate details asset links file"

enter image description here

Then, copy the json it provides and paste it into your assetlinks.json file. Let me know if this works for you :)

Upvotes: 1

Related Questions