Skip to main content

Pusher Push Notifications Python server SDK

Project description

https://travis-ci.org/pusher/push-notifications-python.svg?branch=master

Pusher Push Notifications Python server SDK

Full documentation for this SDK can be found here

Installation

The Pusher Notifications 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 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 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pusher_push_notifications-0.10.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pusher_push_notifications-0.10.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pusher_push_notifications-0.10.0.tar.gz.

File metadata

File hashes

Hashes for pusher_push_notifications-0.10.0.tar.gz
Algorithm Hash digest
SHA256 e35b5e919596bdf651ead71fe158fcb1883080e1b8c21bc9b218f9f4e9e83aa3
MD5 0379fcf4a0a33bf7b55e545c5024def0
BLAKE2b-256 fbf47533edad5ce9864025afb85f8914a0137a16c755a0632de0a496883bf528

See more details on using hashes here.

File details

Details for the file pusher_push_notifications-0.10.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pusher_push_notifications-0.10.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0960ac1d9f8dfd017ee080ef974d9f8c575d73105124c8ff7ebe96cbdbbb2de9
MD5 87bb4923079e8ee0596126edd7a50c46
BLAKE2b-256 2635730e0bcc4c0e7071dc7698c31ae4d5422ffecd3b5f664a44a99bbe09a75b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page