python iphone push script
Apple Push Notificationsサンプルpythonスクリプト
Apple Push Notificationsサンプルpythonスクリプト

[root@oflex-338-1 pushpython]# vi push_apns_test.py

# coding: utf-8

import time
from apns import APNs, Frame, Payload

#apns = APNs(use_sandbox=False, cert_file='distribution.pem', key_file='pushkey_pushtest.pem', enhanced=True)
apns = APNs(use_sandbox=True, cert_file='pushCerDev_pushtest.pem', key_file='pushkey_pushtest.pem', enhanced=True)

token_hex = '0f6e6bc26c939a40d1743e7a2fb2c8d10437c9207b8ec09dc5e7925ebedc95a1'

message = "メッセージ!!"
message = message.decode('utf-8')

content = "おはようだよ"
content = content.decode('utf-8')

payload = Payload(alert=content, sound="default", badge=1)
apns.gateway_server.send_notification(token_hex, payload)

????