Enable interactive push notifications by adding customizable action buttons for mobile and web platforms, with click handling, icons, and event tracking support.
Image showing action buttons in iOS
Image showing action buttons to be added for iOS and Android
buttons
parameter. Pass an array of up to 3 objects with id
, text
, and icon
.web_buttons
, passing up to 2 objects with id
, text
, icon
, and url
.id
propertytext
propertyhttp://site.com/icon.png
)icon
property'do_not_open'
to prevent opening any URL. (e.g. βdo_not_openβ)
url
propertyactionID
. Apps can respond in two ways:
Default Behavior:
ios_category
and register actions using UNNotificationCategory.AndroidManifest.xml
follow the Android SDK setup guide to disable the default behavior of always opening the app. This will allow you to override the normal open events and handle the action using custom code and the Mobile Service Extensions.
iOS: you can add an ios_category
within the notification. This will allow you to add custom actions through the UNNotificationCategory Object. See Appleβs Declaring Your Actionable Notification Types for more details.
Platform | Support Notes |
---|---|
iOS | - Supports up to 4 buttons |
Android, Amazon | - Supports up to 3 buttons |
Chrome | - Supports 2 buttons |
Firefox, Safari | - Buttons not supported |
Action Id
and Text
_osp=do_not_open
will not open any URLhttps://yoursite.com/page?_osp=do_not_open
.
support@onesignal.com
Please include: