Action Buttons
Configuring Action Buttons
When creating mobile push notifications, you can add action buttons for greater interactivity. On iOS, users reveal them by expanding or long-pressing the notification; Android presentation depends on the OS and notification layout.
- iOS supports up to 4 buttons in a single notification.
- Android OS supports up to 3 buttons in a single notification.
Adding Action Buttons
- In your account, select Messages → Messages → Mobile Push.
- Create a new mobile push notification or edit an existing one.
- In the
Buttonssection, enter all the parameters as shown below.
- Click
+ Add Buttonif you want to add more buttons.
Note You must enter the values in Action ID and Text for this button to work correctly. You have to use different Action IDs when you add multiple buttons.
| Parameter | Notes |
|---|---|
| Action ID | A unique identifier for your button action. |
| Text | The text the button should display. |
| iOS icon path | The icon associated with the action. Available in iOS 15 and later. Provide name of an image located in your app’s bundle, preferably in an asset catalog |
| Launch URL | The URL or deeplink to open when notification is clicked |
| Custom data | Additional parameters associated with button in JSON format |
For more information about notification action icon visit Apple documentation.
Handle the Action Button Click Event
import 'package:reteno_plugin/reteno.dart';
Reteno.onUserNotificationAction.listen((event) {
print('Action ID: ${event.actionId}');
print('Custom data: ${event.customData}');
print('Link: ${event.link}');
});The event is a RetenoUserNotificationAction:
RetenoUserNotificationAction({
this.actionId, // String? — unique identifier configured for the button
this.customData, // Map<String?, Object?>? — key-value data configured for the button
this.link, // String? — URL or deeplink configured for the action
});Reteno.onCorePushAction is an equivalent cross-platform alias. Subscribe to either stream, not both.
Subscribe synchronously at Dart startup, before awaiting Reteno().initialize(). The stream is a broadcast stream and does not replay events, and getInitialNotification() does not recover the action payload.
The action stream works in all iOS token modes. Do not assign a FlutterAppDelegate as UNUserNotificationCenter.current().delegate before GeneratedPluginRegistrant runs, and make any later delegate forward to the previous one. See Notification delegate coordination.
