Skip to content

soh335/apnsapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages