github.com/tinode/fcm
go get github.com/tinode/fcm

github.com/tinode/fcm

Basic implementation of FCM (firebase cloud messaging) in Go

by tinode

v0.0.0-20181002080136-f3796d8397a9 (see all)License:Apache-2.0
go get github.com/tinode/fcm
Readme

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

GitHub Stars

11

LAST COMMIT

4yrs ago

MAINTAINERS

0

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20181002080136-f3796d8397a9
3yrs ago
v0.0.0-20180307205656-08ca0f9b70cf
3yrs ago
No alternatives found
No tutorials found
Add a tutorial