setDoNotDisturbEnabled

open fun setDoNotDisturbEnabled(enableDnd: Boolean)

Toggles whether Batch.Messaging should enter its "do not disturb" (DnD) mode, or exit it.

While in DnD, Batch will not display landings, not matter if they've been triggered by notifications or an In-App Campaign, even in automatic mode.

This mode is useful for times where you don't want Batch to interrupt your user, such as during a splashscreen, a video or an interstitial ad.

If a message should have been displayed during DnD, Batch will enqueue it, overwriting any previously enqueued message. When exiting DnD, Batch will not display the message automatically: you'll have to call the queue management methods to display the message, if you want to. See hasPendingMessage, popPendingMessage to manage the enqueued message, if any.

Note: This is only supported if automatic mode is disabled. Messages will not be enqueued, as they will be delivered to your InAppInterceptor implementation.

Parameters

enableDnd

true to enable DnD, false to disable it