Skip to content

Commit

Permalink
Merge 1361b11 into d855458
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-fox committed Mar 28, 2019
2 parents d855458 + 1361b11 commit 06d87a5
Show file tree
Hide file tree
Showing 6 changed files with 465 additions and 10 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 ``APNSHTTP2Client`` class:


.. code-block:: python
from pushjack import APNSHTTP2Client
key = "my_key"
token = apns.APNSAuthToken(
token=key,
team_id="my_team_id",
key_id="my_key_id",
)
client = apns.APNSHTTP2Client(
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 ``APNSHTTP2SandboxClient`` instead:


.. code-block:: python
from pushjack import APNSHTTP2SandboxClient
GCM
---
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Expand Up @@ -30,6 +30,8 @@ classifiers =
[options]
install_requires =
requests
PyJWT
hyper

[options.extras_require]
dev =
Expand Down
2 changes: 2 additions & 0 deletions src/pushjack/__init__.py
Expand Up @@ -9,6 +9,8 @@
APNSSandboxClient,
APNSResponse,
APNSExpiredToken,
APNSHTTP2Client,
APNSHTTP2SandboxClient,
)

from .gcm import (
Expand Down

0 comments on commit 06d87a5

Please sign in to comment.