This repository contains the Braze integration for the mParticle Android SDK.
This repository contains an example app showing how to implement mParticle, Braze, and Firebase Cloud Messaging. The key changes you need to make to your app are below, and please also reference mParticle and Braze's documentation:
See a full build.gradle example here
-
The Braze Kit requires that you add Braze's Maven server to your buildscript:
repositories { maven { url "https://appboy.github.io/appboy-android-sdk/sdk" } //Braze's library depends on the Google Support Library google() ... }
-
Add the kit dependency to your app's
build.gradle
:dependencies { implementation 'com.mparticle:android-appboy-kit:5+' }
mParticle's SDK takes care of registering for push notifications and passing tokens or instance IDs to the Braze SDK. Follow the mParticle push notification documentation to instrument the SDK for push registration. You can skip over this section of Braze's documentation.
See a full example of an AndroidManifest.xml here.
mParticle's SDK also takes care of capturing incoming push notifications and passing the resulting Intent
to Braze's AppboyFcmReceiver
. Follow the mParticle push notification documentation to ensure you add the correct services and receivers to your app's AndroidManifest.xml.
There are a wide variety of implementation options available in Braze to deeplink a user when they tap a notification. There are two specific requirements to ensure automatic deeplinking works as intended.
-
AppboyFcmReceiver
Whereas up until now you should have nothing Braze-specific in your
AndroidManifest.xml
, using Braze's automatic deeplinking does require you to add theirAppboyFcmReceiver
. Note that you do not need to specify any Intent filters (for example to receive push tokens, since mParticle takes care of that). You just need to add the following:<receiver android:name="com.appboy.BrazePushReceiver" />
-
appboy.xml
For automatic deep-linking, you need to add a boolean resource named
com_appboy_handle_push_deep_links_automatically
. This can be in any resource file, or you can name itappboy.xml
:<?xml version="1.0" encoding="utf-8"?> <resources> <bool name="com_appboy_handle_push_deep_links_automatically">true</bool> </resources>
From here you should be able to successfully test push via Braze! Braze offers many client-side configurable options via xml resources and otherwise. Please see review the rest of their documentation here for more information.