mirror of
https://github.com/janoodleFTW/timy-messenger.git
synced 2026-01-23 02:14:39 +00:00
20 lines
466 B
JavaScript
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;
|