我在调用FCM API时面临一个悲剧性的问题: - 简而言之当我使用以下内容调用API时:
URL:-https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AAAA4Kkj8iw:APA91bE......vE4Hxg
{
"condition" : "'Software' in topics",
"data":{
"title":"Title",
"message":"Hello,Via Multiple Topics"
}
}
它工作正常,我在设备上收到了通知,我已经订阅了主题"软件",但当我选择多个主题并将主体更改为
{
"condition" : "'Software' in topics || 'IOT' in topics",
"data":{
"title":"Title",
"message":"Hello,Via Multiple Topics"
}
}
然后我没有收到通知 我在POSTMAN上测试过它显示邮件已发送但我在设备上没有收到任何通知。
答案 0 :(得分:0)
https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to": "/topics/foo-bar",
"data": {
"message": "This is a Firebase Cloud Messaging Topic Message!",
}
}
https://fcm.googleapis.com/fcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"condition": "'dogs' in topics || 'cats' in topics",
"data": {
"message": "This is a Firebase Cloud Messaging Topic Message!",
}
}