Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep link immediately opens a default browser on Xiaomi with MIUI not asking #166

Open
Nazarii77 opened this issue Jan 11, 2023 · 8 comments

Comments

@Nazarii77
Copy link

Nazarii77 commented Jan 11, 2023

It works as in the example:

Deep link immediately opens a default browser on Xiaomi with MIUI

<!-- Deep Links -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
            <data
                android:scheme="https"
                android:host="my.reservation"  />
        </intent-filter>

When I execute powershell script:

.\adb shell 'am start -W -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://my.reservation/path/portion/?uid=123&token=abc"'
it works fine!

But in real world scenario when I send myself EMAIL with the link https://my.reservation/path/portion/?uid=123&token=abc and click on mobile phone it opens the default browser, when I type this in browser also it tries to google it. I have a MIUI from XIAOMI operation system on my android device

@Nazarii77
Copy link
Author

so I have decided to try this: instead of rewriting https rule I will make my own links like "myapp://reservation/123" and in scheme will use "myapp" and for this to be link I will style it so it will look like link in email

@Nazarii77
Copy link
Author

with custom scheme mobile email blocks the deep link :( and the link is not clickable

@akarabas-esarj
Copy link

App Links only work with https scheme and require a specified host, plus a hosted file - assetlinks.json. Check the Guide links below.

If you have done these steps, you should generate a signed apk in release mode and try it with it. If the fingerprint in assetlinks.json and the keystore where the application is signed are the same, app-links should work.

@roiskhoiron
Copy link

App Links only work with https scheme and require a specified host, plus a hosted file - assetlinks.json. Check the Guide links below.

If you have done these steps, you should generate a signed apk in release mode and try it with it. If the fingerprint in assetlinks.json and the keystore where the application is signed are the same, app-links should work.

so there is i cant take the result work normaly while on debug mode?

@roiskhoiron
Copy link

in my case, i use xiaomi MIUI its work normal debug or release mode. but in other phone ex. 'Oppo' its not work. why ?

@roiskhoiron
Copy link

i think its about intent security polcy between vendor.

@Nazarii77
Copy link
Author

I had the same exact issue, my xiomi is working on Android 10 which allows you to test such case and Oppo is working on newer version of Android like 12 which by default blocks such scenario

@Nazarii77
Copy link
Author

I have soled the issue, so the android:autoVerify="true" allows for android 10 (Xiomi) to test it without actually setting up assetlinks.json but will show you choosing option between browser and app. If you do everything correct it will automatically open app (testing on android 12 is impossible without setting assetlinks and signing app which is terrible)



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants