avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

getInitialUri() not fetching uri when app is in background. #20

Closed vivekshetty128 closed 4 years ago

vivekshetty128 commented 5 years ago

Your library is really good its working fine when app creates a new instance while entering to the app through deep link but in my case when app existing in the background if i entered that app through some uri by deepLinking the getInitialUri() not fetching that url.

chenxianqi commented 5 years ago

Your question may be the same as mine.https://github.com/avioli/uni_links/issues

chenxianqi commented 5 years ago

GetInitialUri () will get what it deserves only when it's cold-started, it won't get when it's opened again in the background, and it won't get results when it's monitored.

chenxianqi commented 5 years ago

No problem with Android

vivekshetty128 commented 5 years ago

I have issue in android only here i am using deep linking for resetting password so when user get the reset password link to his mail he will minimised the app and open the URL through gmail that time uni_links not fetching the URL

TBG-FR commented 4 years ago

You will have to use the link stream. getInitialUri() is only useful for when you open the app by clicking on a link. If the app is already open (minimized for example), and you want to do something when user click on a link of yours, you need to use the following :

getLinksStream().listen((String link)
{
    // handle link here
}, onError: (err)
{
    // handle error here
});