uni_links icon indicating copy to clipboard operation
uni_links copied to clipboard

linkStream.listen() not working for Android phones

Open MarkoKrstanovicBM opened this issue 2 years ago • 5 comments

I'm using AppLinks for Android with https scheme and deeplinking is working fine. The issue that I have is with linkStream.listen(String link) method. It never gets called. For iOS everything works fine, deeplinking opens the app and the listener is activated, but for Android deeplinking opens the app and nothing happens listener is not activated.

I am using Samsung Galaxy S21 Ultra (Android 12) and some other Samsung phones with older versions of Android OS.

  _subscription = linkStream.listen((String link) {
     // some code here
    }, onError: (err) {
      print(err);
      // Handle exception by warning the user their action did not succeed
    }, onDone: () {
    // some code here
    });```

MarkoKrstanovicBM avatar Jan 24 '22 14:01 MarkoKrstanovicBM

Same issue here. Did you find any solutions?

weilaimg avatar Jan 31 '22 02:01 weilaimg

I'm using AppLinks for Android with https scheme and deeplinking is working fine. The issue that I have is with linkStream.listen(String link) method. It never gets called. For iOS everything works fine, deeplinking opens the app and the listener is activated, but for Android deeplinking opens the app and nothing happens listener is not activated.

I am using Samsung Galaxy S21 Ultra (Android 12) and some other Samsung phones with older versions of Android OS.

  _subscription = linkStream.listen((String link) {
     // some code here
    }, onError: (err) {
      print(err);
      // Handle exception by warning the user their action did not succeed
    }, onDone: () {
    // some code here
    });```

Hi Marko

I found the solution: https://github.com/avioli/uni_links/issues/119#issuecomment-864503324

It really helps me. Hope you are doing well.

weilaimg avatar Jan 31 '22 04:01 weilaimg

Same Problem here +1 - worked fine for a year now does not do anything anymore

vicdotdevelop avatar Feb 17 '22 10:02 vicdotdevelop

@weilaimg do you have a code snippet? For me trying out alle the launchmode values did worked. I used it for oauth with the flutter oauth2 library with system browser. The app opens up again afterwards but the listener doesnt catch up

vicdotdevelop avatar Feb 17 '22 11:02 vicdotdevelop

Hello, I was facing this issue since 7 days , I tried all Firebase Dynamic Links, uni_links both of them were running on either one of device ( Dynamic links on android, and uni_links on iOS) so I finally tried this small hack where I installed both libraries and checked based on platform inside initState() if (Platform.isIOS) { _handleIncomingLinks(); _handleInitialUri(); } else { _dynamicLinkService.retrieveDynamicLink(context); }

KosarMitha avatar Mar 22 '22 11:03 KosarMitha