FCM
Firebase Cloud Messaging (FCM) Library with golang
License
The MIT License (MIT). Please see License File for more information.
Installation
go get github.com/OzqurYalcin/fcm
Usage
package main
import (
"encoding/json"
"fmt"
fcm "github.com/OzqurYalcin/fcm/src"
)
func main() {
api := &fcm.API{"api-key"}
request := &fcm.Request{}
request.To = "" // Instance ID
request.Priority = "high" // Priority (high,normal)
request.Data = map[string]string{"msg": "Hello World"}
request.Notification = fcm.Notification{Title: "Title", Body: "Body"}
request.ContentAvailable = true
response := api.Send(request)
pretty, _ := json.MarshalIndent(response, " ", "\t")
fmt.Println(string(pretty))
}