Integration

Step 1: Braze In-App Message Manager Registration

In-App Message display is managed by the AppboyInAppMessageManager class. Every activity in your app must be registered with the AppboyInAppMessageManager to allow it to add in-app message views to the view hierarchy. There are two ways to accomplish this:

The Activity Lifecycle Callback Integration handles in-app message registration automatically, no extra integration is required. This is the recommended integration for handling in-app message registration.

Manual In-App Message Registration

A manual in-app message registration requires 3 steps.

If you did the activity lifecycle integration, then you should not do a manual in-app message integration.

1
AppboyInAppMessageManager.getInstance().ensureSubscribedToInAppMessageEvents(context);
1
2
3
4
5
6
7
@Override
public void onResume() {
  super.onResume();
  // Registers the AppboyInAppMessageManager for the current Activity. This Activity will now listen for
  // in-app messages from Braze.
  AppboyInAppMessageManager.getInstance().registerInAppMessageManager(activity);
}
1
2
3
4
5
6
@Override
public void onPause() {
  super.onPause();
  // Unregisters the AppboyInAppMessageManager for the current Activity.
  AppboyInAppMessageManager.getInstance().unregisterInAppMessageManager(activity);
}
WAS THIS PAGE HELPFUL?