Closed rekire closed 1 year ago
This is because you just keep connecting to the same stream again.
AppLinks should be instanciated only once for all the app instance.
This code gives some more context than you posted on discord. From this I would say you are misusing that stream. You always create a new stream and get the first element of it. The readme of this package recommends using .listen()
on the stream (once) and yeah that would be the proper way. Like start listening in a StatefulWidget
's initState()
and react on the changes you get in its callback. With this stream you get realtime updates. If you need the first or last app link at some point, then maybe the getInitialAppLink()
or getLatestAppLink()
methods may be more useful.
I'm using your plugin for a login flow where I redirect the user back to my app. So when I open the browser I start listening for URL like this
The problem is that when I call this code twice, that I get directly the result of the first call. I already asked some Flutter developers and it seems that you need to provide this functionality.
I tested this on MacOS, but I think that should be also on Windows.