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

DownloadDownload

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

dependencies {
  implementation fileTree(dir: 'libs', include: ['*.jar'])
  implementation("androidx.core:core:1.3.1")
  implementation("androidx.appcompat:appcompat:1.2.0")
  implementation("androidx.lifecycle:lifecycle-process:2.2.0")
  implementation "com.moengage:moe-android-sdk:$sdkVersion"
}

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

iOS SDK Installation

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 3 days 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.