Messaging (In-App/Landings)
In-App Campaigns allow you to trigger messages when users open your app or perform a specific action. This is great to communicate with users who have turned off push notifications or to show contextual messages while your users are browsing your app (e.g. special offers, update reminder, etc).
Mobile Landings allow you to easily introduce continuity between your app, and your pushes: A user opening a push will be greeted by a rich message related to what they opened, rather than just ending up on your app's main menu.
This documentation describes features common to both Mobile Landings and In-App Messaging.
Displaying In-App messages
Fully automatic mode
There is no code required to make In-App Messages work in automatic mode. Create some campaigns on your dashboard, and they will start coming up in your app.
Controlling the display using "Do Not Disturb mode"
You can also get more control on when messages are displayed without giving up on the automatic mode, by using the "Do Not Disturb" (DnD) mode.
It allows you to tell Batch to hold on a mobile landing for you, rather than display it without using the fully manual mode.
For example, if launching your app results in a splash screen or a fullscreen ad, you might find it undesirable to have Batch display something on top of it.
Turning on "Do Not Disturb" mode will make Batch enqueue the latest mobile landing, rather than display it.
Toggling DnD
Now, when you don't want Batch to automatically display, turn on Do Not Disturb:
BatchMessaging.instance.setDoNotDisturbEnabled(true);
Once you want to start showing landings automatically, call the method with false
to turn it off.
Note: Disabling Do Not Disturb mode does NOT make Batch show the enqueued message automatically
Displaying pending mobile landings
After coming back from DnD mode, you might want to show the enqueued message, as Batch will not do that automatically.
All you have to do, is ask Batch to show the message, if any:
BatchMessaging.instance.showPendingMessage();
Changing the default Do Not Disturb state
By default, Batch doesn't enable "Do Not Disturb" by default.
You may want to start your app in this state.
To do so, use your Info.plist/AndroidManifest.xml or native code to change the plugin configuration value controlling the initial DnD state. See SDK Integration for more info.
If you do so, make sure you disable DnD once your app is ready to display them.