In-app messages are delivered to your app users when an event is triggered while the app is open. Opt-in is not required for these type of messages.
If your app is not fully native but built with a mobile framework you will need the iOS and Android prerequisites outlined above, but your code changes will relate to the specific mobile framework you are using. We support a range of popular mobile frameworks including:
Once that you have integrated the SDK in your app you will need to turn on In-app messaging by using the following method:
[XPush setInAppMessageEnabled: YES];
To be able to use the in-app channel, it must first be enabled by a Project Admin user, in Settings > Channels > Enabled Channels by toggling the In-app slider and clicking on Save. No further configuration is required.
Once you have enabled the in-app channel, you will be able to see In-app / On-site Messages as an available channel from the campaign builder page.
In-app messages are triggered by realtime events. You need at least one realtime event (for example a specific page view) to trigger an in-app message, or one can be triggered on session start.
Once the SDK has been deployed you can add these events easily by calling a simple method in your iOS or Android app. Trigger events are added to your app by using the
eventHit method of the Xtremepush SDK.
[XPush hitEvent: @"EVENT_NAME"];
Custom events may be triggered when sections of the app are opened, buttons are pressed or more complex events occur, such as purchases or the completion of goals. You must select an event that will trigger the message to be sent while the app is open.
Running tests is encouraged before start sending in-app campaigns to your customers. You'll find details on how to test below.
In-app messages can only be used in standalone campaigns. To create a test campaign go to: Campaigns > Create Campaign and select In-App / On-Site message.
To launch a test campaign you can manually fire an event from your app, by using the SDK event method.
[XPush hitEvent: @"EVENT_NAME"];
An event is created in your project when you fire it for the first time from your website, or you can also manually create it by navigating to Data Manager > Events > Create event.
Once that you have fired this event or created it, you will be able to select it by typing the event name into the Events tab (under Custom event). Configure all other options following our guide.
Navigate to the Segment tab to specify recipients of the campaign. If you have more than one app integrated you need to specify which one you want to target, otherwise the content will appear in all of them. If you have multiple users and you want to target a particular one, you can do so by selecting identifier > users IDs equals condition (this will only work if you have previously set your user ID in the Segmentation Engine.
Alternatively you can target by device ID by selecting identifier > device ID equals.
How to obtain your device ID?
Review our dedicated guide to learn how to obtain your device ID.
Count recipients before launching the campaign
Whenever launching a campaign it is a best practice to use the Calculate feature to count recipients and make sure that your targeted audience for this campaign is what you are expecting.
Once that you have launched the campaign, and in order to test it, you will need to go back to your app and fire the event again. The in-app message should appear immediately after you fire the event.
Troubleshooting: Debug logs
You can turn debug logs to review issues. See our dedicated guide for instructions on how to enable debug logs.
Updated about a month ago