Skip to main content

Pusher Push Notifications Python server SDK

Project description

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

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


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.2.tar.gz (3.8 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.2-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for pusher_push_notifications-0.10.2.tar.gz
Algorithm Hash digest
SHA256 36f3731b949f51b18edf4a2814021d35ba9ee6791673c4d37e85d0bde042cdc1
MD5 a447a8cf8eb9ebfbeba74e3e7d80bde1
BLAKE2b-256 d381ce4e48c4dcc486798a8f944dc4ead671a5b5c6abcb5ef651b03434a881a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pusher_push_notifications-0.10.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8798b09d15ed4b752c9ff3940350665ef100373d4fafdea5efb6cd515d07e99b
MD5 c951378edf79df75141fe2295b5af5ba
BLAKE2b-256 e7e24c2a886105334c2f9f85fd729dca8c8ad005a7c54a1add3c0d88de31ef69

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