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

getInitialAppLink not working on Android from a cold start #95

Closed kubiakn closed 8 months ago

kubiakn commented 9 months ago

Describe the bug

I need to be able to route to a deeplink on Android from a cold start but it doesn't seem to be working. When I send a deeplink from cold start, the app will start but it doesn't populate the getInitialAppLink value. The value's null so it loses the deeplink. Deeplinking works from all other uses cases as long as the apps been started.

Does it related to

[ ] App Links (Android)
[X] Deep Links (Android)
[ ] Universal Links (iOS)
[ ] or Custom URL schemes? (iOS)

Does the example project work?

[ ] Yes
[ ] No
[X] Irrelevant here

      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/deep_link_prefix" />
      </intent-filter>
llfbandit commented 9 months ago

You seem to initialize the plugin too late. Please ensure to do it early to be able to catch the very first link. You can also have a look at the example which is relevant here.