Skip to content
forked from tinode/fcm

Basic implementation of FCM (firebase cloud messaging) in Go

License

Notifications You must be signed in to change notification settings

isabella232/fcm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Golang FCM

Basic implementation of FCM (firebase cloud messaging) in Go. Only HTTP requests with JSON payload are supported. This package uses legacy HTTP API (pre-v1 API).

Documentation

https://godoc.org/github.com/tinode/fcm

Usage:

  client := fcm.NewClient(your_fcm_api_key)

  message := &fcm.HttpMessage{...initialize your message...}
  response := client.SendHttp(message)

The client is safe to use from multiple go routines at the same time. The client maintains a pool of HTTP connections. It recycles them as needed. Do not recreate client for every request because it's wasteful. SendHttp is a blocking call.

Sample code: https://github.com/tinode/chat/blob/master/server/push/fcm/push_fcm.go

Installation

go get github.com/tinode/fcm

About

Basic implementation of FCM (firebase cloud messaging) in Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%