jazzband / django-push-notifications

Send push notifications to mobile devices through GCM or APNS in Django.
MIT License
2.25k stars 613 forks source link

APNS device tokens variable length per Apple docs #537

Open binary-sentient opened 4 years ago

binary-sentient commented 4 years ago

According to this developer document, apple device tokens can be variable in length:

"APNs device tokens are of variable length. Do not hard-code their size."

However, this line fails validation if the token is anything but 64 or 200 characters in length: https://github.com/jazzband/django-push-notifications/blob/master/push_notifications/api/rest_framework.py#L54

auvipy commented 4 years ago

are you up for a PR with test?

binary-sentient commented 4 years ago

Will be happy to as soon as I can get to it. Deadline bearing down on me. I'll have to fix it myself, but I haven't got to it yet.

ianlater commented 1 year ago

Ping on this. Currently hitting trying to register a 161 char token

ianlater commented 1 year ago

I opened https://github.com/jazzband/django-push-notifications/pull/678