djacobs / PyAPNs

Python library for interacting with the Apple Push Notification service (APNs)
http://pypi.python.org/pypi/apns/
MIT License
1.22k stars 374 forks source link

GatewayConnection APNS connection closed #203

Closed lapinvert closed 5 years ago

lapinvert commented 6 years ago

I just noticed my notifications were not sent anymore.

It used to work well and I didn't change anything to the code, but all the sudden, nothing. I looked at the log and saw many rows of GatewayConnection APNS connection closed.

My code is :

    def response_listener(error_response):
        print("error : ",error_response['status'])

    apns = APNs(use_sandbox=False, cert_file="path/to/cert_file", enhanced=True)

    apns.gateway_server.register_response_listener(response_listener)

    payload = Payload(content_available=True)

    for user_device in user_devices:
        apns.gateway_server.send_notification(user_device.token, payload, identifier=user_device.id)

Do you have any suggestions ?

raphaelgodro commented 5 years ago

I have the exact same issue.