Metadata-Version: 2.0
Name: pusher-push-notifications
Version: 0.9.0
Summary: Pusher Push Notifications Python server SDK
Home-page: UNKNOWN
Author: Pusher
Author-email: support@pusher.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Requires-Dist: requests (==2.18.4)
Requires-Dist: six (==1.10.0)

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'])


