Skip to content

Commit

Permalink
fix: add ExpiredToken as option for error response (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
chklch-pd committed Nov 24, 2023
1 parent 8bfafd6 commit fc6f030
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/APNS Apple iOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ _Taken from [APNS Provider API](https://developer.apple.com/library/content/docu
| `:missing_provider_token` | No provider certificate was used to connect to APNs and Authorization header was missing or no provider token was specified. |
| `:bad_path` | The request contained a bad :path value. |
| `:method_not_allowed` | The specified :method was not POST. |
| `:expired_token` | The device token has expired. |
| `:unregistered` | The device token is inactive for the specified topic. |
| `:payload_too_large` | The message payload was too large. The maximum payload size is 4096 bytes. |
| `:too_many_provider_token_updates` | The provider token is being updated too often. |
Expand Down
2 changes: 2 additions & 0 deletions lib/pigeon/apns/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ defmodule Pigeon.APNS.Error do

defp parse_response("MethodNotAllowed"), do: :method_not_allowed

defp parse_response("ExpiredToken"), do: :expired_token

defp parse_response("Unregistered"), do: :unregistered

defp parse_response("PayloadTooLarge"), do: :payload_too_large
Expand Down
1 change: 1 addition & 0 deletions lib/pigeon/apns/notification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ defmodule Pigeon.APNS.Notification do
| :missing_provider_token
| :bad_path
| :method_not_allowed
| :expired_token
| :unregistered
| :payload_too_large
| :too_many_provider_token_updates
Expand Down

0 comments on commit fc6f030

Please sign in to comment.