Home > Mobile >  App links working when using adb but not when using url in browser
App links working when using adb but not when using url in browser

Time:10-25

I have added assetlinks.json to my domain and I have verified ith

https://developers.google.com/digital-asset-links/tools/generator

When my app is install I can see the link as verified under settings, and if I use adb like this:

adb shell am start -W -a android.intent.action.VIEW -d "https://my-domain.org/login?code=sdfsdfsdf"

It works, my app is opened. But if I type in "https://my-domain.org/login?code=sdfsdfsdf" in Chrome on the device, it simply open the URL in the Chrome browser and does not open my app.

Here is my AndroidManifest part:

<application
    android:allowBackup="false"
    android:icon="${appIcon}"
    android:label="My app">

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:hardwareAccelerated="true"
        android:launchMode="singleTask"
        android:theme="@style/LaunchTheme"
        android:windowSoftInputMode="adjustResize">
        <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:host="my-domain.org"
                android:scheme="https" />
        </intent-filter>
    </activity>
</application>

Any ideas please?

Best regards
Søren

CodePudding user response:

But if I type in "https://my-domain.org/login?code=sdfsdfsdf" in Chrome on the device, it simply open the URL in the Chrome browser and does not open my app

AFAICT, that is working as intended. App links are for links, not manually-entered URLs.

Create a Web page. Put a link to https://my-domain.org/login?code=sdfsdfsdf in the Web page. Load the Web page in Chrome. Click the link. Then, if app links are set up correctly, it should work.

  • Related