I want set a label in the message.And I read the official document here and similar question here.
But I can't figure out how to write it in javascript.
my code here:
const message = {
notification: {
title: "myTitle",
body: "myBody"
},
condition: "!('TopicA' in topics)",
AnalyticsLabel : "mylabel" <=== something like this?
};
const response = await admin.messaging().send(message);
Here is the trick...
const message = {
notification: {
title: "myTitle",
body: "myBody"
},
condition: "!('TopicA' in topics)",
fcmOptions: {
analyticsLabel : "MyLabel"
}
};