We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0ddd17 commit 70d5fd8Copy full SHA for 70d5fd8
README.md
@@ -1,2 +1,26 @@
1
# APNs Provider
2
+
3
HTTP/2 Apple Push Notification service (APNs) provider for Go with token-based connection
4
5
+Example:
6
7
+```Go
8
+key, err := apns.AuthKeyFromFile("AuthKey_XXXXXXXXXX.p8")
9
+if err != nil {
10
+ log.Fatal(err)
11
+}
12
13
+token := apns.NewToken(key, "XXXXXXXXXX", "XXXXXXXXXX")
14
+client := apns.NewClient(token, nil)
15
16
+n := &apns.Notification{
17
+ DeviceToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
18
+ Host: apns.HostDevelopment,
19
+ Topic: "com.example.app",
20
+ Payload: apns.BuildPayload(&apns.APS{
21
+ Alert: "Hi",
22
+ }, nil),
23
24
25
+fmt.Println(client.Push(n))
26
+```
0 commit comments