-
Notifications
You must be signed in to change notification settings - Fork 71
Kit Development
This guide is meant for integration partners who would like add their own SDK or functionality to the mParticle platform. mParticle integrates with over 80 partners in the mobile app ecosystem, and each integration is unique. Whereas most integration are via our Firehose API, or developed internally for the server-side, the mParticle mobile SDKs are designed to be extensible in the form of "kits" for client-side integrations.
The mParticle Core iOS and Android SDKs are responsible for detecting, initializing, and forwarding data to the kit framework. By default, the Core SDK dependency does not include any kits - each desired kit must be specified as an additional dependency. The kit framework allows you to hook into and listen for mParticle's public APIs as well as crucial application lifecycle events. It's the responsibility of the kit implementation to then map those APIs onto the respective partner APIs. Kits will often include a 3rd-party SDK, or they might just contain a bit of additional functionality.
At runtime, the Core SDKs will receive configuration from the mParticle server, instructing it of which kits it should initialize. In a typical scenario whereby a kit wraps/embeds a 3rd-party SDK, the configuration will include a map of settings, including the API key/credentials that the given SDK needs in order to be initialized. Customers use the mParticle platform UI to enable kits and input their credentials.
mParticle provides a sample repository that you can fork and make your own, and then submit for review. To get started, fork, clone, or download the code. If you'd like to iterate in private, you can push your code to a private repository and work with the mParticle partnerships and engineering team to get your code reviewed.
Once you've forked/downloaded the example repository, you'll want to edit the following files to be specific to your implementation:
-
./build.gradle
to add any necessary dependencies, such as your company's SDK. -
src/main/java/com/mparticle/kits/ExampleKit.java
- this is where your primary implementation belongs.- Choose the additional interfaces that you need and have this class implement them. See below.
./README.md
./src/main/AndroidManifest.xml
./consumer-proguard.pro
The core of your implementation will live in ExampleKit.java
(renamed for your company). This file must be a subclass of the KitIntegration
class, made available by the mParticle kit framework. This class provides additional interfaces that you must implement depending on the type of data that your kit can process:
Kits should implement this interface when they require Activity callbacks for any reason.
Kits should implement this interface when their underlying service has the notion of a user with attributes.
Kits should implement this interface in order to listen for eCommerce events.
Kits should implement this listener to ensure they receive events as they are sent into the mParticle SDK.
Kits should implement this interface when they have Google Cloud Messaging/push features.
See the javadocs for more information on the KitIntegration
class and its interfaces.
- Create a public fork
- Once you've completed development, submit a pull request to merge into the example.
- When ready, an mParticle engineer will create a new repository for your kit and push the code there.