python

Send Push Notifications from python to your Browser, Android, iOS and/or Windows 10 device.

python-pushsafer aims at providing comprehensive Python bindings for the API of the Pushsafer Notification Service.

Usage

Install

Install python-pushsafer directly from Pypi:

$ pip install python-pushsafer

or install it from GitHub:

git clone https://github.com/appzer/python-pushsafer.git
cd python-pushsafer
pip install .

Overview

After being imported, the module must be initialized by calling the init function with a valid private key. Thus, a typical use of the Pushsafer module looks like this:

from pushsafer import init, Client

init("<privatekey>")
Client("").send_message("Message", "Hello", "323", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "", "", "")

You can also pass the privatekey optional argument to Client to initialize the module at the same time:

from pushsafer import Client

client = Client("", privatekey="<privatekey>")
client.send_message("Message", "Hello", "323", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "", "", "")

Params

client.send_message("Message", "Title", "Device or Device Group ID", "Icon", "Sound", "Vibration", "URL", "URL Title", "Time2Live", "Image 1", "Image 2", "Image 3")

For more information about replacing values (title, message, icon, sound, vibration) in your push notification, check out our API description!


Copyright © Pushsafer.com, All rights reserved.