Open chrisballinger opened 7 years ago
In the below code the function _apns_send returns a dict of the token(s) and return value. It appears from my debugging session that the following are possible return values:
Success MissingTopic Unregistered and more?
Return values of _apns_send can be "Success" or any of these errors: https://github.com/jleclanche/django-push-notifications/blob/master/push_notifications/apns_errors.py
What kind of error exposing would be most useful for you?
I'm not sure exactly what would fit best without breaking the existing API, but I was having trouble understanding why my requests weren't working and the only way to figure it out was to pause in the debugger and inspect the return values.
Although apns_send_bulk_message
returns results, the code I copied above actually contains some modifications to capture and return the result in apns_send_message
. I'll submit a PR for that and add docs about the return values.
In the below code the function
_apns_send
returns a dict of the token(s) and return value. It appears from my debugging session that the following are possible return values:Success
MissingTopic
Unregistered
Right now the library only checks for
Unregistered
tokens but doesn't provide feedback for other types of APNS errors. I propose exposing these errors further up the stack so they can be handled in some way in application code.