MoEngage Docs

SDK Installation

Flutter is Google’s UI toolkit for building natively compiled applications for iOS and Android from a single codebase.

DownloadDownload

Installation

To add MoEngage's Flutter SDK to your application, edit your pubspec.yaml to add moengage_flutter as a dependency.

dependencies:
    moengage_flutter: $lastestVersion

$latestVersion refers to the latest version of the plugin.

Post including the dependency run flutter pub get command in terminal to install the dependency.

Android SDK Installation

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:9.8.04"
}

iOS SDK Installation

CocoaPodsCocoaPods

We have added our native SDK MoEngage-iOS-SDK as a dependency for moengage_flutter plugin, hence run flutter build ios command once to generate the Pod file for your iOS project and run pod install inside your project's ios directory to add the plugin and native SDK to your iOS Project.

Initialise Plugin

In the project's App Widget call initialise() of MoEngageFlutter plugin in initState() method as shown below:

import 'package:moengage_flutter/moengage_flutter.dart';

  final MoEngageFlutter _moengagePlugin = MoEngageFlutter();

  @override
  void initState() {
    super.initState();
    initPlatformState();
    _moengagePlugin.initialise();
  }

Updated 5 months ago

SDK Installation


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.