Skip to content

Implementation of sending of push notification with Google FCM

License

Notifications You must be signed in to change notification settings

saromanov/go-fcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-fcm

Go Report Card Build Status Coverage Status Implementation of Google Cloud Messaging API

Example

package main

import (
	"fmt"
	"log"

	"github.com/saromanov/go-fcm"
)

func main() {
	data := fcm.New("YOUR_SERVER_KEY")
	resp, err := data.Send(&fcm.SendBody{
		To: "TOKEN",
		Notification: fcm.Notification{
			Title: "TestText",
			Body:  "TestBody",
		},
		Data: map[string]string{"body": "TestBody", "title": "TestText"},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp)
}

About

Implementation of sending of push notification with Google FCM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages