Skip to content

Instantly share code, notes, and snippets.

@sergsoares
Created April 23, 2018 00:21
Show Gist options
  • Save sergsoares/0085cac62f64c5d2dd71a1de479c4c10 to your computer and use it in GitHub Desktop.
Save sergsoares/0085cac62f64c5d2dd71a1de479c4c10 to your computer and use it in GitHub Desktop.
Simple curl to send a notification to firebase with a deviceID.
curl -d '{
"to": DEVICE_ID,
"notification": {
"title" : " This is my title new ",
"body" : " This is the body of my message "
}
}' \
-i -H "Application/json" \
-H "Content-type: application/json" \
-H "Authorization: key=YOUR_AUTH_KEY \
-X POST https://fcm.googleapis.com/fcm/send
@amirul12
Copy link

amirul12 commented Oct 8, 2024

official document : Firebaes

Curl

curl --location 'https://fcm.googleapis.com/v1/projects/product-name/messages:send' \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer .... need to generate auth token ' \
--data '{
   "message":{
      "token":" DEVICE_ID",
      "notification":{
        "body":"If you need help to create Auth token from a service account (firebase) please contact +8801722835935 whatsApps",
        "title":"FCM Message"
      }
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment