django - Sending iOS push notifications with python and PyAPNS -
i trying figure out how send push notifications python/django app. found code online works when run terminal prompts me enter in pem passphrase manually , don't know how set works on it's own.
from apns import apns, payload apns = apns(use_sandbox=true, cert_file='/users/user/desktop/lunch-boxcert.pem',key_file='/users/user/desktop/lunch-boxkey.pem') token = '923...8b4' # send notification payload = payload(alert="hello world!", sound="default", badge=1) apns.gateway_server.send_notification(token, payload)
when run calling python manage.py runserver blocks until type passphrase terminal. anyway know how solve this?
i ended removing passkeys.
openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
i kind of followed tutorial here:
https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/
Comments
Post a Comment