I am trying to send push notifications to iPhone via python as described here but I am getting the following error:
Traceback (most recent call last):
File
I ran into the same error message using PyAPNs. The example says to initiate it like this:
apns = APNs(use_sandbox=True, cert_file='cert.pem', key_file='key.pem')
Turns out the solution to my problem was to include the full system path for each .pem file:
cert_path = os.path.join(os.path.dirname(__file__), 'cert.pem')
key_path = os.path.join(os.path.dirname(__file__), 'key.pem')
apns = APNs(use_sandbox=True, cert_file=cert_path, key_file=key_path)