Insider SDK provides methods to enable or disable InApp templates. These methods allow for the control of whether InApp messages are displayed based on specific scenarios within an application. When InApp templates are disabled, any active InApp messages will be hidden, and new messages will not be displayed until templates are re-enabled.
Disable Templates
This method disables the display of InApp messages within an application. When this method is called, any currently active InApp messages are hidden, and any subsequent messages that would have been displayed are blocked. The SDK logs any blocked InApp messages for reporting and analysis.
It can be used when there is a need to temporarily stop InApp messages from displaying, such as during a sensitive user journey like a payment process.
Method Signature
public void disableInAppMessages()fun disableInAppMessages()
Enable Templates
This method re-enables the display of InApp messages. After this method is called, new InApp 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 InApp messages.
Method Signature
public void enableInAppMessages()fun enableInAppMessages()
Example
// Temporarily disable InApp messages during a sensitive user flow
Insider.Instance.disableInAppMessages();
// Perform operations that should not be interrupted by InApp messages
// Re-enable InApp messages once the sensitive operation is complete
Insider.Instance.enableInAppMessages();
Logging & Reporting
Blocked Message Logging: When InApp templates are disabled, any InApp messages that would have been displayed are logged. This log includes details such as the InApp 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 InApp 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.