avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

Application Won't Verify App Link On Android #96

Closed moneer-muntazah closed 3 years ago

moneer-muntazah commented 3 years ago

Hi everyone this is not specific to the package, but I'm hoping someone here can help me out.

I'm trying to have my application use app links, but even though I went through all the steps and my assetlinks.json file is being requested, the disambiguation box still shows up. I tried the same steps with a native android app, and it worked without showing the box. Here is what I did:

1- Create a new flutter application. 2- Signed my application following the instructions on https://flutter.dev/docs/deployment/android 3- Add the following to my activity in AndroidManifest.xml

<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="<example.come>" />
            </intent-filter>

I replaced example.com with my own domain, have https enabled, and serving /.well-known/assetlinks.json

Here is the content of assetlinks.json

[
    {
        "relation": [
            "delegate_permission/common.handle_all_urls"
        ],
        "target": {
            "namespace": "android_app",
            "package_name": "com.example.app",
            "sha256_cert_fingerprints": [
                "hash_of_app_certificate"
            ]
        }
    }
]

I replaced com.example.app with my own, and changed the hash. I used this command to obtain the hash keytool -list -v -keystore <keystore path> -alias <key alias> -storepass <store password> -keypass <key password>

4- Ran flutter build apk and installed the app on my device. I can tell that assetlinks.json has been requested from the server, but the selection box still shows up.

I tested my assertlinks.json on https://developers.google.com/digital-asset-links/tools/generator and it says it is successful so whatever is wrong is on the app side.

What am I missing or doing wrong?

Here is my flutter doctor --verbose

[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19041.746], locale en-US)
    • Flutter version 1.22.5 at C:\flutter
    • Framework revision 7891006299 (7 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Moneer\AppData\Local\Android\Sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = C:\Users\Moneer\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\Moneer\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.18.1

[√] Connected device (1 available)
    • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64 • Android 11 (API 30) (emulator)

! Doctor found issues in 1 category.
moneer-muntazah commented 3 years ago

follow with https://github.com/flutter/flutter/issues/74784