Pusher Push Notifications Python server SDK
Project description
Pusher Push Notifications Python server SDK
===========================================
Full documentation for this SDK can be found `here <https://docs.pusher.com/push-notifications/reference/server-sdk-python>`_
Installation
------------
The Pusher Notifications Python server SDK is available on PyPi
`here <https://pypi.python.org/pypi/pusher_push_notifications/>`_.
You can install this SDK by using
`pip <https://pip.pypa.io/en/stable/installing/>`_:
.. code:: bash
$ 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 <https://dash.pusher.com>`_) to create a PushNotifications instance:
.. code:: python
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:
.. code:: python
response = pn_client.publish(interests=['hello'], publish_body={'apns': {'aps': {'alert': 'Hello!'}}})
print(response['publishId'])
===========================================
Full documentation for this SDK can be found `here <https://docs.pusher.com/push-notifications/reference/server-sdk-python>`_
Installation
------------
The Pusher Notifications Python server SDK is available on PyPi
`here <https://pypi.python.org/pypi/pusher_push_notifications/>`_.
You can install this SDK by using
`pip <https://pip.pypa.io/en/stable/installing/>`_:
.. code:: bash
$ 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 <https://dash.pusher.com>`_) to create a PushNotifications instance:
.. code:: python
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:
.. code:: python
response = pn_client.publish(interests=['hello'], publish_body={'apns': {'aps': {'alert': 'Hello!'}}})
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pusher_push_notifications-0.9.0.tar.gz.
File metadata
- Download URL: pusher_push_notifications-0.9.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a1de3ff7e8768d195524ad98511651a0f07972f5319fa761a3fd89995b55b4
|
|
| MD5 |
1ed1f60f04251aa6e72897b3eabb1d20
|
|
| BLAKE2b-256 |
33c85d20b9cdd144bac8800eaee4a00687d7b4e5368d295ec266ca10fe3cc879
|
File details
Details for the file pusher_push_notifications-0.9.0-py2.py3-none-any.whl.
File metadata
- Download URL: pusher_push_notifications-0.9.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aefcc8180c0df816b8ae1f7fa541698243763717fe23328ccb6fc9a160d75fe
|
|
| MD5 |
7b6f34d2149585b8fe153cc97c218e5e
|
|
| BLAKE2b-256 |
8b44d6ccfc1ffce9da3c2c5dddc36c8d000c0a9630aba14831452f13b3ebe7fc
|