Sections
Theme

Flutter setup

Install invitebase_flutter, wire deep links, and understand the platform-channel architecture

invitebase_flutter is a Flutter plugin over the native iOS and Android SDKs via platform channels. Attribution runs natively — clipboard handoff on iOS, Play Install Referrer on Android — so a Flutter app gets the same attribution quality as a fully native one. Observers arrive as Dart Streams, so widgets rebuild on referral changes with a plain StreamBuilder.

This page covers installation and platform wiring. The methods themselves are documented once for all platforms in the SDK reference. For a guided first integration, see the Flutter quickstart.

All five SDKs ship as version 1.0 on November 15, 2026. Prebuilt UI components and push notifications are coming soon and are outside the November 15 release. Build custom UI with the SDK methods and reactive reads.

Install

pubspec.yaml
dependencies:
  invitebase_flutter: ^1.0.0
flutter pub get

The plugin uses federated platform interfaces; iOS 15+ and Android API 24+ are supported.

Configure before runApp

Call configure once before runApp. It generates (or restores) the anonymous ID (Keychain on iOS, EncryptedSharedPreferences on Android) and starts deferred attribution on first launch.

main.dart
import 'package:flutter/widgets.dart';
import 'package:invitebase_flutter/invitebase_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Invitebase.configure(publishableKey: 'pk_test_51Hq2jK');
  runApp(const MycompanyApp());
}

Deferred attribution needs no setup. For the already-installed path (Universal Links / App Links), register your Apple Team ID + bundle ID and Android package name + signing fingerprints in the dashboard under Settings → Attribution — Invitebase serves the AASA and assetlinks.json files for your {app}.refr.link subdomain. Then:

  • iOS: add the Associated Domains capability with applinks:mycompany.refr.link in Xcode (details).
  • Android: add the autoVerify intent filter for mycompany.refr.link to AndroidManifest.xml (details).

Forward incoming URIs to handleInbound with any deep-link package — non-referral URIs are ignored:

import 'package:app_links/app_links.dart';

final appLinks = AppLinks();

// Cold start
final initial = await appLinks.getInitialLink();
if (initial != null) Invitebase.handleInbound(initial);

// While running
appLinks.uriLinkStream.listen((uri) {
  Invitebase.handleInbound(uri);
});

Push notifications

Coming soon. Push notifications and setPushToken are outside the November 15 release. Use email notifications for launch.

Platform-channel notes

  • The plugin is a thin Dart layer; identity storage, event batching, attribution, and observer refresh all run in the native SDKs. Behavior in a Flutter app is byte-for-byte the behavior documented on the iOS and Android setup pages.
  • Channel calls are asynchronous; the UI isolate is never blocked.
  • On iOS, the clipboard paste affordance is a native view (UIPasteControl requires a real system control). Prebuilt referral widgets are coming soon; use a native system paste control for launch.
  • Add-to-app setups work: configure the native SDKs yourself and the Dart layer attaches to the existing instance.

On this page