The documentation is currently a work in progress whilst the product is in alpha.

NotificationPressAction

The interface used to describe a press action for a notification.


There are various ways a user can interact with a notification, the most common being pressing the notification, pressing an action or providing text input. This interface defines what happens when a user performs such interaction.

On Android; when provided to a notification action, the action will only open you application if a launchActivity and/or a mainComponent is provided.

Properties

id

The unique ID for the action.

id: string;

The id property is used to differentiate between user press actions. When listening to notification events, the ID can be read from the event.detail.pressAction object.

launchActivity

Android Only

The custom Android Activity to launch on a press action.

launchActivity?: undefined | string;

This property can be used in advanced scenarios to launch a custom Android Activity when the user performs a press action.

View the Android Interaction docs to learn more.

launchActivityFlags

Android Only

Custom flags that are added to the Android Intent that launches your Activity.

launchActivityFlags?: AndroidLaunchActivityFlag[];

These are only required if you need to customise the behaviour of how your activities are launched; by default these are not required.

mainComponent

Android Only

A custom registered React component to launch on press action.

mainComponent?: undefined | string;

This property can be used to open a custom React component when the user performs a press action. For this to correctly function on Android, a minor native code change is required.

View the Press Action document to learn more.


Copyright 2020 © Invertase Limited

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License and code samples are licensed under the Apache 2.0 License.

All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.