Skip to content

Instantly share code, notes, and snippets.

@moehandi
Last active December 9, 2019 04:50
Show Gist options
  • Save moehandi/60640257685f0ca96767df7340b87131 to your computer and use it in GitHub Desktop.
Save moehandi/60640257685f0ca96767df7340b87131 to your computer and use it in GitHub Desktop.
curl -H "Content-type:on:key=<SERVER KEY in Cloud Message Setting Tab on Firebase Console>" -X POST -d
'{ "to": "/topics/topic-name",
"notification": {
"title": "notification title",
"text" : "notification text"
"click_action" : "action or activity name to open intent"
},
"data": {
"message": "this data message",
"title" : "this data message title",
"body" : "this data message body"
}
}' https://fcm.googleapis.com/fcm/send
//______________________________________________________________________________
curl https://fcm.googleapis.com/fcm/send -X POST \
— header “Authorization: key=your_firebase’s_server_auth_key” \
— Header “Content-Type: application/json” \
-d '
{
“to”: “the_device_token”
“notification”:{
“title”:”Notification Test”,
“body”:”Notification Test Body Message”
},
“priority”:10
}'
//______________________________________________________________________________
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment