# Create in-app messages in Herald

> 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

| Option | Default | Limit |
|---|---|---|
| Type | Slideup on the in-app channel, Modal on the modal in-app channel | Slideup, Modal, Full screen or HTML |
| Slide in from | Bottom | Top 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.

| Option | Default | Limit |
|---|---|---|
| HTML | Not used | Shown 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 button | On | One button from the variant's call to action and deep link, when it has both. |
| Buttons | | Up to 2 when **Use the variant's button** is off. |

Each button has:

| Field | Limit |
|---|---|
| Button text | 1 to 40 characters |
| Action | **Close**, **Open deep link** or **Open URL** |
| Link | Required 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](/docs/concepts/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](/docs/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](/docs/reference/event-payload#interaction).

## When to show

| Option | Detail |
|---|---|
| Show when | **Session starts** (default), **An event happens** or **A push is opened** |
| Event name | Required for an event trigger, for example `workout_completed`. Your app must call `track` with this name. |
| Property filters | Up 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](/docs/in-app-messages/triggers-and-delivery).

## Rules

| Option | Default | Limit |
|---|---|---|
| Priority | 0 | 0 to 100. Higher shows first when several messages are eligible. |
| Show again | Never, show once | **Never, show once** or **After some hours**. |
| Hours before showing again | 24, when you choose **After some hours** | 1 to 8,760 |
| Expires after (hours) | Never | 1 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.

| Option | Format |
|---|---|
| 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.

| Option | Value |
|---|---|
| Channel | Modal in-app |
| Type | Modal |
| Show when | An event happens |
| Event name | `workout_completed` |
| Property filter | `streak_days` equals `7` |
| Priority | 10 |
| Show again | Never, show once |
| Use app theme | On |

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:

:::tabs
::tab ios
```swift
Herald.shared.track("workout_completed", properties: ["streak_days": 7])
```
::tab android
```kotlin
Herald.track("workout_completed", mapOf("streak_days" to 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](/docs/push-notifications/testing#send-a-test-from-the-mobile-sdk-card) 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](/docs/operations/logging-and-debugging#preview-messages-without-a-server).

## 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](/docs/push-notifications/deep-links).

## Next

- [Triggers and delivery rules](/docs/in-app-messages/triggers-and-delivery)
- [Theming and dark mode](/docs/in-app-messages/theming-and-dark-mode)
- [In-app messages overview](/docs/in-app-messages/overview)
