iOS Action Buttons

Configuring Action Buttons

When creating mobile push notifications, you can add several action buttons for greater interactivity. When a receiver touches the screen for an extended period of time (long pressing), it displays the actions assigned to your push notification. iOS supports up to 4 buttons in a single notification.

Adding Action Buttons

  1. In your account, select Messages → Messages → Mobile Push.
  2. Create a new mobile push notification or edit an existing one.
  3. In the Buttons section, enter all the parameters as shown below.
Action Button
  1. Click + Add Button if 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.

ParameterNotes
Action IDA unique identifier for the button action.
TextThe text that a button displays.
iOS icon pathThe icon associated with the action. Available in iOS 15 and later. Enter the name of an image located in your app’s bundle, preferably in an asset catalog
Launch URLAn URL or a deeplink that opens when the notification is selected
Custom dataAdditional parameters associated with the button in JSON format

To learn more about notification action icons, see Apple documentation.

Handling the Action Button Click Events

When an action button is selected, the Reteno SDK fires a notification click handler Reteno.userNotificationService.notificationActionHandler. This click handler contains the RetenoUserNotificationAction actionId, customData and the link that you set when creating the Action Buttons.

Reteno.userNotificationService.notificationActionHandler = { userInfo, action in
    let actionId = action.actionId
    let customData = action.customData
    let actionLink = action.link
}