Flutter SDK

The Reteno Flutter SDK for Mobile Customer Engagement and Analytics Solutions

Flutter SDK Setup

The Reteno Flutter SDK provides mobile customer engagement, push notifications, in-app messages, App Inbox, recommendations, and analytics for Flutter applications.

Requirements

Reteno plugin minimums:

  • Dart 3.1.3 or later
  • Flutter 3.3.0 or later
  • Android 5.0 or later (minSdkVersion 21) to build and install; Reteno Android SDK 2.10.1 activates its functionality only on Android 8.0 (API 26) or later
  • iOS 12.0 as the technical podspec minimum, with iOS 14.0 or later recommended, Xcode 15.0 or later, and Swift 5.7 or later

The iOS flow in this documentation uses unpinned FlutterFire, which raises those minimums. As of August 2026, FlutterFire resolves Firebase Apple SDK 12.x, which requires iOS 15.0, Dart 3.6.0, Flutter 3.27.0, Xcode 26.2 or later, and CocoaPods 1.12.0 or later. See the FlutterFire version table and the Firebase Apple release notes. Always use the highest minimum required by your resolved dependencies, and keep Runner and every notification extension on the same iOS target.

Installation

Add the plugin to your Flutter project, pinning the documented version:

flutter pub add reteno_plugin:1.11.0

Then follow the platform-specific setup guide:

Initialize the SDK

Initialize Reteno once during application startup, before calling any other Reteno API. Event-stream listeners are the exception: register them before initialize() so they receive native events flushed during initialization. The block below shows the API shape only; use the complete block from the platform guide instead.

import 'package:flutter/widgets.dart';
import 'package:reteno_plugin/reteno.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Reteno().initialize(
    accessKey: '<your_access_key>',
    options: RetenoInitOptions(
      lifecycleTrackingOptions: LifecycleTrackingOptions.all(),
    ),
  );

  runApp(const MyApp());
}

Get the access key in Reteno → Settings → Mob Push → select the mobile app → Access Keys.

The initialization options are:

OptionDefaultBehavior
lifecycleTrackingOptionsAll lifecycle tracking enabledUse LifecycleTrackingOptions.all(), .none(), or provide individual appLifecycleEnabled, pushSubscriptionEnabled, and sessionEventsEnabled values
isPausedInAppMessagesfalseStarts the SDK with in-app messages paused
isDebugfalseEnables native Reteno debug mode
deviceTokenHandlingModeautomaticiOS token strategy; see Select the iOS push token mode. Ignored on Android
defaultNotificationChannelConfignullAndroid-only default notification-channel settings

From version 1.11.0, customDeviceId is supported on both platforms. The asynchronous provider is awaited once before native initialization. Return one stable, non-empty value across launches, or null to keep the native default. A blank value throws ArgumentError, a non-blank value is forwarded verbatim, and there is no timeout, so a provider that never completes leaves initialize() pending. On iOS, null does not reset a previously stored custom ID, and enabling a custom ID on an existing installation changes its device identity: test that migration before rollout.

On iOS, initialize() completes only when native initialization is ready, and a second call with a different token mode fails. On Android it completes after the configuration call, while native initialization continues asynchronously.

initWith(...) remains available as a backward-compatible alias. Use initialize(...) for new integrations.

Connect the Push Provider

The access key alone does not deliver push notifications. Connect the mobile app in Reteno → Settings → Mob Push and add the provider that matches the token mode: the Firebase service-account JSON for FCM, or the APNs .p8 key or .p12 certificate whose Topic matches the iOS bundle identifier.

Use separate Reteno mobile apps and access keys for staging and production.

Verify the Integration

Request push permission at the appropriate point in your user flow, then run diagnostics:

final granted = await Reteno().requestPushPermission();
final issues = await Reteno().diagnose();

if (!granted || issues.isNotEmpty) {
  // Keep the user in the setup flow and inspect the reported issues.
}

An empty list means the local checks passed; it does not validate credentials, the App Group and service extension, token-mode selection, or delivery. Finish by identifying a test contact and sending a Reteno test push to a physical device.

See Push notifications for permission handling, diagnostic codes, token configuration, and the end-to-end checklist.

License

The Reteno Flutter SDK is released under the MIT license. See the LICENSE for details.