Add Action To Firebase Notification

firebase-cloud-messaging doesn't provide an API to add action buttons to the notifications.

You can request new features to the firebase library here: https://firebase.google.com/support/contact/bugs-features/

For now what you can do is to send a data-message with a custom payload via the server-side API You can then receive that payload in onMessageReceived() and generate your custom notification.


So in order to customize notifications when app is on background, as Diego mentioned, the only current way is to create the notification yourself. Adding "data" key to notification payload, results in onMessageReceived() callback, on which you can create any notification andy notify.

Thing is, I tried to send a notification from Firebase console, rather then from the API. There I couldn't add the data key properly and catch it. From API all works fine.