In-app messages

Updated

This page is part of a setup flow for the SDK. Before you continue, make sure you've implemented previous features—i.e. you can't receive in-app notifications before you identify people!

graph LR getting-started(Install SDK) -->B(Initialize SDK) B --> identify(identify people) identify -.-> track-events(Send events) identify -.-> push(Receive push) identify -.-> in-app(Receive in-app) click getting-started href "/sdk/flutter/getting-started/#install" click B href "/sdk/flutter/getting-started/#initialize-the-sdk" click identify href "/sdk/flutter/identify" click track-events href "/sdk/flutter/track-events/" click register-token href "/sdk/flutter/push" click push href "/sdk/flutter/push" click rich-push href "/sdk/flutter/rich-push" click in-app href "/sdk/flutter/in-app" click test-support href "/sdk/flutter/test-support" style in-app fill:#B5FFEF,stroke:#007069

How it works

An in-app message is a message that people see within the app. People won’t see your in-app messages until they open your app. If you set an expiry period for your message, and that time elapses before someone opens your app, they won’t see your message.

You can also set page rules to display your in-app messages when people visit specific pages in your app. However, to take advantage of page rules, you need to use screen tracking features. Screen tracking tells us the names of your pages and which page a person is on, so we can display in-app messages on the correct pages in your app.

graph LR a[app user triggers
in-app message]-->d{is the app open?} d-->|yes|f[user gets message] d-->|no|e[hold message
until app opens] e-->g{did the message
expire?} g-->|no, wait for user
to open the app|d g-->|yes|h[user doesn't
get the message]

Set up in-app messaging

In-app messages are disabled by default. Just set enableInApp to true in your CustomerioConfig(), and your app will be able to receive in-app messages.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import 'package:customer_io/customer_io.dart';
import 'package:customer_io/customer_io_config.dart';
import 'package:customer_io/customer_io_enums.dart';

  await CustomerIO.initialize(
    config: CustomerIOConfig(
      siteId: "919a7e12107bd03155f6",
      apiKey: "86344654754f1c48d32b",
      region: Region.us,
      enableInApp: true,
    ),
  );

Page rules

You can set page rules when you create an in-app message. A page rule determines the page that your audience must visit in your app to see your message. However, before you can take advantage of page rules, you need to:

  1. Track screens in your app. See the Track Events page for help sending screen events.
  2. Provide page names to whomever sets up in-app messages in fly.customer.io. If we don’t recognize the page that you set for a page rule, your audience will never see your message.
Set up page rules to limit in app messages by page
Set up page rules to limit in app messages by page

Keep in mind: page rules are case sensitive. If you’re targeting your mobile app, make sure your page rules match the casing of the name in your screen events. If you’re targeting your website, your page rules should always be lowercase.

The first page rule is Web contains /dashboard. The second page rule is iOS contains Dashboard.
The first page rule is Web contains /dashboard. The second page rule is iOS contains Dashboard.
Copied to clipboard!
  Contents
Current release
 1.5.2
Is this page helpful?