You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m facing a problem when trying to subscribe to appLinks.uriLinkStream on multiple screens in a Flutter app. The use case requires handling deep links on both the initial screen and another subsequent screen. The flow looks like this:
On the initial screen, I subscribe to uriLinkStream to parse and handle a deep link.
After parsing and handling on the first screen, I navigate to the second screen, where I also subscribe to uriLinkStream to handle the same link but in a different way.
However, while the deep link handler on the first screen works, the handler on the second screen does not trigger, even though I am using a similar subscription setup.
Key Observations:
If I subscribe to uriLinkStream twice within the same screen (in the same State file), both subscriptions work, and both handlers trigger.
But when subscribing to the stream on two different screens, only the handler on the first screen is triggered, while the second screen doesn't respond to the deep link.
Use Case:
I need to handle the deep link differently on two screens:
On the initial screen, I process the deep link and extract some metadata.
On the second screen, after fetching additional data from the network, I want to handle the same deep link again but in a different way.
It seems like the uriLinkStream is not designed to handle multiple subscriptions across different screens, especially when navigation is involved. However, multiple subscriptions in a single screen work as expected.
Any suggestions on how to properly manage deep link subscriptions across multiple screens would be helpful!
Does it related to
[ ] App Links (Android)
[ ] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS)
[X] Custom URL schemes? (iOS and Android)
Does the example project work?
[X ] Yes
[ ] No
[ ] Irrelevant here
Did you fully read the instructions for the targeted platform before submitting this issue?
yes
Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...
[ ] Yes
[ ] No
[X ] Irrelevant here
The text was updated successfully, but these errors were encountered:
Sorry for the late reply.
Navigation should not be conflicting with streams.
Yes, your second subscription must be done before handling further events. There's no replay.
There's only a special case when first subscribing to the stream to retrieve the very first event.
Describe the bug
I’m facing a problem when trying to subscribe to appLinks.uriLinkStream on multiple screens in a Flutter app. The use case requires handling deep links on both the initial screen and another subsequent screen. The flow looks like this:
Key Observations:
Code Example:
_subscription = appLinks.uriLinkStream.listen((uri) { deepLinkHandler.handleDeepLink(uri); });
Use Case:
I need to handle the deep link differently on two screens:
On the initial screen, I process the deep link and extract some metadata.
On the second screen, after fetching additional data from the network, I want to handle the same deep link again but in a different way.
It seems like the uriLinkStream is not designed to handle multiple subscriptions across different screens, especially when navigation is involved. However, multiple subscriptions in a single screen work as expected.
Any suggestions on how to properly manage deep link subscriptions across multiple screens would be helpful!
Does it related to
[ ] App Links (Android)
[ ] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS)
[X] Custom URL schemes? (iOS and Android)
Does the example project work?
[X ] Yes
[ ] No
[ ] Irrelevant here
Did you fully read the instructions for the targeted platform before submitting this issue?
yes
Uploaded your files to webserver, HTTPS, direct connection, scheme pattern setup, ...
[ ] Yes
[ ] No
[X ] Irrelevant here
The text was updated successfully, but these errors were encountered: