Skip to content
Menu

In-app messages

Create in-app messages in Herald

Markdown version

How to set format, content, trigger, rules and style for an in-app message variant in Herald, with every option, default and limit, and a worked example.

You control what an in-app message looks like, when it shows and how often on the message variant, in a section called Delivery options (mobile SDK). It is available on the in-app channel and the modal in-app channel.

Before you start

  • A message variant on the in-app or modal in-app channel.
  • The SDK installed in your app. The SDK already supports every option on this page, so no app update is needed.

Find the options

  1. Open the variant with Edit. The section appears when you edit an existing variant, not while you create one.
  2. Open Delivery options (mobile SDK). It is collapsed by default, with a one-line summary of the choices that differ from the defaults.
  3. Change the options, then choose Save delivery options. The variant's own Save does not store them. Reset to defaults restores every option below.

Options apply to messages sent after you save. A variant with no saved options sends what it did before 0.2: a slideup (in-app channel) or a modal (modal in-app channel) that shows at session start, once.

Format

OptionDefaultLimit
TypeSlideup on the in-app channel, Modal on the modal in-app channelSlideup, Modal, Full screen or HTML
Slide in fromBottomTop or Bottom. Shown for slideups only.
Auto-dismiss after (seconds)Empty (stays open)2 to 60

Content

The variant's title, body and image become the message's header, body and image. These options add to them.

OptionDefaultLimit
HTMLNot usedShown only for the HTML type, which requires it. 100 KB at most, counted in bytes. A preview renders in a sandbox with scripts off.
Use the variant's buttonOnOne button from the variant's call to action and deep link, when it has both.
ButtonsUp to 2 when Use the variant's button is off.

Each button has:

FieldLimit
Button text1 to 40 characters
ActionClose, Open deep link or Open URL
LinkRequired for a deep link or URL. A URL must start with http:// or https://.

Video

A message can show a video in place of its image. Pick one with Choose media (see the media library); the message's image is then the video's poster. Video needs SDK 0.6.0.

  • Where it plays. Modal and full-screen messages show the poster with a play button ("Play video" for VoiceOver and TalkBack). A tap plays the video inline, with sound, in the platform's standard player. Slideup and HTML messages show no video.
  • What Herald sends. The message's content gets videoUrl, videoPosterUrl (the same as imageUrl) and, for a stock photo or video, credit. See In-app messages overview.
  • Events. The SDK logs video_play when the video starts and video_complete when it reaches the end, once per play. See Event payload.

When to show

OptionDetail
Show whenSession starts (default), An event happens or A push is opened
Event nameRequired for an event trigger, for example workout_completed. Your app must call track with this name.
Property filtersUp to 5, all of which must match. Each has a property, an operator and a value.

Operators: equals, does not equal, greater than, at least, less than, at most, contains, and exists. exists has no value.

Filter values that look like numbers are saved as numbers, so 7 matches a numeric property with the value 7, not the string "7". The values true and false are saved as booleans. Any other text is saved as a string. The SDK compares types, so make the filter match the type your app sends.

How the device evaluates triggers is covered on Triggers and delivery rules.

Rules

OptionDefaultLimit
Priority00 to 100. Higher shows first when several messages are eligible.
Show againNever, show onceNever, show once or After some hours.
Hours before showing again24, when you choose After some hours1 to 8,760
Expires after (hours)Never1 to 8,760. Counted from the send time.

Style

Use app theme is on by default: the message takes its colors and corner radius from your app's theme. Turn it off to set any of these for this message. An empty field keeps the app theme for that value.

OptionFormat
Background, Text, Button, Button text#RRGGBB, for example #1F6FEB
Corner radius (px)0 to 32

Turning Use app theme back on clears all five values.

Worked example

Lumen wants to celebrate a seven-day streak when the user finishes a workout, once.

OptionValue
ChannelModal in-app
TypeModal
Show whenAn event happens
Event nameworkout_completed
Property filterstreak_days equals 7
Priority10
Show againNever, show once
Use app themeOn

The variant's header reads "7 days in a row" and its button, from the variant's call to action and deep link, opens the streak screen.

Your app sends the event with a numeric property:

swift
Herald.shared.track("workout_completed", properties: ["streak_days": 7])

The modal shows right after the call, once per user. If the app sent "7" as a string, the filter would not match, because the filter's 7 is saved as a number.

Verify it works

  1. Send the variant to a test user, or use Send a test from Herald with the In-app modal channel. A test modal uses session-start rules, so it checks delivery and your theme, not the trigger.
  2. Open the app and trigger the event. Check the message shows once, and not again on the next trigger.
  3. Use the debug preview hooks to see each type with your theme. See Logging and debugging.

Troubleshooting

  • The message never shows. The event name differs from the name your app tracks, a filter's type differs from the property's type, or the message already showed and Show again is set to once.
  • Save delivery options is disabled. A field has an error, shown under it, or nothing has changed. The HTML type needs HTML, and other types must not have any.
  • A button does nothing. An Open deep link button needs a deep link your app handles. See Deep links.

Next

See Herald decide live →