rakanalh / django-pushy

Your push notifications handled at scale.
MIT License
168 stars 16 forks source link

add task to processe APNS feedback #22

Closed miraculixx closed 7 years ago

miraculixx commented 9 years ago

apns offers a feedback mechanism to get reports on bad device tockens. This should be automated so that invalid tokens can be deleted automatically (or better: marked as invalid so we can send users a reminder email):

#New APNS connection
feedback_connection = APNS(use_sandbox=True, cert_file='cert.pem', key_file='key.pem')

# Get feedback messages.
for (token_hex, fail_time) in feedback_connection.feedback_server.items():
    # get token, mark as invalid

Required changes:

Projects using django-pushy can then add this celery task as a daily scheduled task, thus automating device management.

rakanalh commented 9 years ago

Hi @miraculixx,

Great idea! you're very much welcome to send me a PR for this and i'll review and merge if this feature is needed on your end.

wolfhechel commented 8 years ago

I would rather have it delete the Device as is the default action taken when a device token is invalidated.

rakanalh commented 7 years ago

This has been implemented to delete the invalid token rather than keeping it. PR: https://github.com/rakanalh/django-pushy/pull/41 which contains some refactorings also applies this.