Skip to content

Commit

Permalink
Merge 19720fc into d855458
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-fox committed Mar 22, 2019
2 parents d855458 + 19720fc commit ceaa241
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 7 deletions.
49 changes: 47 additions & 2 deletions README.rst
Expand Up @@ -30,8 +30,8 @@ Install using pip:
Whether using ``APNS`` or ``GCM``, pushjack provides clients for each.


APNS
----
APNS (using certificates)
-------------------------

Send notifications using the ``APNSClient`` class:

Expand Down Expand Up @@ -123,6 +123,51 @@ For the APNS sandbox, use ``APNSSandboxClient`` instead:
from pushjack import APNSSandboxClient
APNS (using Auth tokens)
------------------------

Send notifications using the ``APNSTokenBasedClient`` class:


.. code-block:: python
from pushjack import APNSTokenBasedClient
key = "my_key"
token = apns.APNSAuthToken(
token=key,
team_id="my_team_id",
key_id="my_key_id",
)
client = apns.APNSTokenBasedSandboxClient(
token=token,
bundle_id='my_bundle_id',
)
response = client.send_message(
device_id="my_device_id",
message="message",
content_available=True,
title="title"
)
Close APNS connection.

.. code-block:: python
client.conn.close()
For the APNS sandbox, use ``APNSTokenBasedSandboxClient`` instead:


.. code-block:: python
from pushjack import APNSTokenBasedSandboxClient
GCM
---
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Expand Up @@ -36,6 +36,7 @@ dev =
coverage
flake8
httmock
hyper
invoke
mock
pylint
Expand All @@ -45,6 +46,7 @@ dev =
sphinx-rtd-theme
tox
twine
PyJWT
wheel


Expand Down

0 comments on commit ceaa241

Please sign in to comment.