Sendtrail SDK for Flutter
Install with flutter pub add sendtrail. The SDK supports Android, iOS, and Flutter Web.
It registers installations, tracks events, and updates Firebase Cloud Messaging registrations.
import 'package:sendtrail/sendtrail.dart';
final sendtrail = Sendtrail(
appId: sendtrailAppId,
getSession: (installation) async => SendtrailSession.fromJson(
await signedInApi.postJson('/api/sendtrail/session', installation.toJson()),
),
);
await sendtrail.registerDevice(appVersion: '1.0.0');
await sendtrail.track('screen_view', properties: {'screen': 'home'});
Keep the server key on your authenticated backend. See the Flutter quickstart and session exchange guide.