Firebase Cloud Messaging library written in Go
Switch branches/tags
Nothing to show
Clone or download
Latest commit fc0ca9f Feb 1, 2018

go-fcm : FCM library in Go

CircleCI Codecov

Firebase Cloud Messaging ( FCM ) Library using golang ( Go )

This library uses HTTP/JSON Firebase Cloud Messaging connection server protocol


go get


Firebase Cloud Messaging HTTP Protocol Specs

Firebase Cloud Messaging Developer docs


package main

import (

func main() {
	// init client
	client := fcm.NewClient("ApiKey")
	// You can use your HTTPClient 
	data := map[string]interface{}{
		"message": "From Go-FCM",
		"details": map[string]string{
			"name": "Name",
			"user": "Admin",
			"thing": "none",
	// You can use PushMultiple or PushSingle
	client.PushMultiple([]string{"token 1", "token 2"}, data)
	//client.PushSingle("token 1", data)
	// registrationIds remove and return map of invalid tokens
	badRegistrations := client.CleanRegistrationIds()
	status, err := client.Send()
	if err != nil {
		log.Fatalf("error: %v", err)