From 899226575680274ad3cfa2862b05112a5097e200 Mon Sep 17 00:00:00 2001 From: Wes Chow Date: Tue, 19 Mar 2024 14:14:49 -0400 Subject: [PATCH] Allow convert_device_token_to_hex apns config option. (#364) Signed-off-by: Wes Chow --- README.md | 4 ++++ changelog.d/364.bugfix | 1 + sygnal/apnspushkin.py | 1 + 3 files changed, 6 insertions(+) create mode 100644 changelog.d/364.bugfix diff --git a/README.md b/README.md index 0d9ef5b2..d6e9efcf 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,10 @@ For either type, it can accept: Valid values are 'production' or 'sandbox'. If not provided, 'production' is used. - the `push_type` parameter which determines what value for the `apns-push-type` header is sent to APNs. If not provided, the header is not sent. +- the `convert_device_token_to_hex` parameter which determines if the + token provided from the client is b64 decoded and converted to + hex. Some client libraries already provide the token in hex, and + this should be set to `False` if so. ### gcm diff --git a/changelog.d/364.bugfix b/changelog.d/364.bugfix new file mode 100644 index 00000000..b7bd4f64 --- /dev/null +++ b/changelog.d/364.bugfix @@ -0,0 +1 @@ +Add convert_device_token_to_hex to the list of understood APNs config parameters. diff --git a/sygnal/apnspushkin.py b/sygnal/apnspushkin.py index a334745c..a9c2d5f1 100644 --- a/sygnal/apnspushkin.py +++ b/sygnal/apnspushkin.py @@ -110,6 +110,7 @@ class ApnsPushkin(ConcurrencyLimitedPushkin): "keyfile", "topic", "push_type", + "convert_device_token_to_hex", } | ConcurrencyLimitedPushkin.UNDERSTOOD_CONFIG_FIELDS APNS_PUSH_TYPES = {