Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何从服务器使用FCM向用户发送推送通知?_Javascript_Firebase_Firebase Cloud Messaging_Google Cloud Functions - Fatal编程技术网

Javascript 如何从服务器使用FCM向用户发送推送通知?

Javascript 如何从服务器使用FCM向用户发送推送通知?,javascript,firebase,firebase-cloud-messaging,google-cloud-functions,Javascript,Firebase,Firebase Cloud Messaging,Google Cloud Functions,我的云函数中有一个https.onCall函数。我想在用户调用函数时向用户发送推送通知。Firebase文档对我没有帮助 exports.bookRoom = functions.https.onCall((data, context) => { if (context.auth.token.teacher === true || context.auth.token.admin === true) { // here i want to send notificatio

我的云函数中有一个https.onCall函数。我想在用户调用函数时向用户发送推送通知。Firebase文档对我没有帮助

exports.bookRoom = functions.https.onCall((data, context) => { 

  if (context.auth.token.teacher === true || context.auth.token.admin === true) {

    // here i want to send notification to the client
  }
});