{"id":44434441,"url":"https://github.com/mdigger/apns","last_synced_at":"2026-02-12T13:51:50.827Z","repository":{"id":28892533,"uuid":"32417221","full_name":"mdigger/apns","owner":"mdigger","description":"Apple Push Notification Service Provider (HTTP/2)","archived":false,"fork":false,"pushed_at":"2017-02-20T14:39:12.000Z","size":320,"stargazers_count":17,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-19T02:19:04.826Z","etag":null,"topics":["apns","apns-certificate","apns2","apple","go","golang","jwt","notifications"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"raulmur/ORB_SLAM2","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdigger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-17T20:05:16.000Z","updated_at":"2023-06-11T06:26:45.000Z","dependencies_parsed_at":"2022-09-26T18:41:27.851Z","dependency_job_id":null,"html_url":"https://github.com/mdigger/apns","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mdigger/apns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdigger%2Fapns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdigger%2Fapns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdigger%2Fapns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdigger%2Fapns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdigger","download_url":"https://codeload.github.com/mdigger/apns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdigger%2Fapns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29367645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apns","apns-certificate","apns2","apple","go","golang","jwt","notifications"],"created_at":"2026-02-12T13:51:50.194Z","updated_at":"2026-02-12T13:51:50.819Z","avatar_url":"https://github.com/mdigger.png","language":"Go","readme":"# Apple Push Notification Service Provider (HTTP/2)\n\n[![GoDoc](https://godoc.org/github.com/mdigger/apns?status.svg)](https://godoc.org/github.com/mdigger/apns)\n[![Build Status](https://travis-ci.org/mdigger/apns.svg)](https://travis-ci.org/mdigger/apns)\n[![Coverage Status](https://coveralls.io/repos/github/mdigger/apns/badge.svg?branch=master)](https://coveralls.io/github/mdigger/apns?branch=master)\n\nApple Push Notification service includes the APNs Provider API that allows you to send remote notifications to your app on iOS, tvOS, and OS X devices, and to Apple Watch via iOS. This API is based on the HTTP/2 network protocol. Each interaction starts with a POST request, containing a JSON payload, that you send from your provider server to APNs. APNs then forwards the notification to your app on a specific user device.\n\n### With certificate authorization\n\nYour APNs certificate, which you obtain as explained in Creating a Universal Push Notification Client SSL Certificate in App Distribution Guide, enables connection to both the APNs Production and Development environments.\n\nYou can use your APNs certificate to send notifications to your primary app, as identified by its bundle ID, as well as to any Apple Watch complications or backgrounded VoIP services associated with that app.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"math/rand\"\n\t\"time\"\n\n\t\"github.com/mdigger/apns\"\n)\n\nfunc main() {\n\tcert, err := apns.LoadCertificate(\"cert.p12\", \"xopen123\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Error loading certificate:\", err)\n\t}\n\tclient := apns.New(*cert)\n\tid, err := client.Push(apns.Notification{\n\t\tToken: `883982D57CDC4138D71E16B5ACBCB5DEBE3E625AFCEEE809A0F32895D2EA9D51`,\n\t\tPayload: map[string]interface{}{\n\t\t\t\"aps\": map[string]interface{}{\n\t\t\t\t\"alert\": \"Hello!\",\n\t\t\t\t\"badge\": rand.Int31n(99),\n\t\t\t},\n\t\t\t\"time\": time.Now().Format(time.RFC3339Nano),\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatalln(\"Error push:\", err)\n\t}\n\tlog.Println(\"Sent:\", id)\n}\n```\n\n### With JWT authorization\n\nYou can use token-based authentication as an alternative to using provider certificates to connect to APNs. The provider API supports JSON Web Token (or JWT), an open standard, to pass authentication claims to APNs along with the push message.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"math/rand\"\n\t\"time\"\n\n\t\"github.com/mdigger/apns\"\n)\nfunc main() {\n\tproviderToken, err := apns.NewProviderToken(\"W23G28NPJW\", \"67XV3VSJ95\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\terr = providerToken.LoadPrivateKey(\"APNSAuthKey_67XV3VSJ95.p8\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tclient := apns.NewWithToken(providerToken)\n\tid, err := client.Push(apns.Notification{\n\t\tToken: `883982D57CDC4138D71E16B5ACBCB5DEBE3E625AFCEEE809A0F32895D2EA9D51`,\n\t\tTopic: \"com.xyzrd.trackintouch\",\n\t\tPayload: map[string]interface{}{\n\t\t\t\"aps\": map[string]interface{}{\n\t\t\t\t\"alert\": \"Hello, JWT!\",\n\t\t\t\t\"badge\": rand.Int31n(99),\n\t\t\t},\n\t\t\t\"time\": time.Now().Format(time.RFC3339Nano),\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatalln(\"Error push:\", err)\n\t}\n\tlog.Println(\"Sent:\", id)\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdigger%2Fapns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdigger%2Fapns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdigger%2Fapns/lists"}