Firebase 在单个请求中发送多个通知

Pet*_*kyi 3 notifications push-notification firebase firebase-cloud-messaging

我必须使用 Firebase 消息传递通过单个请求发送多个通知。下面是我如何向单个用户发送通知的示例。任何帮助将不胜感激。

  curl --header "Authorization: key=***********" --header "Content-Type: application/json" -d '{
  "notification": {
    "title": "FCM Message",
    "body": "This is an FCM Message"
   },
  "to": "********************************************",
   }' https://fcm.googleapis.com/fcm/send
Run Code Online (Sandbox Code Playgroud)

Pet*_*kyi 5

我希望它会帮助某人。

curl --header "Authorization: key=***********" --header "Content-Type: 
application/json" -d '{
 "notification": {
   "title": "FCM Message",
   "body": "This is an FCM Message"
 },
 "registration_ids": ["********************************************",
    "*********************************",
    "*********************************"]
 }' https://fcm.googleapis.com/fcm/send
Run Code Online (Sandbox Code Playgroud)