soh335 / apnsapi

Simple apns api (http/2) client for golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wercker status

apnsapi

Simple apns api (http/2) client for golang.

USAGE

It provides only client, so should setup http/2 client, apns payload yourself.

token := "..."
client := apnsapi.NewClient(apnsapi.ProductionServer, &http.Client{...})
header := &apnsapi.Header{ApnsTopic: "..."}
payload := `{ "aps" : { "alert" : "hi" } }`
if _, err = client.Do(token, header, []byte{payload}); err != nil {
    ...
}

_example/main.go is sample implantation and used like this.

APNs Provider Certificates

$ go run _example/main.go --p12 /path/to/file.p12 --topic $topic --token $token

Provider Authentication Tokens

$ go run _example/main.go --key /path/to/file.p8 --kid $keyIdentifier --teamId $teamID --topic $topic --token $token

SEE ALSO

LICENSE

MIT

About

Simple apns api (http/2) client for golang.

License:MIT License


Languages

Language:Go 100.0%