Block Inapps

Prev Next

Insider SDK provides methods to enable or disable in-app templates. These methods allow for the control of whether in-app messages are displayed based on specific scenarios within an application. When in-app templates are disabled, any active InApp messages will be hidden, and new messages will not be displayed until templates are re-enabled.

Your title goes here
This method is available on Android 14.4.0 or higher versions.

Disable Templates

This method disables the display of in-app messages within an application. When this method is called, any currently active in-app messages are hidden, and any subsequent messages that would have been displayed are blocked. The SDK logs any blocked in-app messages for reporting and analysis.

It can be used when there is a need to temporarily stop in-app messages from displaying, such as during a sensitive user journey like a payment process.

Method Signature

public void disableInAppMessages()
Your title goes here

Messages that were blocked while in-app messages were disabled are not displayed retroactively once in-app messages are re-enabled. Instead, they are logged and cleared from the system.


Enable Templates

This method re-enables the display of in-app messages. After this method is called, new in-app messages will be displayed as usual. Messages that were blocked while InApp templates were disabled are not retroactively displayed, but are cleared from the log.

It can be used after the critical operation or user flow has completed and wants to resume displaying in-app messages.

Method Signature

public void enableInAppMessages()
Your title goes here

The disable and enable methods work within the current session. Once the session ends, these settings reset, and the default behavior resumes in the next session.


Example

// Temporarily disable in-app messages during a sensitive user flow

Insider.Instance.disableInAppMessages();

// Perform operations that should not be interrupted by in-app messages

// Re-enable in-app messages once the sensitive operation is complete

Insider.Instance.enableInAppMessages();

Logging & Reporting

Blocked Message Logging: When in-app templates are disabled, any in-app messages that would have been displayed are logged. This log includes details such as the in-app message ID and the reason for blocking, allowing for review of which messages were blocked during the disabled period. In any case, it can be checked and debugged.

Event Tracking: The "inapp_seen" event is automatically sent if an in-app message is disabled while it is being shown, ensuring accurate tracking and reporting. It is reported with the specific parameter "dismiss_type: 9" to be understood and tracked.