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
de94b5d3
Commit
de94b5d3
authored
Jun 20, 2014
by
hupantingxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify sample document;
parent
5c8f3765
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
examples.rst
docs/examples.rst
+3
-3
payload.py
jpush/push/payload.py
+3
-4
No files found.
docs/examples.rst
View file @
de94b5d3
...
@@ -34,12 +34,12 @@ Complex audience with iOS & Android specifics
...
@@ -34,12 +34,12 @@ Complex audience with iOS & Android specifics
push.notification = jpush.notification(
push.notification = jpush.notification(
ios=jpush.ios(
ios=jpush.ios(
alert="JPush ios test",
alert="JPush ios test",
badge="
+
1",
badge="1",
extra={"articleid": "123456"}
extra
s
={"articleid": "123456"}
),
),
android=jpush.android(
android=jpush.android(
alert="Breaking Special Android News!",
alert="Breaking Special Android News!",
extra={"articleid": "http://m.example.com/123456"}
extra
s
={"articleid": "http://m.example.com/123456"}
)
)
)
)
push.platform = jpush.platform('ios', 'android')
push.platform = jpush.platform('ios', 'android')
...
...
jpush/push/payload.py
View file @
de94b5d3
...
@@ -60,7 +60,7 @@ def ios(alert=None, badge=None, sound=None, content_available=False,
...
@@ -60,7 +60,7 @@ def ios(alert=None, badge=None, sound=None, content_available=False,
payload
[
'sound'
]
=
'default'
payload
[
'sound'
]
=
'default'
if
content_available
:
if
content_available
:
payload
[
'content-available'
]
=
1
payload
[
'content-available'
]
=
1
if
extra
is
not
None
:
if
extra
s
is
not
None
:
payload
[
'extras'
]
=
extras
payload
[
'extras'
]
=
extras
return
payload
return
payload
...
@@ -73,9 +73,8 @@ def android(alert, title=None, builder_id=None, extras=None):
...
@@ -73,9 +73,8 @@ def android(alert, title=None, builder_id=None, extras=None):
:keyword alert: String alert text.
:keyword alert: String alert text.
:keyword title: String
:keyword title: String
:keyword builder_id: Integer
:keyword builder_id: Integer
:keyword delay_while_idle: Boolean
:keyword extras: A set of key/value pairs to include in the push payload
:keyword extra: A set of key/value pairs to include in the push payload
sent to the device.
sent to the device. All values must be strings.
"""
"""
payload
=
{}
payload
=
{}
if
alert
is
not
None
:
if
alert
is
not
None
:
...
...
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