TESTING FCM PUSH NOTIFICATION (HTTP v1)

Testing FCM Push Notification (HTTP v1) through OAuth 2.0 Playground/Postman/Terminal — Part 2

Tutorial to test Firebase Cloud Messaging (FCM) Push Notification (HTTP v1) through OAuth 2.0 Playground or Postman or Terminal (curl command)

FCM (HTTP v1)+ Postman / Terminal / OAuth 2.0 Playground → Send Push Notification

Why use or migrate to FCM HTTP v1 ?

FCM HTTP v1 Protocol + OAuth 2.0 Playground / Postman / Terminal

Copy <Project ID>

☛ Send Notification using OAuth 2.0 Playground :-

Select FCM API v1
Authenticate and Grant permission
Generate and Copy <Access token>
{
"message": {
"token": "FCM_TOKEN",
"data": {
"body": "Body of Your Notification in data",
"title": "Title of Your Notification in data",
"key_1": "Value for key_1",
"key_2": "Value for key_2"
}
}
}
Add the message payload
Send push notification using FCM HTTP v1

☛ Send Notification using Postman :-

{
"message": {
"token": "FCM_TOKEN",
"data": {
"body": "Body of Your Notification in data",
"title": "Title of Your Notification in data",
"key_1": "Value for key_1",
"key_2": "Value for key_2"
}
}
}

☛ Send Notification using Terminal :-

curl --location --request POST 'https://fcm.googleapis.com/v1/projects/<Project Id>/messages:send' \
--header 'Authorization: Bearer <Access token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": {
"token": "FCM_TOKEN",
"data": {
"body": "Body of Your Notification in data",
"title": "Title of Your Notification in data",
"key_1": "Value for key_1",
"key_2": "Value for key_2"
}
}
}'

Consultant at GlobalLogic | iOS app developer | AWS Certified Solutions Architect - Associate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store