Prevent or Delay Message Display

Delay or prevent the display of an in-app message. For example, you can choose to prevent an in-app message from displaying during the loading process, sign-in flow, and other situations. To prevent or delay message display, set the shouldShowMessage method to return false.

You can capture data of any in-app message and use it to display the message at a later time. For example, you can present the message after the user successfully signs in by capturing the ID of the message and showing that message later.

Use this code to show a captured message later in version 11 of the SDK for Android.

1InAppMessagingFeature.requestSdk { inAppMessagingFeatureModule ->
2  inAppMessagingFeatureModule.getInAppMessageManager().showMessage(blockedMessageId)
3}

Use this code to show a captured message later in version 10 of the SDK for Android.

1MarketingCloudSdk.requestSdk { engagementSdk ->
2  engagementSdk.inAppMessageManager.showMessage(blockedMessageId)
3}

Use this code to show a captured message later in version 8 of the SDK for Android.

1SFMCSdk.requestSdk { sdk ->
2  sdk.mp {
3    it.inAppMessageManager.showMessage(blockedMessageId)
4  }
5}

Use this code to show a captured message later in version 7 of the SDK for Android.

1MarketingCloudSdk.requestSdk { sdk->
2  sdk.inAppMessageManager.showMessage(blockedMessageId)
3}