diff options
author | =Corey Hulen <corey@hulen.com> | 2015-06-14 23:53:32 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-06-14 23:53:32 -0800 |
commit | 56e74239d6b34df8f30ef046f0b0ff4ff0866a71 (patch) | |
tree | 044da29848cf0f5c8607eac34de69065171669cf /Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go | |
download | chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.gz chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.bz2 chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.zip |
first commit
Diffstat (limited to 'Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go b/Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go new file mode 100644 index 000000000..f08dc06e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/anachronistic/apns/push_notification_response.go @@ -0,0 +1,36 @@ +package apns + +// The maximum number of seconds we're willing to wait for a response +// from the Apple Push Notification Service. +const TimeoutSeconds = 5 + +// This enumerates the response codes that Apple defines +// for push notification attempts. +var ApplePushResponses = map[uint8]string{ + 0: "NO_ERRORS", + 1: "PROCESSING_ERROR", + 2: "MISSING_DEVICE_TOKEN", + 3: "MISSING_TOPIC", + 4: "MISSING_PAYLOAD", + 5: "INVALID_TOKEN_SIZE", + 6: "INVALID_TOPIC_SIZE", + 7: "INVALID_PAYLOAD_SIZE", + 8: "INVALID_TOKEN", + 10: "SHUTDOWN", + 255: "UNKNOWN", +} + +// PushNotificationResponse details what Apple had to say, if anything. +type PushNotificationResponse struct { + Success bool + AppleResponse string + Error error +} + +// NewPushNotificationResponse creates and returns a new PushNotificationResponse +// structure; it defaults to being unsuccessful at first. +func NewPushNotificationResponse() (resp *PushNotificationResponse) { + resp = new(PushNotificationResponse) + resp.Success = false + return +} |