In-app messages
In-app messages overview
What in-app messages are, the slideup, modal, full-screen and HTML types, how messages reach the device and how the SDK decides to show one.
In-app messages appear on top of your app while the user is in it: a banner, a dialog, a full-screen takeover or your own HTML page. They reach users who have not allowed push, at the moment they are most relevant, such as right after a workout.
Who it's for
- Lifecycle teams who want to reach active users in context, without depending on push permission.
- Mobile engineers who install the default presenter once and decide when messages may appear.
How it works
- A Herald agent decides to send a user an in-app message.
- Herald stores the message for that user, with its trigger and display rules.
- The SDK downloads the user's messages at the start of each session, when a user is first identified, and on
refreshContentCards(). It keeps them on the device. - When a trigger happens on the device (a session starts, the app tracks an event, the user opens a push), the SDK picks the best matching message and shows it. No network request is needed at that moment, so messages work offline once they have synced.
- Impressions, clicks and dismissals go back to Herald and are credited to the agent's decision.
Messages are delivered to identified users only, as with content cards.
Message types
| Type | Wire value | What the user sees |
|---|---|---|
| Slideup | slideup | A banner at the bottom (or top) of the screen. The app stays usable around it. A tap runs the first button's action; swiping it toward its edge (down for a bottom slideup, up for a top one) dismisses it. It can dismiss itself after a set time. |
| Modal | modal | A centered dialog over a dimmed background, with an optional image, header, body, buttons and a close button. |
| Full screen | full | Covers the screen: image on top, then header, body, buttons and a close button. |
| HTML | html | Your own HTML page, full screen, in a web view with a small JavaScript bridge. See Custom views. |
| iOS | Android | |
|---|---|---|
| Slideup | ![]() | ![]() |
| Modal | ![]() | ![]() |
| Full screen | ![]() | ![]() |
| HTML | ![]() | ![]() |
Turn on display
The core SDK decides when a message should show; a presenter draws it. Install the default presenter from HeraldUI or herald-ui once, right after configure. Without a presenter, messages are not shown: they wait on the device until one is set.
import HeraldSDK
import HeraldUI
Herald.configure(appKey: "YOUR_APP_KEY", endpoint: URL(string: "https://YOUR_HERALD_HOST")!)
Herald.useDefaultInAppUI()import com.herald.sdk.Herald
import com.herald.ui.HeraldInAppPresenter
Herald.configure(this, appKey = "YOUR_APP_KEY", endpoint = "https://YOUR_HERALD_HOST")
HeraldInAppPresenter.install()On iOS the presenter draws each message in its own window above your app's windows. On Android it draws in an overlay on the resumed activity, which must be a ComponentActivity (every Compose and AppCompat activity is).
The message data model
InAppMessage has the same shape on both platforms.
| Field | Meaning |
|---|---|
id | Unique message ID. Interactions are logged under it. |
type | slideup, modal, full or html |
priority | Higher wins when several messages match one trigger |
trigger | session_start, event (a name plus property filters) or push_open. See Triggers and delivery rules. |
reEligibility | once, or after_hours with a number of hours |
expiresAt | After this time the message is never shown. Null means no expiry. |
content.header, content.body | Text |
content.imageUrl | Image for modal and full-screen messages. For a video, its poster. |
content.videoUrl, content.videoPosterUrl | A video for modal and full-screen messages (0.6.0), and its poster, the same as imageUrl. See Video. |
content.credit | name, profileUrl and sourceUrl of a stock photo or video's creator, for apps that show a credit (0.6.0) |
content.buttons | Each has an id, text and an action: open a deep link or web URL, or close |
content.html | The page for html messages |
content.slideFrom | top or bottom for slideups. Bottom when unset. |
content.dismissAfterSeconds | Auto-dismiss delay for slideups. Null keeps the message until the user acts. |
style | Optional background, text, button and button-text colors (hex such as #101828) and corner radius. Null fields use your theme. |
decisionId | The Herald decision the message came from |
What gets logged
| Interaction | When |
|---|---|
| Impression | When the message is on screen |
| Click | A tap on the message body, or a link tapped in an HTML page |
| Button | A tap on a button, or herald.click(id) from an HTML page, with the button's id |
| Dismiss | The message closes without any click: close button, swipe, tap outside, back button, auto-dismiss |
A message that was clicked does not also log a dismissal.
What an agent sends
By default, an agent send on the in-app channel creates a slideup from the bottom, and the modal in-app channel creates a modal. Both show at the user's next session start, once. The message variant's title, body and image become the header, body and image, and its call to action and deep link become one button.
You change the type (including full screen and HTML), buttons, trigger, property filters, priority, re-eligibility, expiry and colors per variant in Delivery options (mobile SDK). See Create in-app messages in Herald.
Next
- Create in-app messages in Herald: set the options per message variant.
- Triggers and delivery rules
- Controlling display







