Python 使用PyAPNs的iOS推送通知

Python 使用PyAPNs的iOS推送通知,python,ios,push-notification,Python,Ios,Push Notification,我试图将推送通知从Python服务器发送到iOS应用程序,复制并粘贴Git中的示例代码 from apns import APNs, Payload apns = APNs(use_sandbox=True, cert_file='MyAppCert.pem', key_file='MyAppKey.pem') # Send a notification token_hex = MY_TOKEN_NUMBER payload = Payload(alert="Hello World!", s

我试图将推送通知从Python服务器发送到iOS应用程序,复制并粘贴Git中的示例代码

from apns import APNs, Payload

apns = APNs(use_sandbox=True, cert_file='MyAppCert.pem', key_file='MyAppKey.pem')

# Send a notification
token_hex = MY_TOKEN_NUMBER
payload = Payload(alert="Hello World!", sound="default", badge=1)
apns.gateway_server.send_notification(token_hex, payload)
从浏览器调用api时,出现以下错误:

SSLError: [Errno 336265218] _ssl.c:351: error:140B0002:SSLroutines:SSL_CTX_use_PrivateKey_file:system lib
我应该将MyAppCert.pem MyAppKey.pem存储在服务器上的何处? 除了将它们放在文件夹中,我还需要做其他事情吗? 我应该设置整个路径吗?