This is a simple python library that can send notification to Android Phone using Google Cloud Messaging (GCM).
It supports both Python 2.5+ and Python 3.4+
Get Sender ID and API Key
Follow the wizard here
- Click 'Choose and Configure Services'.
- Click to enable 'Cloud Messaging'
- Add Server Key to ~/.pushNotificatio or /etc/pushNotifications after installing the library.
- Put Sender ID in the Android applicatuion
Usage:
-
Download and install pushNotification library
sudo python setup.py install
OR
sudo pip install future simplejson pushNotification
-
Download and install the Android APK to your phone.
-
Open Application and enter topics to listen on (seprated by ,) e.g warning,mkalioby.
-
in your python code, write
import pushNotification
pushNotification.push(MESSAGE,TOPIC,CUSTOM_API_KEY="")
The return is a JSON String.
Finally, check your phone.
Next Features:
- iOS support.