开发者

how to write in stdout after to call a method (doing a system of notifications automatic (Iphone))

开发者 https://www.devze.com 2023-02-03 20:26 出处:网络
I\'m trying to do a system of notifications automatic (Iphone) using https://github.com/simonwhitaker/PyAPNs. When you want to send a notification you call \"apns.gateway_server.send_notification(key,

I'm trying to do a system of notifications automatic (Iphone) using https://github.com/simonwhitaker/PyAPNs. When you want to send a notification you call "apns.gateway_server.send_notification(key, payload)" and you have to enter the PEM pass phrase. Is there a way to enter this phrase through code?

Something like: call(apns.gateway_server.send_notification(key, payload), sys.stdout.wri开发者_运维知识库te("my phars"))

I don't know how to do it


import apns

gate = apns.APNs('keyfile','certfile').gateway_server()
gate.send_notification(key,payload)

Is there a problem when you run this?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号