# In-app messages

> Show a banner, card, full-screen message or alert inside your app or website the moment something happens.

Source: https://docs.grovs.io/docs/engagement/in-app-messages

In-app messages show inside your app or website while people use it: on app open, on a screen view, or when a tracked event happens. Use them for announcements, offers, update prompts, push permission primers, ratings and short surveys.

Create them under **Engage** › **In-App**. The SDK downloads eligible messages ahead of time and decides on the device when to show one, so a message appears the instant its trigger fires, with no network call.

- [Create a message](https://docs.grovs.io/docs/engagement/in-app-messages/create-a-message): Content, trigger, audience, limits, schedule and test sends.
- [Surveys and ratings](https://docs.grovs.io/docs/engagement/in-app-messages/surveys-and-ratings): Ask for stars or a choice, collect comments, export the answers.
- [Custom HTML](https://docs.grovs.io/docs/engagement/in-app-messages/custom-html): Your own page with video, audio and a JavaScript bridge.
- [Links and in-app browsers](https://docs.grovs.io/docs/engagement/in-app-messages/in-app-browser): How links in messages open, and grovs links inside social app browsers.
- [Reporting](https://docs.grovs.io/docs/engagement/in-app-messages/reporting): Views, clicks, dismissals and what counts as each.

## Formats

Pick a template in the **Message** step.

| Template                    | Looks like                                                                                                                                 | Blocks the app        |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- |
| **Cover**                   | Fills the whole screen                                                                                                                     | Yes                   |
| **Interstitial**            | A card in the middle of the screen                                                                                                         | Yes                   |
| **Half interstitial**       | A smaller card in the middle                                                                                                               | Yes                   |
| **Header**                  | A banner at the top                                                                                                                        | No                    |
| **Footer**                  | A banner at the bottom                                                                                                                     | No                    |
| **Alert**                   | The system alert on iOS, a styled dialog on the web. Text only                                                                             | Yes                   |
| **Cover image**             | Image only, full screen                                                                                                                    | Yes                   |
| **Interstitial image**      | Image only, centred                                                                                                                        | Yes                   |
| **Half interstitial image** | Image only                                                                                                                                 | Yes                   |
| **Custom HTML**             | Your own page, full screen, as a card or as a banner. See [Custom HTML](https://docs.grovs.io/docs/engagement/in-app-messages/custom-html) | Depends on the layout |

Text templates have a title, a message, an optional image, up to two buttons and an optional tap action on the message. Image-only templates show one picture and act on a tap.

Images are PNG, JPEG or GIF, up to 1 MB. You can add a separate landscape picture; otherwise the portrait one is used.

Header and footer banners leave the app usable underneath. Every other template covers the app until closed.

### Alerts

Alerts are for short messages:

| Field             | Limit          |
| ----------------- | -------------- |
| Title             | 80 characters  |
| Message           | 300 characters |
| Each button label | 30 characters  |

Alerts have no image, question or tap action. An alert with no buttons gets a Close button. An alert people can't dismiss needs at least one button.

### Orientation

Set **Orientation** to **Any orientation**, **Portrait only** or **Landscape only**. A single-orientation message shows only while the screen is held that way. If the device turns while it's showing, it closes, and that close isn't counted as a dismissal. The SDK never rotates the screen.

On the web, a window wider than it is tall counts as landscape, so most desktop browsers are landscape.

## How messages reach a device

1. **You launch.** A message for everyone goes live at once, or at its start time. A segment message first shows **Preparing audience** while grovs resolves the segment.
2. **The device syncs.** At every session start, the SDK fetches the messages this person may see and stores them with their images.
3. **A trigger fires.** The app opens, a screen is viewed or an event is tracked. The SDK checks every stored message's triggers, device conditions, schedule and limits, and shows the highest priority one.
4. **The SDK reports back.** Views, clicks and dismissals go out with the SDK's normal event batches.

### When a device syncs

| Moment                 | iOS                                                                                              | Web                                       |
| ---------------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Session start          | Yes. An "app is opened" trigger waits up to 2 seconds for this sync, then uses what's stored     | Yes, on every page load                   |
| Back in the foreground | Yes, unless it synced in the last minute                                                         | Yes, unless it synced in the last minute  |
| While in use           | With the next event once 15 minutes have passed since the last sync                              | Every 15 minutes while the tab is visible |
| After a change         | Every event batch response says whether anything changed. If so, the SDK syncs within 10 seconds | Same                                      |

A launch, edit, pause or end reaches a device in use usually within a minute, and at most about 15 minutes on an idle device, and every other device the next time it opens.

Start and end times are applied on the device, so scheduled messages start and stop on time without a new sync.

A device that hasn't synced for 48 hours shows nothing until it syncs again. After 14 days without a sync, it deletes its stored messages.

### Segment audiences

Segment membership is refreshed every hour. People who join see the message within about an hour, and people who leave stop seeing it within about an hour.

The audience is fixed at launch. If you later edit the segment, the report says so. Use **Update audience** to switch the message to the segment as it is now.

## SDK requirements

| Platform     | Minimum                | Set up                                                                                         |
| ------------ | ---------------------- | ---------------------------------------------------------------------------------------------- |
| iOS          | iOS SDK 3.1.0          | [In-app messages on iOS](https://docs.grovs.io/docs/sdk/ios/in-app-messages)                   |
| Web          | Web SDK 2.1.0          | [In-app messages on the web](https://docs.grovs.io/docs/sdk/web/in-app-messages)               |
| Android      | Android SDK 3.1.0      | [In-app messages on Android](https://docs.grovs.io/docs/sdk/android/in-app-messages)           |
| Flutter      | Flutter plugin 3.2.0   | [In-app messages on Flutter](https://docs.grovs.io/docs/sdk/flutter/in-app-messages)           |
| React Native | React Native SDK 3.1.0 | [In-app messages on React Native](https://docs.grovs.io/docs/sdk/react-native/in-app-messages) |
| Unity        | Unity package 1.0.0    | [In-app messages on Unity](https://docs.grovs.io/docs/sdk/unity/in-app-messages)               |

Older SDKs and unsupported platforms show no messages and report nothing.

**Ask for push permission**, **Ask for an app rating** and **Open the app's store page** only work in apps. Web visitors never see a message that uses one.

## Project switches and limits

| What                                  | Limit                                  |
| ------------------------------------- | -------------------------------------- |
| Running messages per project          | 50                                     |
| Segments targeted at once per project | 20, shared with journeys               |
| Message size                          | 16 KB, not counting a custom HTML page |

In **Engagement Settings**:

- **In-app messages** turns every message in the project off at once. Messages keep their state, and devices in use stop showing them usually within a minute, and at most about 15 minutes on an idle device.
- **Limit on in-app messages together** caps how many messages one device shows per visit and per day, across all messages. Default: 10 each. A message can opt out with **Not held back by the project limit**.
- **Control group** holds back up to 20% of people from every in-app message, dashboard push and journey, to measure what messaging does overall.

## Automate it

Create, test, launch, pause and end messages and read their reports from your server with the [In-app messages API](https://docs.grovs.io/docs/api-reference/in-app-messages).

## Related

- [Push campaigns](https://docs.grovs.io/docs/engagement/push-campaigns)
- [Journeys](https://docs.grovs.io/docs/engagement/journeys)
- [Experiments](https://docs.grovs.io/docs/engagement/experiments)
