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
176 stars 68 forks source link

getInitialAppLinkString always get null when application starts #25

Closed nathanael540 closed 1 year ago

nathanael540 commented 1 year ago

[android] I'm having trouble getting the app link when the app is closed and a link is clicked in the browser.

the application opens, but the initial string is always null.

Its my code on main()

AppLinks links = AppLinks(); String? initialLink = await links.getInitialAppLinkString(); if (initialLink != null) { DeepLinksController().handleLink(initialLink); } links.stringLinkStream.listen((url) { DeepLinksController().handleLink(url); });

UnluckyY1 commented 1 year ago

I am having the same issue on windows did any one found a fix for that ?

ShahinRockstarsIT commented 1 year ago

Same issue on iOS, appLinks.getInitialAppLink() always returns null?

nathanael540 commented 1 year ago

Unfortunately I can't solve this problem yet.

llfbandit commented 1 year ago

If you try to get initial link in your main method, so around calling runApp method, it won't work since the plugin is not attached to the engine.

You must call it in a widget like shown in the example.

If it still does not work, please fill a simple reproducer for investigation, otherwise this issue will be close soon.