Search docs/

Ionic mParticle Integration for Capacitor

Contents

This plugin provides for easy integration with the mParticle SDK in your Capacitor app.

Installation

ionic enterprise register npm install @ionic-enterprise/capacitor-mparticle-integration npx cap sync

Configuration

In capacitor.config.json add your key and secret

"plugins": {
    "CapacitorMparticleIntegration": {
      "ios-key": "my iOS key",
      "ios-secret": "my iOS secret",
      "android-key": "my Android key",
      "android-secret": "my Android secret"
    }
}

In the javascript mParticle initialization code add useNativeSdk: true

window.mParticle = {
  config: {
    useNativeSdk: true
  }
};

Register plugin for Android

In the init method of MainActivity.java add:

add(CapacitorMparticleIntegration.class);

Register plugin for iOS

Plugin is auto-registered on iOS.