【发布时间】:2019-07-17 04:55:14
【问题描述】:
我使用 Firebase 云消息传递作为在我的网络应用中推送通知的一种方式。 所以现在我使用 Postman 作为发送推送通知的一种方式,但 我只能手动发送
我需要从谷歌应用脚本发送我的推送通知。
这是我在 Postman 中使用的,没有问题并且可以正常工作
这是来自我的 Google Apps 脚本
function firebaseNotification() {
var headers = {
"Authorization" : "key=key",
"Content-Type" : "application/json"
};
var options =
{
"notification": {
"title": "CWMS",
"body": "from google apps scritpt",
"click_action": "site",
"icon": "http://url-to-an-icon/icon.png"
},
"to": "key"
};
var response = UrlFetchApp.fetch("https://fcm.googleapis.com/fcm/send", options);
}
需要发生的是来自 Google Apps 脚本 function firebaseNotification() 但在此处被触发并可以 POST 所需的数据和网络应用程序以接收推送通知
【问题讨论】:
标签: reactjs post google-apps-script push-notification