Actions Overview

Trigger actions when events occur, or conditions are met

Action Types

Our SDK comes with a number of powerful actions built in:

  • Announcement banner: display a banner across the top/bottom of your app, optionally linking to other actions when tapped

  • Modals Popovers / Custom Messaging: show a fullscreen popover with fully native UI. Create beautiful detailed UI with support for images, titles, text, buttons and theming. Buttons can connect to other actions.

  • App Review Prompt: show the system native UI asking a user to rate your app

  • Alerts and Action sheets: launch native alerts, with buttons connecting to other actions.

  • Open web links: in an embedded brower displaying a webpage inside your app, or opening in the user's default browser

  • Custom actions: Launch custom actions/deeplinks into other parts of your app

  • Open other apps: Launch other apps, optional deeplinking to specific features

  • Conditional actions: check a condition, and fire one action if true, and another if false

An alternative to actions are our feature flags, which allow deeper integration into your codebase.

Themes

Our action UI can be themed to match the design of your app. See docs.

Configuration Example

Actions are created in your config file. A top level actions object contains an namedActions map/object, with subitems for each action.

Each action requires an actionType string and actionData object. The contents of each are described in the docs for the each action type.

Actions can optionally include a condition string, which will be evaluated before triggering the action, and will stop the action from being performed if it evaluates to false (or errors).

Actions can also specify a fallback, a string name of an action to perform if this action can't be performed for any reason. Reasons an action might fail vary based on the action type, but as an example, attempting to launch an app deep link into an app which isn't installed will fail, and can fallback to another action, like launching an app store link to get that app.

Example:

"actions": {
     "namedActions": {
         "landscapeAlert": {
             "actionType": "alert",
             "condition": "interface_orientation == 'landscape'",
             "actionData": {
                 "title": "Launched Landscape",
                 "message": "The app was launched while in landscape orientation."
             }
         },
         "portraitAlert": {
             "actionType": "alert",
             "condition": "interface_orientation == 'portrait'",
             "actionData": {
                 "title": "Launched Portrait",
                 "message": "The app was launched while in portrait orientation."
             }
         }
     }
 }

Triggering Actions

Actions are connected to the rest of the system through the config file, by the name specified in the namedActions map. The following parts of the config file can trigger an action:

  • Triggers connect actions to events. You can fire an action when an event occurs.

  • Nested Actions: actions like alerts, modals and banners can have buttons which can be connected to other actions which are fired when the user taps them. For example, a "more info" button could launch an open link action to your webpage for more info.

  • Conditional actions: are actions which check a condition, and fire one action by name if true, and another if false

Last updated