Skip to the page

Flutter SDK

Install and initialise

Add becklinks_flutter, configure it and receive links.

becklinks_flutter is the Flutter plugin for Android and iOS. It opens the right screen for a link, delivers the destination after an install, reports attribution and sends your events. It has no native code to add: you only do the platform setup (Android, iOS).

The package was called becklink_flutter up to version 0.2.1. If your app still uses the old name, change the dependency to becklinks_flutter: ^0.3.0 and the import to package:becklinks_flutter/becklinks_flutter.dart; nothing else changes. The old package only re-exports the new one, so it keeps working until you do.

Get it: becklinks_flutter on pub.dev · API reference · Changelog · All versions

Requirements#

WhatMinimum
Flutter and DartFlutter 3.27 (Dart 3.6)
iOSiOS 15, Xcode 16 or newer
AndroidAndroid 6.0 (API 23), compileSdk 35
Beck LinksA project with your app configured and its publishable key

Install#

Bash

Configure once, route in one place#

Dart

onLink keeps the newest links until the first listener subscribes, so nothing is lost between configure() and listen(). Use pk_test_… while developing and pk_live_… in release builds.

For links that survive an install on iPhone, also pass enablePasteboard: true to configure(); it is off in code by default (see Deferred deep linking). Android needs nothing extra.

What a LinkEvent tells you#

FieldMeaning
url, pathThe link and the in-app route to open
paramsQuery parameters of the opened URL; for a deferred link, the ones your link allows to pass through
dataThe custom JSON of the link
isDeferredtrue when the link was kept through an install
matchMethod, confidenceHow the link was matched (app_link, install_referrer, pasteboard, …) and how sure that is
linkId, campaign, clickedAtWhich link and campaign it came from
resourceFor links of an item pattern: the item (type and id); otherwise null

Attribution and events#

Dart

See Attribution and events for names, limits and what is sent.

The SDK uses no advertising ID, no device fingerprinting and shows no tracking prompt. To wait for consent, call setTrackingEnabled(userHasConsented) right after configure(). While tracking is off, links still open and route, but no first open, sessions or events are sent.

Verify it works#

  1. Run a debug build with configure(apiKey: …, logLevel: LogLevel.debug).
  2. Open a test link on the phone (Notes or Messages on iOS; on Android, adb shell am start -W -a android.intent.action.VIEW -d "https://acme-test.becklinks.com/abc123" com.acme.shop).
  3. The console shows [BeckLink] INFO: Delivering LinkEvent(…) and the app opens the linked screen.

The package page on pub.dev has the README, the API reference and the changelog. Next: Handle links in your app.