Simplepush Blog

Actionable Push Notifications

Actionable Notification in IOS Notification Center

Simplepush now supports Actionable Notifications for both Android and iOS. Actionable notifications let you attach action buttons to notifications that you send with Simplepush.

Currently Simplepush supports two different action types: Feedback and GET.

When you send a notification with feedback actions associated to it, you will immediately get back a feedback id. With the feedback id you can check if an action on the associated notification was selected and if so which action it was.

GET actions simply execute an HTTP GET request when they are selected. They provide a simple way to fire off webhooks.

Freemium users get five actionable notifications per month while there are no limitations for subscribed users.

Feedback Actions

Sending a feedback action is easy.

curl https://api.simplepush.io/send -d '{"key": "YOUR_KEY", "msg": "Actionable Notification", "actions": ["yes", "no"]}'

{"status":"OK","feedbackId":"5e885b1d33c547bbac78bda8cdaf7be7"}

This HTTP request will send a notification with two actions associated to it: “yes” and “no”.

In addition it will return the feedback id for the given notification. With the feedback id it is possible to check if and when an action was selected.

curl https://api.simplepush.io/1/feedback/5e885b1d33c547bbac78bda8cdaf7be7

{"success":true,"action_selected":"yes","action_selected_at":1646869812,"action_delivered_at":1646869812}

In the example output above you can see that the field action_selected shows that “yes” was selected. action_selected_at describes the timestamp at which the action was selected by the user. action_delivered_at is the timestamp at which the backend received the information (since a user can select an action while not having an internet connection).

The feedback action information for a given notification is accessible for 30 days.

GET Actions

With GET actions you can send actionable notifications where selecting an action results in an HTTP GET request. GET actions provide a simple way to execute webhooks from within notifications.

curl https://api.simplepush.io/send -d '{"key": "YOUR_KEY", "msg": "Actionable Notification", "actions": [{"name": "yes", "url": "http://your.domain/yes"}, {"name": "no", "url": "http://your.domain/no"} ]}'

{"status":"OK"}

If you control the HTTP endpoints that you define in the request, you can execute further tasks from there.

If a GET action is selected while the user’s device is offline, the Simplepush app will retry the request once the device is back online.

Share on:
Imprint