androidreact-nativedeep-linkingandroid-deep-link

Android app not obeying Universal Link URL path prefix specifed in AndroidManifest.xml


I have a React Native app which uses universal links.

No matter what pathPrefix I specify, it will only launch the app on links that look like https://www.companyname.com/callback/something

With my current config below, I expect it not to launch on ..../callback/... but with links like https://www.companyname.com/123callback/something.

How can it be that it seems to be stuck with /callback?

I've cleaned the android/app/build and ran ./gradlw clean etc before rebuilding. I also tried wiping data of the emulator. No luck.

This is how my android/app/src/main/AndroidManifest.xml looks

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="com.companyname.mobileapp">

    <application
            ....
        <activity
                .....>
.....
            <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="https"
                    android:host="www.companyname.com"
                    android:pathPrefix="/123callback/"
                />
            </intent-filter>

Solution

  • I found the issue.

    I needed to enable the supported web addresses in the app setttings.

    The reason why /callback was still working without this, was because the website had made https://www.companyname.com/callback/* redirect to myapp://callback/*...