SDK

In-App Messages

In this page you'll learn how in-app messages can be added to your app and what are all the options at your disposal to create a great messaging experience for your users.

These services will bring a new level of contextuality to your app, allowing you to create in-app messages or categorize users based on their interaction behaviour.

As mentioned in the Implementation page, if you are going to use in-app messaging, you must include the capacitor-notificare-in-app-messaging dependency.

Since this is a zero-configuration feature library, you don't have to implement or configure anything other than including the dependency to get started.

Suppressing messages

During certain flows, like during a purchase, it can become convenient to suppress in-app messages from being shown to the user, interrupting their engagement.

You can, optionally, suppress messages by setting a flag. It's important to reset the flag once the priority flow is complete, otherwise the library will continue suppressing the messages until the application is restarted.

await NotificareInAppMessaging.setMessagesSuppressed(true);

By default, the SDK doesn't re-evaluate the foreground context when you stop suppressing in-app messages. In case you want to trigger a new context evaluation after you stop suppressing in-app messages, you can use the following method instead.

await NotificareInAppMessaging.setMessagesSuppressed(false, /* evaluateContext */ true);

Messages lifecycle

You can perform additional actions when certain events occur while handling in-app messages. To do so, listen to the following events:

NotificareInAppMessaging.onMessagePresented((message) => {

});

NotificareInAppMessaging.onMessageFinishedPresenting((message) => {

});

NotificareInAppMessaging.onMessageFailedToPresent((message) => {

});

NotificareInAppMessaging.onActionExecuted((data) => {

});

NotificareInAppMessaging.onActionFailedToExecute((data) => {

});