Skip to content

Commit 93c40e5

Browse files
committed
Added Chrome Support
1 parent c8ccb8f commit 93c40e5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The data can be any serial content (string, bit array, serialized
3636
JSON, etc), but be sure that your receiving application is able to
3737
parse and understand it. (e.g. `data = "Mary had a little lamb."`)
3838

39-
gcm_key is the API key obtained from the Google Developer Console.
39+
gcm_key is the API key obtained from the Google Developer Console.
4040
It is only needed if endpoint is https://android.googleapis.com/gcm/send
4141

4242
`headers` is a `dict`ionary of additional HTTP header values (e.g.
@@ -50,7 +50,6 @@ WebPusher(subscription_info).send(data, headers)
5050
to send for Chrome:
5151
```
5252
WebPusher(subscription_info).send(data, headers, ttl, gcm_key)
53-
```
5453
5554
You can also simply encode the data to send later by calling
5655

pywebpush/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import base64
66
import os
7-
87
import json
8+
99
import http_ece
1010
import pyelliptic
1111
import requests
@@ -156,14 +156,14 @@ def send(self, data, headers={}, ttl=0, gcm_key=None, reg_id=None):
156156
"""Encode and send the data to the Push Service.
157157
158158
:param data: A serialized block of data (see encode() ).
159-
:param gcm_key: API key obtained from the Google Developer Console.
160-
Needed if endpoint is https://android.googleapis.com/gcm/send
161-
:param reg_id: registration id of the recipient. If not provided,
162-
it will be extracted from the endpoint.
163159
:param headers: A dictionary containing any additional HTTP headers.
164160
:param ttl: The Time To Live in seconds for this message if the
165161
recipient is not online. (Defaults to "0", which discards the
166162
message immediately if the recipient is unavailable.)
163+
:param gcm_key: API key obtained from the Google Developer Console.
164+
Needed if endpoint is https://android.googleapis.com/gcm/send
165+
:param reg_id: registration id of the recipient. If not provided,
166+
it will be extracted from the endpoint.
167167
168168
"""
169169
# Encode the data.

0 commit comments

Comments
 (0)