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
221 stars 81 forks source link

Support multiple instances of app_links or passthrough unhandled links #80

Closed point-source closed 6 months ago

point-source commented 1 year ago

Is your feature request related to a problem? Please describe.

While using supabase_flutter, which uses app_links to automatically handle authentication related deep links, I cannot seem to catch unrelated deep links via auto_route or app_links or otherwise. It seems that whatever most recently attaches as the link handler gets the links and can either act on them or discard them but not pass them along to the next handler.

Describe the solution you'd like

Perhaps app_links can use a singleton to hold the stream and check each time an app_links instance is created / subscribed to to see if a stream already exists or if app_links is already bound to wherever it is receiving these links from (platform channel?).

This won't solve the case for auto_route because it doesn't make use of app_links but it would allow multiple packages to use app_links simultaneously without interference. This will likely drive adoption of app_links as a standard solution for linking.

Describe alternatives you've considered

Additional context

llfbandit commented 6 months ago

On iOS, you can refer to custom setup for this to filter what should be be sent to Flutter app. Otherwise, you can filter stream events on Dart side. But there's no way, on native part, to tell that the link should not be handled. You registered at setup stage.