I’m using the firebase-admin
SDK in my app, but when I call the sendEachForMulticast
method, it throws error TypeError: 'allSettled' is not a function
.
Do Atlas functions not yet support the Promise.allSettled
function? If so, is there somewhere I can put in a feature request to support it?
For context:
- Here is the Promise.allSettled documentation
- Here’s the documentation for sendEachForMulticast
Here’s how I’m using it in my code:
exports = async function sendNotification (message) {
const firebase = require('firebase-admin')
firebase.initializeApp({
/* My credentials are here */
})
await firebase.messaging().sendEachForMulticast(message)
}
I’m able to get around this by instead using the send
method within a Promise.all
, as shown below:
await Promise.all(messages.map(async message =>
await firebase.messaging().send(message)
))
But ideally it would be nice to be able to use the intended SDK method for this situation, rather than having a bunch of duplicates of my exact same message but just with different recipient tokens.