Flutter pure Dart · one dependency
Cross-platform push in Flutter: firebase_messaging owns the
platform token, notibase_flutter owns everything Notibase — registration,
identity, events, inbox and click tracking.
1 · Platform credentials
Flutter apps deliver through each platform's native channel, so set up both once:
Android + iOS → Firebase
Create the project, register both apps, upload the service-account JSON to Notibase.
Complete Firebase guide →
iOS → APNs key
Create the .p8 auth key at Apple — for Flutter it's uploaded to Firebase.
APNs guide →
How iOS works with Flutter:
firebase_messaging holds FCM
tokens on both platforms, so Notibase delivers your iOS pushes through FCM's APNs
relay. That means the APNs .p8 key gets uploaded to the Firebase console
(Project settings → Cloud Messaging → Apple app configuration), and the Firebase
service-account JSON to Notibase. Devices still register as platform ios for
segmentation.2 · Install
flutter pub add notibase_flutter firebase_messaging # pub.dev
# notibase_flutter is pure Dart (no platform channels) — its only
# dependency is shared_preferences.
3 · Initialize & register
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:notibase_flutter/notibase_flutter.dart';
await Notibase.configure('ck_live_…');
// let firebase_messaging get the platform token, then hand it over:
final fm = FirebaseMessaging.instance;
await fm.requestPermission();
final token = await fm.getToken();
if (token != null) await Notibase.registerPushToken(token);
fm.onTokenRefresh.listen(Notibase.registerPushToken);
4 · Click tracking
Report notification taps so the console's Clicked and CTR columns work — two listeners cover every open path:
// app opened from a background-state tap:
FirebaseMessaging.onMessageOpenedApp.listen(
(m) => Notibase.trackNotificationOpen(m.data));
// app cold-started by a tap:
final initial = await FirebaseMessaging.instance.getInitialMessage();
if (initial != null) await Notibase.trackNotificationOpen(initial.data);
The nb_m / nb_d / nb_o keys are placed in the data payload by the Notibase
send pipeline; messages from other services are ignored safely.
5 · Identify, track, inbox
await Notibase.identify('user-42', signature: sig); // Security → identity verification
await Notibase.track('purchase', {'value': 9.99});
final inbox = await Notibase.inbox();
await Notibase.inboxMarkRead([inbox!.first.id]);