Overview
This is the integration guide for the B2Metric Flutter SDK, written for the person adding it to a Flutter app rather than for someone deciding whether to use it. It follows the order you'd naturally work through: install the package, initialize it, send an event, and then everything else once you need it, like user identification and push notification tracking.
One of the nicer things about this SDK is that the same code works on both iOS and Android without any platform-specific setup, so you shouldn't need to duplicate anything between the two. If you're just getting started, the Quick Start section is genuinely the fastest path to seeing data show up on your end. The Configuration section is worth a read once you move past the defaults, since a few of the settings (appIdentifier in particular) are required rather than optional.
If something isn't behaving the way you expect, check the Troubleshooting section before assuming it's a bug. Most of the issues that come up during integration are covered there.
The B2Metric Flutter SDK is the official client library for sending analytics data from Flutter applications to the B2Metric platform. It captures user interactions as events, manages user sessions automatically, registers push notification tokens, and handles the entire delivery pipeline — batching, retry logic, offline persistence — without requiring any additional setup.
The SDK ships as a single Dart package with zero third-party runtime dependencies and runs natively on both Android and iOS through the same unified API.
Setup and releases: pub.dev/packages/b2metric_sdk
Features
- Custom event tracking with properties and item-level data
- User identification with custom attributes (
setUser) - Automatic session management (
first_open,session_start,session_end) - Push notification token registration (FCM, HMS, APNS) and open tracking
- Offline event queuing with persistent storage
- Automatic batching, retry with exponential backoff, and network-aware delivery
- Automatic device and app metadata collection
- Configurable log levels for debugging
- Zero third-party dependencies (uses Flutter SDK only)
Requirements
- Flutter >= 3.10
- iOS 13+ / Android API 24+