I successfully managed to send push notifications from command line using the Send a Push Notification Using a Certificate example, which uses both the certificate.cer and the key.key to establish the connection with the APNs server.
I wish to run a python script to automate push notifications and wanted to use PyAPNs2 module for that. However, I cannot figure out how to provide the certificate the the key when creating the APNsClient() instance. Using either file as provided in the README.md example does not work:
client = APNsClient('key.pem', use_sandbox=False, use_alternative_port=False)
I also looked into merging the two files into one, but the approach described here throws an error during merging: "unable to load certificates". I am not sure that's the path I should take.
Any suggestions? Alternatively, can someone suggest a good python based API for sending push notifications to the APNs?