In-App Messages
In-app messages are messages you design in the panel and the SDK shows inside your app, on top of the current screen. They can contain text, images and buttons with links.
What it is
An in-app message is delivered as a silent (data only) push notification through Firebase Cloud Messaging. The operating system does not show it. The SDK receives it, builds the message from the design in the panel and shows it.
Each message has a layout: top, center, bottom or full screen.
How it works
Conditions
- The same setup as for push notifications: Firebase keys, and an FCM token sent by the device. See Push Notifications.
- Your app forwards incoming messages to the SDK.
- The app runs. A silent push does not reach an app that the user closed completely.
Flow
- You send an in-app message from the panel or from an automation.
- Positive User sends it through Firebase to the contact's device.
- The SDK shows the message and reports it as displayed.
- The contact taps a button: the SDK reports a click and passes the link to your code or opens it. On iOS and Android it also closes the message. Exceptions are listed in Platform differences. See also Opening App Screens.
- The contact closes the message with its close button: the SDK reports it as dismissed. On Android the message also closes with a tap outside it or with the back button, and then nothing is reported.
Platform differences
| iOS | Android | Flutter | |
|---|---|---|---|
| Message received in the background | Shown the next time the app becomes active, within 6 hours. Only the newest is kept. | Not shown | Not shown |
| Where it is shown | A separate window above your app | A separate activity | A dialog in your widget tree |
| "Displayed" reported | When the message is on screen | When the message is shown | When the SDK starts showing it |
| Link of a button | Your inAppNotificationClickDelegate first, then the SDK opens it | Your click handler, or the SDK opens it in Chrome Custom Tabs | Your onTap callback |
| Click counted | Always | Not when a click handler is set, and not for a button without a link | Not for a button without a link |
| Closes after a button tap | Yes | Yes | No |
| Custom fonts | fontResolver | setFontResolver | No font resolver. The SDK loads the font named in the panel from Google Fonts. A font that is not available there falls back to your app's default font. |