There you go, simple, and no need to download a specific library if you just need to post a simple message. PushMessage("Test message", "Hi this is your Pi, sending you a notification. Resp = requests.post('',data=data, auth=(API_KEY,'')) # Send a message to all your registered devices. #!/usr/bin/env pythonĪPI_KEY = 'randomdigitsfromyourpushbulletaccountpage' remember to change the text next to API_KEY with your own key from the website. There are a few websites that offer a push service, I just picked PushBullet as it's free, although you need to register using either Facebook or a Google account - not sure why but you may want to find another service if this isn't agreeable.Īfter downloading the app to my iPhone and signing up on their website, I grabbed my API key from the user page, then wrote this small script in python. I saw some posts about sending push notifications from the Pi recently and wanted to give it a go as it sounded useful for a few of my projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |