Skip to content

Commit 2a953e7

Browse files
author
Dmitry Marshkov
authored
JWT authentication instead of certificates (#8)
* JWT authentication instead of certificates
1 parent dc0ed32 commit 2a953e7

19 files changed

+277
-378
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
gen:
2-
easyjson notification.go api.go
3-
minimock -g -i Client -o ./ -s _mock.go
2+
easyjson apns/api.go
3+
minimock -g -i ./apns.Client -o ./apns/ -s _mock.go

api.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

api_easyjson.go

Lines changed: 0 additions & 85 deletions
This file was deleted.

notification.go renamed to apns/api.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"time"
66
)
77

8-
// easyjson:json
98
type Notification struct {
109
// An optional canonical UUID that identifies the notification. The
1110
// canonical form is 32 lowercase hexadecimal digits, displayed in five
@@ -154,3 +153,18 @@ type Alert struct {
154153
LocArgs []string `json:"loc-args,omitempty"`
155154
LaunchImage string `json:"launch-image,omitempty"`
156155
}
156+
157+
// easyjson:json
158+
type Response struct {
159+
Reason ErrorReason `json:"reason"`
160+
}
161+
162+
// ErrorReason API error reasons
163+
// https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns
164+
type ErrorReason string
165+
166+
const (
167+
ReasonExpiredProviderToken ErrorReason = "ExpiredProviderToken"
168+
ReasonBadDeviceToken ErrorReason = "BadDeviceToken"
169+
ReasonCodeUnregistered ErrorReason = "Unregistered"
170+
)

0 commit comments

Comments
 (0)