resq/utils/test_apns/test_apns.py

13 lines
528 B
Python

from apns import APNs, Frame, Payload
#apns = APNs(use_sandbox=True, cert_file='/root/ios_push_test/motoliteUserDev.pem')
apns = APNs(cert_file='/root/ios_push_test/motoliteUserProd.pem')
alert = {"title" : "Motolite Res-q Notification",
"body" : "Test Notification",
"type" : "register"}
token_hex = "0D89F702B8E5A235E5100C47912DCBC346CE503DBB860572402031595D6F4C6C"
payload = Payload(alert=alert, sound="default", badge=1, content_available=True)
apns.gateway_server.send_notification(token_hex, payload)