Standard
In-app messaging allows you to communicate with users directly within your application, delivering contextual and timely messages that enhance engagement. This feature enables a new level of personalization by allowing you to display messages, promotions, or tips based on user behavior or interaction patterns.
Integrating in-app messages helps create a continuous communication channel with your users — ensuring that relevant content is displayed exactly when it matters most.
To enable this functionality, include the capacitor-actito-in-app-messaging module in your project's package.json.
{
"dependencies": {
"capacitor-actito-in-app-messaging": "^5.0.0"
}
}
The in-app messaging module is a zero-configuration library, meaning no additional setup or initialization code is required. Simply including the dependency automatically enables the feature within your project.
Suppressing messages
In certain scenarios — such as during a checkout or onboarding flow — you may want to temporarily prevent in-app messages from appearing to avoid disrupting the user experience.
You can suppress in-app messages by setting the hasMessagesSuppressed flag:
await ActitoInAppMessaging.setMessagesSuppressed(true);
It is important to reset the flag once the high-priority flow is complete. If not reset, messages will remain suppressed until the application is restarted.
Re-evaluating message context
By default, the SDK does not automatically re-evaluate the app’s foreground context when you stop suppressing messages. If you want the SDK to immediately re-evaluate and display any in-app messages after suppression ends, call the following method instead:
await ActitoInAppMessaging.setMessagesSuppressed(false, /* evaluateContext */ true);
This ensures that relevant messages are displayed promptly once the user exits the restricted flow.