timy-messenger/firebase/functions/message-get.js
Franz Heinfling 64d39ac266 Initial commit.
Co-authored-by: Miguel Beltran <m@beltran.work>
2019-10-01 17:26:36 +02:00

20 lines
466 B
JavaScript

/**
* Create the push notification payload JSON, include the user token
*
* API v1 reference: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
*
*/
const getMessage = (token, title, body, data, apns, android) => {
return {
token: token,
notification: {
title: title,
body: body
},
data: data,
apns: apns,
android: android
};
}
module.exports = getMessage;