Send iOS Push Notifications from Google App Engine python

2 views
Skip to first unread message

Lior Z via StackOverflow

unread,
Apr 11, 2014, 9:23:26 PM4/11/14
to google-appengin...@googlegroups.com

I have been looking everywhere for example code on how to do this from a python written server over GAE - but with no luck.

Can someone please help me with the function to do this? (It should be pretty straight forward I believe).



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/23024801/send-ios-push-notifications-from-google-app-engine-python

user1593145 via StackOverflow

unread,
Apr 13, 2014, 8:59:07 AM4/13/14
to google-appengin...@googlegroups.com

I use this library, and it works well in my app.
https://github.com/simonwhitaker/PyAPNs

code is like below, token_hex == a push notification token sent from a device. And you have to some variables.

from apns import APNs, Payload
apns = APNs(use_sandbox=use_sandbox, 
        cert_file=path/to/cert.pem',
        key_file=path/to/key-noenc.pem')
payload = Payload(alert='hello', sound="default", badge=1,custom={})
apns.gateway_server.send_notification(token_hex, payload)
for (token_hex, fail_time) in apns.feedback_server.items():
    logging.info(token_hex) 
    logging.info(fail_time)


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/23024801/send-ios-push-notifications-from-google-app-engine-python/23042999#23042999

user1593145 via StackOverflow

unread,
Apr 16, 2014, 6:58:44 PM4/16/14
to google-appengin...@googlegroups.com

I use this library, and it works well in my app.
https://github.com/simonwhitaker/PyAPNs

enable ssl in app.yaml

libraries:
- name: ssl
  version: latest
Reply all
Reply to author
Forward
0 new messages