APNS
APNS copied to clipboard
APNS.send_notifications doesn't handle bad device token well
I'm observing an issue with the batch notifications method send_notifications
If one of the device token in the request is incorrect due to any reason, the batch notification would stop at the bad token without any error response. An example as the following:
- T: device token, M: message
- Send batch notifications for 3 messages T1-M1, T2-M2, T3-M3
- If T2 is problematic, only T1-M1 would succeed. T3-M3 would fail. The request wouldn't have any error messages indicating that the request have failed
Is it possible to fix this issue?
Yes, I noticed this flaw in the logic too. One straightforward fix would be to handle exceptions on a individual basis and then report back any errors. Feel free to post a fix if you'd like.