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-1.0.3.tar.gz (3.9 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-1.0.3-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pusher_push_notifications-1.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for pusher_push_notifications-1.0.3.tar.gz
Algorithm Hash digest
SHA256 97f76af40a0701ff15c8e5b127149e356b9eef4ca145b00a859eba1001051310
MD5 4263f06d8fe2447053bc1514a5740d34
BLAKE2b-256 5c2127152e5a0ab4faa71a35f2b97fa63d7182cd8967bd2e64a48501947408c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pusher_push_notifications-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for pusher_push_notifications-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 79fda72ee48b7cc8752686353d35763fc072e97f6b608e4b27dca6825dfea02d
MD5 63640ba50f5add861bc9196b457b7b41
BLAKE2b-256 a87a638ec727f8375dc5382996aa2f5c513274f0225260f4a15594ecf0dba122

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