Deep links
Deep links in the Flutter SDK.
import 'package:nexus_flutter/nexus.dart';| Symbol | Kind | Summary |
|---|---|---|
NexusDeepLinkSource | enum | Where a NexusDeepLink came from. |
NexusDeepLink | class | A Nexus link that brought the user into the app, as the server resolved it. |
NexusLinks | class | Deep linking & attribution (OneLink-style), automatic with linksEnabled: |
NexusDeepLinkSource
enumenum NexusDeepLinkSourceWhere a NexusDeepLink came from.
| Value | Description |
|---|---|
NexusDeepLinkSource.install | The first launch after an install, matched to the link that led to it (deferred deep link). |
NexusDeepLinkSource.open | The app was opened by a Nexus link while already installed. |
NexusDeepLink
classA Nexus link that brought the user into the app, as the server resolved it.
View sourceNexusDeepLink
constructorconst NexusDeepLink({required this.source, this.uri, this.path, this.params = const {}, this.slug, this.campaign, this.mediaSource, this.channel, this.clickId, this.matchType})Parameters
Prop
Type
isDeferred
propertybool get isDeferredsource
fieldfinal NexusDeepLinkSource sourceuri
fieldfinal Uri? uriThe URL that opened the app. Null for a deferred match after an install.
View sourcepath
fieldfinal String? pathWhere to take the user: the link's deep-link value (console), else the path of the URL that opened the app.
View sourceparams
fieldfinal Map<String, dynamic> paramsThe link's deep-link parameters (console → link → deep-link params).
View sourceslug
fieldfinal String? slugcampaign
fieldfinal String? campaignmediaSource
fieldfinal String? mediaSourcechannel
fieldfinal String? channelclickId
fieldfinal String? clickIdmatchType
fieldfinal String? matchTypedeterministic, probabilistic or organic.
NexusLinks
classDeep linking & attribution (OneLink-style), automatic with linksEnabled:
- Install — reported once per install on first launch, matched to the link click exactly via the Google Play install referrer on Android, or by the opening link itself, else by the server's fingerprint window.
- Open — every launch or resume from a Nexus link is reported, matched exactly by its click-id.
- Routing — when the app's router could not have seen the link (deferred deep link after install; app opened by the short link itself via App Links / Universal Links), the SDK routes to the link's deep-link value by delivering it as a platform deep link — any Router or Navigator handles it.
Uninstalls are measured server-side (silent push probes); nothing runs here.
View sourceonLink
propertyStream<NexusDeepLink> get onLinkEvery Nexus deep link as it is resolved (install or open).
View sourceconsumePending()
methodNexusDeepLink? consumePending()The last deep link the SDK did NOT route itself (routing off, or the
onDeepLink handler took over), cleared on read — e.g. route it from your
home screen once the user has logged in.
Returns NexusDeepLink?
start()
methodFuture<void> start()Wire automatic install/open reporting. Called by Nexus.init when
linksEnabled; idempotent.
attribute()
methodFuture<Map<String, dynamic>?> attribute({String type = 'install', String? clickId, String? slug, String? name, String? platform, Map<String, Object?>? properties})Report a conversion. Pass clickId (from the link) for deterministic
attribution, or slug when the app was opened by the short link itself;
otherwise the server matches by fingerprint. Returns the matched link's
deep-link data (or null if unattributed).
Parameters
Prop
Type
Returns Future<Map<String, dynamic>?>
handleDeepLink()
methodFuture<Map<String, dynamic>?> handleDeepLink(Uri uri, {String type = 'open'})Convenience: parse a deep-link uri for link_click_id and attribute an
open, returning the deep-link data. Not needed with linksEnabled, which
reports opens automatically.
Parameters
Prop
Type
Returns Future<Map<String, dynamic>?>
dispose()
methodvoid dispose()