Creating In-App Messages

What Are In-App Messages in Countly?

In-app messages in Countly allow you to engage users with personalized notifications, promotions, or updates directly within your app.

You can create and show in-app messages using two features we have:

  • With Content Builder, you create and design in-app messages, defining the content, layout, and style of your messages.
  • With Journeys, in-app messages are triggered by defining conditions and events, which determine when and how the messages will appear to users.

Setting Up In-App Messages on the Server

To distribute in-app messages within your app, follow these steps:

  1. Create a content block: Begin by creating a content block in the Content Builder. This content block defines the message's structure, such as the text, images, and buttons that will be displayed to the users. For detailed instructions, refer to the Content Builder documentation.

  2. Set up a journey: After creating the content block, configure a journey to define when and how the in-app message will be presented to your users. A journey specifies the user actions or conditions that trigger the message. For more information on creating a journey, refer to the Journeys documentation.

By following these steps, you'll be able to distribute personalized in-app messages to your users at the right time and in the right context.

Integrating In-App Messages in SDKs

Integrating in-app messages with the SDKs is straightforward and requires just a single line of code for all supported SDKs. Please note that all functions must be called after initializing the SDK; otherwise, the call will not be executed successfully.

This call will retrieve and display the most up-to-date in-app message available for the user. By making this request, the system ensures that the user receives the latest content.

Android iOS Web Flutter React Native
Countly.sharedInstance().contents().enterContentZone();

Current Limitations

In-app messages may not appear immediately, as content is fetched periodically from the server. This means that there could be a slight delay in displaying the latest messages to users, depending on the fetch interval set for the content.

Frequent manual fetching can increase server load and lead to performance issues.

If you need to achieve an instant fetch, you can manually trigger a content refresh by using the "enter" and "exit" functions, which will force the SDK to fetch the content immediately, bypassing the timer interval.

For detailed information on content-related methods, you can refer to the Content Zone section in the SDKs documentation of your respective platform

Looking for help?