Install the plugin
Package: aplyna · version 1.0.1 on pub.dev. Import: package:aplyna/aplyna.dart. Requires Dart 3.5+ and Flutter 3.24+.
flutter pub add aplynadependencies:
aplyna: ^1.0.1Send an event
import 'package:aplyna/aplyna.dart';
final installationId = await Aplyna.configure(apiKey: 'YOUR_APP_SDK_KEY');
// Only after your application permits tracking:
await Aplyna.setConsent(true);
await Aplyna.track('app_opened');
await Aplyna.flush();configure returns a persistent anonymous installation ID and starts with consent disabled. Pass installationId to retain an existing integration's identity. Await calls and handle PlatformException; flush again later after final delivery failures.
Shared methods
Use setConsent, track, flush, pendingEventCount, assignment, expose and configuration. Track accepts flowId, stepId, an AplynaAssignment and string-valued properties. Call expose only when the assigned UI appears. Configuration is code-first data: schemas 1/2 on iOS and schema 1 on Android.