API : https://fcm.googleapis.com/v1/%7B+parent%7D/messages:send
Request body
{
"message": {
"registration_ids": [
"DEVICE_TOKEN_1",
"DEVICE_TOKEN_2"
],
"notification": {
"title": "postman test 2",
"body": "New news story available."
},
"data": {
"type": "refresh"
}
}
}
I have tried multiple things in place of “Tokens” but none of them worked
“registration_ids” , “to” , “Token” etc key name tried but getting error like below,
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name "Tokens" at 'message': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message",
"description": "Invalid JSON payload received. Unknown name "Tokens" at 'message': Cannot find field."
}
]
}
]
}
}
Can Anyone tell me how to send push notification to multiple devices with FCM token ??
Recognized by Google Cloud Collective
New contributor
Jacky Dev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1