The Mapp Engage Flutter plugin connects your Flutter application to the native Mapp Engage SDKs on Android and iOS. It lets you initialize the SDK, register devices, manage user aliases, enable push notifications, and use engagement features such as in-app messaging and geofencing.
This guide helps you complete a basic integration and verify that the SDK is ready to use.
Before you begin
Make sure the following prerequisites are in place:
A Flutter application
Access to your Mapp Engage credentials:
SDK key
App ID
Tenant ID
Server region
For Android, a Google project ID if required by your setup
For iOS, the required push notification capabilities and APNs configuration in Xcode
If you plan to use geofencing, add the required location permissions for the target platform before enabling those features.
Minimum requirements
Dart 3.5.0 or later, Flutter 3.24.0 or later
Android: compileSdkVersion 36 or later
iOS: iOS 12.0 or later (SDK 6.x)
Install the Flutter plugin
Add the plugin to your pubspec.yaml file:
dependencies:
mapp_sdk: ^0.0.13Then install the dependency:
flutter pub getImport the SDK
Import the required package in your application:
import 'package:mapp_sdk/mapp_sdk.dart';
import 'package:mapp_sdk/helper_classes.dart';
import 'package:mapp_sdk/notification_mode.dart';The notification_mode.dart import is only required if you want to customize the notification mode during initialization.
Initialize the SDK
Initialize Mapp Engage before calling runApp(). This must be the first Mapp Engage call in your application lifecycle.
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await MappSdk.engage(
'YOUR_SDK_KEY',
'YOUR_GOOGLE_PROJECT_ID',
SERVER.L3,
'YOUR_APP_ID',
'YOUR_TENANT_ID',
NotificationMode.backgroundAndForeground,
);
runApp(MyApp());
}Initialization parameters
Parameter | Type | Description |
|---|---|---|
|
| The SDK key provided for your Mapp Engage setup. |
|
| The Google project ID. On iOS, pass an empty string if it is not used. |
|
| The Mapp Engage backend region. |
|
| Your application ID, provided as a string. |
|
| Your Mapp Engage tenant identifier. |
|
| Optional. Controls when push notifications are shown. The default is |
Select a notification mode
You can control how notifications are displayed during initialization.
Value | Description |
|---|---|
| Show notifications when the app is in the background and foreground. This is the default value. |
| Show notifications only when the app is in the background. |
| Receive push payloads without displaying a visible notification. |
Verify that the SDK is ready
After initialization, check whether the SDK is ready before calling other SDK methods.
final bool ready = await MappSdk.isReady();
if (ready) {
print('Mapp Engage is ready.');
} else {
print('Mapp Engage is not ready yet.');
}
Retrieve the current alias
When initialization succeeds, the SDK assigns an anonymous AUTO alias to the device. You can retrieve it with getAlias().
final String alias = await MappSdk.getAlias();
print('Current alias: $alias');
This alias represents the current device until you assign a known user identifier with setAlias().
Next steps
After the basic integration is complete, continue with the following topics:
Device and alias model — understand how devices and user identities are tracked
Push notifications — enable and configure push delivery
User identification — set a known user alias after login
Tags and custom attributes — add segmentation data to the device profile
In-app messaging and inbox — trigger in-app messages and manage inbox content