Skip to content
Flutter Plugin for MoEngage Platform
Java Dart Swift Ruby Objective-C
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
example
ios
lib
test
.gitignore
.metadata
.woodpecker.yml
CHANGELOG.md
LICENSE
README.md
pubspec.lock
pubspec.yaml

README.md

MoEngage Flutter Plugin

Flutter Plugin for MoEngage Platform

SDK Installation

To add the MoEngage Flutter SDK to your application, edit your application's pubspec.yaml file and add the below dependency to it:

dependencies:
 moengage_flutter: 1.0.0

Run flutter packages get to install the SDK.

Android Installation

Download

Once you install the Flutter Plugin add MoEngage's native Android SDK dependency to the Android project of your application. Navigate to android --> app --> build.gradle. Add the MoEngage Android SDK's dependency in the dependencies block

dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation 'com.android.support:appcompat-v7:26.0.1'
  implementation "com.moengage:moe-android-sdk:$sdkVersion"
}

where $sdkVersion should be replaced by the latest version of the MoEngage SDK.

SDK Initialization

Android SDK Initialization

Get APP ID from the Settings Page on the MoEngage dashboard and initialize the MoEngage SDK in the Application class's onCreate()

// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard.
val moEngage =
        new MoEngage.Builder(this, "XXXXXXXXXXX")
        .build()
MoEInitializer.initialize(builder.build())

Refer to the API reference doc for a detailed list of possible configurations.

Note:
All the configuration should be added to the builder before calling initialize. If you are calling initialize at multiple places please ensure that all the required flags and configuration are set each time you initialize to maintain consistency in behavior.

iOS SDK Initialization

Make sure to run flutter build command to make sure all the CocoaPods dependencies are added to your project. (i.e, MoEngage-iOS-SDK and moengage_flutter)

To initialize the iOS Application with the MoEngage App ID from Settings in Dashboard. In your project, go to AppDelegate file and call the initialize method of MOFlutterInitializer instance in applicationdidFinishLaunchingWithOptions() method as shown below:

  MOFlutterInitializer.sharedInstance.initializeWithAppID("Your App ID", withLaunchOptions: launchOptions)

Refer to the Documentation for complete integration guide.

You can’t perform that action at this time.