Skip to content

fix(deeplink): deliver the deferred deep link only on the launch that reports the install - #17

Merged
onamfc merged 1 commit into
mainfrom
fix/deferred-once
Oct 21, 2026
Merged

onamfc merged 1 commit into
mainfrom
fix/deferred-once

Conversation

@onamfc

@onamfc onamfc commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Builds on #16 (merged).

Summary

Behavior change. onDeferredDeepLink was called on every launch with the attribution recorded at install, as documented, so an app whose callback navigated had to keep its own "already handled" flag. The iOS, Android, React Native and Expo SDKs call it once, on the launch that reports the install. Flutter now does the same:

  • Launch that reports the install: the callback receives the install's link, or null for an organic install, as before. A callback registered after initialize() returns on that launch is still called immediately.
  • Later launches: the callback isn't called. The attribution stays available from getInstallData().

Changes

  • DeepLinkHandler.deliverDeferredDeepLink returns early when isNewInstall is false: no callback, no cached value to replay to a late-registered callback, no last-click open (unchanged).
  • Docs: onDeferredDeepLink KDoc and the README's deferred deep link section.
  • Version 0.4.0: minor, because it changes behavior. Apps on ^0.3.x keep 0.3.2 (fix(events): succeed on the event endpoint's reply and send each queued event once #16) until they move to ^0.4.0.

Tests

  • a later launch delivers no deferred deep link: replaces a cached install does not replace last-click attribution, which asserted the per-launch delivery; it still checks last-click attribution isn't written, and that getInstallData() returns the cached link. Fails without the change.
  • the launch that reports the install delivers the deferred deep link once.
  • flutter test: 149 passed. flutter analyze and dart format: clean.

Base automatically changed from fix/event-response to main October 21, 2026 03:23
… reports the install

onDeferredDeepLink was called on every launch with the attribution
recorded at install, so an app had to remember that it had handled the
link. It is now called once, on the install's launch, as in the other
SDKs; the attribution stays available from getInstallData(). Version
0.4.0.
@onamfc
onamfc force-pushed the fix/deferred-once branch from 346e500 to 09a460e Compare October 21, 2026 03:23
@onamfc
onamfc merged commit 25bbef6 into main Oct 21, 2026
4 checks passed
@onamfc
onamfc deleted the fix/deferred-once branch October 21, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants