I am trying to attach an image to my Firebase Push notification that is being sent to an iOS device. The iOS app is setup to accept notifications via Notification Service Extension for APNS.
The issue is the way I am trying to setup the payload for the Firebase call to Admin.messaging().sendToDevice(). There's an options parameter in the sendToDevice() function that has a 'mutableConent : true' field and says in the docs that it's for APNs payloads. I don't know how to add the APNs payload properly...
Here is my node.js code:
const payload = {
notification: {
title: publisher.Username + " posted a new Mag!",
body: "",
},
data : {
"fcm_options": {
"image": magImage,
},
}
}
let options = {
mutableContent : true
}
return admin.messaging().sendToDevice(deviceTokens, payload, options)
Any help on how to setup the payload or any other solution to add images would be helpful!