In App Messages are triggered based on realtime In-App events. You have to tag these events in your App. To read about how In App Message campaigns are created on the platform checkout the In App Messaging docs. Real-time events can also be used for triggering other comms like push notifications, email and SMS.
There is a default event for tracking Session Starts or App open events. This is the most basic type of In App Messaging to enable. To enable In App messaging on app open; call the setEnableStartSession method, before initialising XtremePush in your main activity.
// INITIALISE THE XTREMEPUSH CONNECTOR HERE mPushConnector = new PushConnector.Builder("XTREME_PUSH_APP_KEY", "GOOGLE_PROJECT_NUMBER") .setEnableStartSession(true) .create(this);
You can then select the trigger On Session Start Option when creating an In App Message.
If you want your In App messages to appear after custom events occur then you must tag these events with the
hitEvent(String title) method. For example if the settings page being opened was an event you want to track for In App messages, you would tag it as follows:
The "opened_settings" event will then be available as a trigger option when creating an In App Message.
And below you can see an example of a bottom banner In App message that appears after the settings page was opened.
It's possible to pass a value with the event hit. It could be used for additional segmentation and personalization of your messages.
To pass a string value with the event use:
To pass key-value pairs with the event use:
HashMap <String, String> hm = new HashMap<>(); hm.put("foo", "bar"); hm.put("lorem", "ipsum"); mPushConnector.hitEvent("test", hm);