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
b1878598
Commit
b1878598
authored
Jan 03, 2017
by
Helperhaps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android new feature
parent
161d274a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
example_notification.py
examples/push_examples/example_notification.py
+19
-0
payload.py
jpush/push/payload.py
+14
-1
No files found.
examples/push_examples/example_notification.py
0 → 100644
View file @
b1878598
import
jpush
as
jpush
from
conf
import
app_key
,
master_secret
# from pprint import pprint
_jpush
=
jpush
.
JPush
(
app_key
,
master_secret
)
_jpush
.
set_logging
(
"DEBUG"
)
push
=
_jpush
.
create_push
()
push
.
audience
=
jpush
.
all_
push
.
platform
=
jpush
.
all_
ios
=
jpush
.
ios
(
alert
=
"Hello, IOS JPush!"
,
badge
=
"+1"
,
sound
=
"a.caf"
,
extras
=
{
'k1'
:
'v1'
})
android
=
jpush
.
android
(
alert
=
"Hello, Android msg"
,
priority
=
1
,
style
=
1
,
big_text
=
'jjjjjjjjjj'
,
extras
=
{
'k1'
:
'v1'
})
push
.
notification
=
jpush
.
notification
(
alert
=
"Hello, JPush!"
,
android
=
android
,
ios
=
ios
)
# pprint (push.payload)
result
=
push
.
send
()
jpush/push/payload.py
View file @
b1878598
...
...
@@ -76,7 +76,8 @@ def ios(alert=None, badge=None, sound=None, content_available=False,
payload
[
'extras'
]
=
extras
return
payload
def
android
(
alert
,
title
=
None
,
builder_id
=
None
,
extras
=
None
):
def
android
(
alert
,
title
=
None
,
builder_id
=
None
,
extras
=
None
,
priority
=
None
,
category
=
None
,
style
=
None
,
big_text
=
None
,
inbox
=
None
,
big_pic_path
=
None
):
"""Android specific platform override payload.
:keyword alert: String alert text.If you set alert to a empty string,then the payload
...
...
@@ -95,6 +96,18 @@ def android(alert, title=None, builder_id=None, extras=None):
payload
[
'title'
]
=
title
if
builder_id
is
not
None
:
payload
[
'builder_id'
]
=
builder_id
if
priority
is
not
None
:
payload
[
'priority'
]
=
priority
if
category
is
not
None
:
payload
[
'category'
]
=
category
if
style
is
not
None
:
payload
[
'style'
]
=
style
if
big_text
is
not
None
:
payload
[
'big_text'
]
=
big_text
if
inbox
is
not
None
:
payload
[
'inbox'
]
=
inbox
if
big_pic_path
is
not
None
:
payload
[
'big_pic_path'
]
=
big_pic_path
if
extras
is
not
None
:
payload
[
'extras'
]
=
extras
return
payload
...
...
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