Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
jpush-api-python-client
Commits
b6f258b6
Commit
b6f258b6
authored
Jun 03, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sample code and docs;
parent
3cc87909
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
5 deletions
+16
-5
examples.rst
docs/examples.rst
+4
-4
conf.py
examples/conf.py
+2
-0
examples.py
examples/examples.py
+9
-0
common.py
jpush/common.py
+1
-1
No files found.
example
s/examples.rst
→
doc
s/examples.rst
View file @
b6f258b6
...
...
@@ -6,14 +6,14 @@ Common setup:
.. code-block:: python
import jpush as jpush
jpush = jpush.JPush(app_key, master_secret)
_
jpush = jpush.JPush(app_key, master_secret)
Simple broadcast to all devices
-------------------------------
.. code-block:: python
push = jpush.create_push()
push =
_
jpush.create_push()
push.audience = jpush.all_
push.notification = jpush.notification(alert="Hello, world!")
push.platform = jpush.all_
...
...
@@ -25,7 +25,7 @@ Complex audience with iOS & Android specifics
.. code-block:: python
push = jpush.create_push()
push =
_
jpush.create_push()
push.audience = jpush.audience(
jpush.tag("breakingnews"),
jpush.tag_and("sports"),
...
...
@@ -51,7 +51,7 @@ Single iOS push
.. code-block:: python
push = jpush.create_push()
push =
_
jpush.create_push()
push.audience = jpush.registration_id('fffffffffff')
push.notification = jpush.notification(
ios=jpush.ios(alert="JPush powers your apps"))
...
...
examples/conf.py
0 → 100644
View file @
b6f258b6
app_key
=
u'dd1066407b044738b6479275'
master_secret
=
u'2b38ce69b1de2a7fa95706ea'
examples/examples.py
0 → 100644
View file @
b6f258b6
import
jpush
as
jpush
from
conf
import
app_key
,
master_secret
_jpush
=
jpush
.
JPush
(
app_key
,
master_secret
)
push
=
_jpush
.
create_push
()
push
.
audience
=
jpush
.
all_
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello, world!"
)
push
.
platform
=
jpush
.
all_
push
.
send
()
jpush/common.py
View file @
b6f258b6
...
...
@@ -2,7 +2,7 @@ import json
import
logging
BASE_URL
=
"https://api.jpush.cn
:15088
/"
BASE_URL
=
"https://api.jpush.cn/"
PUSH_URL
=
BASE_URL
+
'v3/push/'
logger
=
logging
.
getLogger
(
'jpush'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment