llfbandit / app_links

Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter.
https://pub.dev/packages/app_links
Apache License 2.0
176 stars 68 forks source link

Preventing Deep Link Activation Intentionally #75

Closed LinschotenMelle closed 7 months ago

LinschotenMelle commented 9 months ago

Hello everybody,

First of all I love this plugin and the features that it provides, but i still have one issue that I want to fix in my Flutter application.

Bol.com, a leading online retailer in the Netherlands, offers users a seamless and user-centric browsing experience. One notable feature of their website is their user-initiated deep link control flow. Unlike some websites where deep links are automatically triggered upon clicking, bol.com empowers users with the ability to choose when and how they want to engage with deep links.

See the two videos to see the comparison:

https://github.com/llfbandit/app_links/assets/60605935/2838431d-d59e-4ef7-8b6b-2ec7651c8752

https://github.com/llfbandit/app_links/assets/60605935/ffe74c16-6b9c-4cfa-a765-09934188a904

The assetlinks: https://www.bol.com/.well-known/assetlinks.json https://www.schippers.nl/.well-known/assetlinks.json

our 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:host="www.schippers.nl" />
        <data android:scheme="https" android:pathPattern=".*\.html" />
</intent-filter>

If somebody has a simmular issue and solved it i would love to hear it 😃

llfbandit commented 9 months ago

I may be not understand all of what you want to achieve here but it seems to be only filter issue on your side here. You are catching all html suffixes from your host, you may need to be more precise to split the behaviours (note that I don't know Google ads or whatever works). Your homepage seems to work as intented because you're not calling index.html explicitly.

Ozak93 commented 9 months ago

I think i know what you're referring to, Once you have initiated a deeplink on Schippers, any subsequent visits to the site will trigger the applink action! i'm having the same issue!

I tried draining the stream of the applinks Uri stream but it didn't work.

llfbandit commented 7 months ago

What you ask is impossible and independent of this package. As far as I know there is no way to disable this, you have to properly setup your patterns to not being reached by the system. Your setup is static (located in the manifest or entitlements) and this is what triggers the opening of the app from the system.

This package is only a bridge from native code to flutter platform to get the link value.