Pusher Push Notifications Python server SDK
Project description
Pusher Beams Python server SDK
Full documentation for this SDK can be found here
Installation
The Pusher Beams Python server SDK is available on PyPi here.
You can install this SDK by using pip:
$ pip install pusher_push_notifications
Usage
Configuring the SDK for Your Instance
Use your instance id and secret (you can get these from the dashboard) to create a Beams PushNotifications instance:
from pusher_push_notifications import PushNotifications
pn_client = PushNotifications(
instance_id='YOUR_INSTANCE_ID_HERE',
secret_key='YOUR_SECRET_KEY_HERE',
)
Publishing a Notification
Once you have created your Beams PushNotifications instance you can publish a push notification to your registered & subscribed devices:
response = pn_client.publish(
interests=['hello'],
publish_body={'apns': {'aps': {'alert': 'Hello!'}}, 'fcm': {'notification': {'title': 'Hello', 'body': 'Hello, World!'}}}
)
print(response['publishId'])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pusher_push_notifications-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bb78e042b2a9db2735881ea91eb498aa539aca6b989989d0765abfaea3358d3 |
|
MD5 | 8758fae219cffc958c4c6f7c9b4aabed |
|
BLAKE2b-256 | e4ccdbf80c6a8b81c33e9b913fda0fe16b0a47bfa732f6930f7853039e99a9f7 |
Close
Hashes for pusher_push_notifications-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f69cf31efc5fd026750028cfcf67c79d1bc2980a79f8f36137a1c8b90d09a79 |
|
MD5 | dfbd3a986421b54d82589e756b848acd |
|
BLAKE2b-256 | 5f92adbc25a89736ffe6522fd18b1f456903298e10b014e8f580d4ad5f08348d |