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

[Android] Regression in 4.0.0: link no longer passed to application #106

Closed mauriziopinotti closed 3 months ago

mauriziopinotti commented 3 months ago

Describe the bug

When scanning an NFC tag on Android the app doesn't receive the link, i.e. uriLinkStream listener is not called.

The issue started happening in version 4.0.0 and is caused by https://github.com/llfbandit/app_links/commit/cc6aea933d1a8eee7bdca3729dba9295cb444436 (reverting it locally does make the issue go away).

My callback:

      _appLinks!.uriLinkStream.listen((Uri uri) {
        print("Initial screen: uri = $uri");
        _handleUri(context, uri: uri);
      }, onError: (err) {
        print("Initial screen: listen returned $err");
      });

Logs with app_links 3.5.1:

03-19 11:27:00.925 26680 26680 D com.llfbandit.app_links: Intent { act=android.nfc.action.NDEF_DISCOVERED dat=https://get.easyhour.app/... flg=0x10400000 cmp=it.easyhour.app/.MainActivity (has extras) }
03-19 11:27:00.925 26680 26680 D com.llfbandit.app_links: handleIntent: (Data) https://get.easyhour.app/l/clock?company=35&branch=29&
03-19 11:27:00.926 26680 26743 I flutter : Initial screen: uri = https://get.easyhour.app/l/clock?company=35&branch=29&
03-19 11:27:00.926 26680 26743 I flutter : Initial screen: handle uri https://get.easyhour.app/l/clock?company=35&branch=29&

Logs with app_links 4.0.0:

03-19 11:16:54.365 21076 21076 D com.llfbandit.app_links: Intent { act=android.nfc.action.NDEF_DISCOVERED dat=https://get.easyhour.app/... flg=0x10400000 cmp=it.easyhour.app/.MainActivity (has extras) }

Does it related to

[X] App Links (Android)
[ ] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS)

Does the example project work?

[ ] Yes
[ ] No
[X] Irrelevant here

Did you fully read the instructions for the targeted platform before submitting this issue?

Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...

[X] Yes
[ ] No
[ ] Irrelevant here