Skip to content
Menu

In-app messages

In-app messages overview

Markdown version

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

  1. A Herald agent decides to send a user an in-app message.
  2. Herald stores the message for that user, with its trigger and display rules.
  3. 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.
  4. 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.
  5. 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

TypeWire valueWhat the user sees
SlideupslideupA 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.
ModalmodalA centered dialog over a dimmed background, with an optional image, header, body, buttons and a close button.
Full screenfullCovers the screen: image on top, then header, body, buttons and a close button.
HTMLhtmlYour own HTML page, full screen, in a web view with a small JavaScript bridge. See Custom views.
iOSAndroid
SlideupA slideup message on iOSA slideup message on Android
ModalA modal message on iOSA modal message on Android
Full screenA full-screen message on iOSA full-screen message on Android
HTMLAn HTML message on iOSAn HTML message on Android

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.

swift
import HeraldSDK
import HeraldUI

Herald.configure(appKey: "YOUR_APP_KEY", endpoint: URL(string: "https://YOUR_HERALD_HOST")!)
Herald.useDefaultInAppUI()

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.

FieldMeaning
idUnique message ID. Interactions are logged under it.
typeslideup, modal, full or html
priorityHigher wins when several messages match one trigger
triggersession_start, event (a name plus property filters) or push_open. See Triggers and delivery rules.
reEligibilityonce, or after_hours with a number of hours
expiresAtAfter this time the message is never shown. Null means no expiry.
content.header, content.bodyText
content.imageUrlImage for modal and full-screen messages. For a video, its poster.
content.videoUrl, content.videoPosterUrlA video for modal and full-screen messages (0.6.0), and its poster, the same as imageUrl. See Video.
content.creditname, profileUrl and sourceUrl of a stock photo or video's creator, for apps that show a credit (0.6.0)
content.buttonsEach has an id, text and an action: open a deep link or web URL, or close
content.htmlThe page for html messages
content.slideFromtop or bottom for slideups. Bottom when unset.
content.dismissAfterSecondsAuto-dismiss delay for slideups. Null keeps the message until the user acts.
styleOptional background, text, button and button-text colors (hex such as #101828) and corner radius. Null fields use your theme.
decisionIdThe Herald decision the message came from

What gets logged

InteractionWhen
ImpressionWhen the message is on screen
ClickA tap on the message body, or a link tapped in an HTML page
ButtonA tap on a button, or herald.click(id) from an HTML page, with the button's id
DismissThe 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

See Herald decide live →