I needed to create a microservice for manage communications in my app, emails, SMS, and notifications with FCM.

So I decided to create a lib in for FCM for use en my app, Source.


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)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.