Flutter 向令牌发送 firebase 通知
Flutter send firebase notification to token
所以我有一个聊天应用程序,我想要它,这样我就可以在有人向我发送消息时收到通知。问题是我实现了 firebase 消息传递,如果我从 firebase 发送它,我可以收到通知。我想添加它,例如一旦我按下发送按钮,我就可以直接将通知发送到应用程序中的令牌,例如:
send notification{
to token : here the receiver token
title : the title of the notification
description : the description of the notification
}
有没有可能有这样的东西?
只是为了帮助,
如果有人想使用 REST POST API,就在这里,使用配置如下的 Postman
URL:
https://fcm.googleapis.com/fcm/send
Header:
"Content-Type": "application/json",
"Authorization": "key=<Server_key>"
BODY:
{
"to": "<Device FCM token>",
"notification": {
"title": "Check this Mobile (title)",
"body": "Rich Notification testing (body)",
"mutable_content": true,
"sound": "Tri-tone"
},
"data": {
"url": "<url of media image>",
"dl": "<deeplink action on tap of notification>"
}
}
所以我有一个聊天应用程序,我想要它,这样我就可以在有人向我发送消息时收到通知。问题是我实现了 firebase 消息传递,如果我从 firebase 发送它,我可以收到通知。我想添加它,例如一旦我按下发送按钮,我就可以直接将通知发送到应用程序中的令牌,例如:
send notification{
to token : here the receiver token
title : the title of the notification
description : the description of the notification
}
有没有可能有这样的东西?
只是为了帮助,
如果有人想使用 REST POST API,就在这里,使用配置如下的 Postman
URL:
https://fcm.googleapis.com/fcm/send
Header:
"Content-Type": "application/json",
"Authorization": "key=<Server_key>"
BODY:
{
"to": "<Device FCM token>",
"notification": {
"title": "Check this Mobile (title)",
"body": "Rich Notification testing (body)",
"mutable_content": true,
"sound": "Tri-tone"
},
"data": {
"url": "<url of media image>",
"dl": "<deeplink action on tap of notification>"
}
}