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.9.2.tar.gz (3.6 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pusher_push_notifications-0.9.2.tar.gz
Algorithm Hash digest
SHA256 f2cac50b5d57d670e020c472729ea70d0c01b8abf0c5093c20edb3b6d8c98667
MD5 6bdd70c5a85ed19d57e92d732237d0d0
BLAKE2b-256 f3c9fa82535fb6fe427afc3fcbe31368cd19c6c27cd837bf088a7e96e99ff35b

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