Skip to content

Commit

Permalink
Add examples of using APNS and GCM modules directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilland committed Mar 28, 2015
1 parent c61b7ce commit b1131a6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Whether using ``APNS`` or ``GCM``, pushjack provides a common API interface for
APNS
----

Using the ``APNSClient`` class:


.. code-block:: python
from pushjack import APNSClient, create_apns_config
Expand Down Expand Up @@ -62,9 +65,24 @@ APNS
expired = client.get_expired_tokens()
Using the APNS module directly:


.. code-block:: python
from pushjack import apns
# Call signature is the same as APNSClient.
apns.send(token, alert, **options)
apns.send_bulk(token, alert, **options)
GCM
---

Using the ``GCMClient`` class:


.. code-block:: python
from pushjack import GCMClient, create_gcm_config
Expand All @@ -91,6 +109,18 @@ GCM
client.send_bulk(tokens, data, **options)
Using the GCM module directly:


.. code-block:: python
from pushjack import gcm
# Call signature is the same as GCMClient.
gcm.send(token, alert, **options)
gcm.send_bulk(token, alert, **options)
Config
------

Expand Down

0 comments on commit b1131a6

Please sign in to comment.