cert.pem和key.pem的用途是什么? 我们如何为safari推送通知创建这些文件? OR 我们可以在safari桌面上发送通知吗?
import time
from apns import APNs, Frame, Payload
apns = APNs(use_sandbox=True, cert_file='cert.pem',key_file='key.pem')
token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87'
payload = Payload(alert="Hello World!", sound="default", badge=1)
apns.gateway_server.send_notification(token_hex, payload)
答案 0 :(得分:0)
我做到了。
payload = Payload(alert={
"title": "",
"body": "",
}, sound="default", badge=1,url_arg={"name":"https://www.epush.in",},)