Simple FCM mock for both old fcm HTTP and HTTP v1 Image for this repo on DockerHub
To run in docker simply run this:
docker run -p 4004:4004 -d andruxxxa/fcm-mock-server-go
The docker exposes one port - 4004.
To run localy just:
go run main.go
Endpoints:
- POST /send - send message to the mock (200 response) - old HTTP
- POST /v1/projects/[project_id]/messages:send - send message to the mock (200 response) - HTTP V1
- GET /api/messages - returns (as
JSON
) history ofFCM
API calls to this mock - DELETE /api/messages - clear messages history
{
"to": "string", // device token or topic
"data": { // [string]string dictionary
"field1": "value1",
"field2": "value2",
...
},
"notification": {
"title": "title",
"body": "body"
}
}
{
"Message": {
"token": "string",
"topic" : "string",
"condition" : "string",
"data": { // [string]string dictionary
"field1": "value1",
"field2": "value2",
...
},
"notification": {
"title": "string",
"body": "string"
}
}
}
Simple test requests - work with REST client