I want to use the firebase admin SDK in my Firebase Functions to send an android notification with an inline reply action.
Similar functionality is described in this plugin which is built on FCM. I want to use this plugin to handle the event triggered by the reply action. But I am sending notifications through my Firebase Functions (hence the admin SDK).
Cordova Push Notification Plugin Docs
The docs for that plugin show the actions property being sent using fcm-node.
However, I can not find the actions attribute listed anywhere in the FCM documentation for android. (iOS would utilize the categories attribute which appears to be supported)
This code was working to send a generic notification:
let payload = {
data: {
referencetype: 'chat',
referenceid: context.params.chatid
},
notification: {
title: title,
body: body
},
android: {
priority: "high"
},
token: oUser.devicetoken
}
admin.messaging().send(payload).catch((error) => {
console.log(error);
return null;
});
I tried setting the actions properties on the notification object, which resulted in an error of an invalid property.
Edit-------
Referencing the push notification docs linked above and coming to the realization that I could simply use the fcm-node plugin mentioned in those docs, I included that plugin in my functions. I then tried to copy the exact payload referenced in the docs. It gave me this error: Error: Messaging payload contains an invalid value for the "data.actions" property. Values must be strings.. Which is consistent with the FCM documentation for the data property, but not that plugin. Everywhere that I've seen has the actions property being an array of objects. Did support for the 'actions' property disappear in FCM?