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
e22f1d33
Commit
e22f1d33
authored
Dec 20, 2018
by
Helperhaps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update apis
parent
da2ce84d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
push.md
docs/push/push.md
+24
-6
__init__.py
jpush/__init__.py
+1
-1
payload.py
jpush/push/payload.py
+9
-2
No files found.
docs/push/push.md
View file @
e22f1d33
...
...
@@ -171,8 +171,7 @@ notification(alert=None, ios=None, android=None, winphone=None)
##### ios payload
```
ios(alert=None, badge=None, sound=None, content_available=False,
extras=None, sound_disable=False)
ios(alert=None, badge='+1', sound=None, content_available=False, mutable_content=False, category=None, extras=None, sound_disable=False, thread_id=None):
```
参数说明
...
...
@@ -190,14 +189,19 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td>
string
</td>
<td>
必填
</td>
<td
width=
"20%"
>
通知内容
</td>
<td>
这里指定了,将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持 emoji 表情。
</td>
<td>
这里指定内容将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持字符串形式也支持官方定义的 alert payload 结构,在该结构中包含 title 和 subtitle 等官方支持的 key
</td>
</tr>
<tr
>
<td>
sound
</td>
<td>
string
</td>
<td>
可选
</td>
<td
width=
"20%"
>
通知提示声音
</td>
<td>
如果无此字段,则此消息无声音提示;有此字段,如果找到了指定的声音就播放该声音,否则播放默认声音,如果此字段为空字符串,iOS 7 为默认声音,iOS 8 为无声音。(消息) 说明:JPush 官方 API Library (SDK) 会默认填充声音字段。提供另外的方法关闭声音。
</td>
<td>
普通通知: string类型,如果无此字段,则此消息无声音提示;有此字段,如果找到了指定的声音就播放该声音,否则播放默认声音,如果此字段为空字符串,iOS 7 为默认声音,iOS 8 及以上系统为无声音。说明:JPush 官方 SDK 会默认填充声音字段,提供另外的方法关闭声音,详情查看各 SDK 的源码。
告警通知: JSON Object ,支持官方定义的 payload 结构,在该结构中包含 critical 、name 和 volume 等官方支持的 key
</td>
</tr>
<tr
>
<td>
badge
</td>
...
...
@@ -211,7 +215,14 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td>
boolean
</td>
<td>
可选
</td>
<td
width=
"20%"
>
推送唤醒
</td>
<td>
推送的时候携带"content-available":true 说明是 Background Remote Notification,如果不携带此字段则是普通的Remote Notification。详情参考:
<a
href=
"../../client/ios_tutorials/#ios-7-background-remote-notification"
>
Background Remote Notification
</a></td>
<td>
推送的时候携带"content-available":true 说明是 Background Remote Notification,如果不携带此字段则是普通的Remote Notification。详情参考:
<a
href=
"../../client/iOS/ios_new_fetures/#ios-7-background-remote-notification"
>
Background Remote Notification
</a></td>
</tr>
<tr
>
<td>
mutable-content
</td>
<td>
boolean
</td>
<td>
可选
</td>
<td
width=
"20%"
>
通知扩展
</td>
<td>
推送的时候携带 ”mutable-content":true 说明是支持iOS10的UNNotificationServiceExtension,如果不携带此字段则是普通的 Remote Notification。详情参考:
<a
href=
"../../client/IOS/ios_new_fetures/#ios-10-service-extension"
>
UNNotificationServiceExtension
</a></td>
</tr>
<tr
>
<td>
category
</td>
...
...
@@ -220,6 +231,13 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td
width=
"20%"
>
</td>
<td>
IOS8才支持。设置APNs payload中的"category"字段值
</td>
</tr>
<tr
>
<td>
thread-id
</td>
<td>
string
</td>
<td>
可选
</td>
<td
width=
"20%"
>
通知分组
</td>
<td>
ios 的远程通知通过该属性来对通知进行分组,同一个 thread-id 的通知归为一组。
</td>
</tr>
<tr
>
<td>
extras
</td>
<td>
JSON Object
</td>
...
...
@@ -236,7 +254,7 @@ ios(alert=None, badge=None, sound=None, content_available=False,
##### android payload
```
android(alert, title=None, builder_id=None, extras=None)
android(alert, title=None, builder_id=None, extras=None
, priority=None, category=None, style=None, alert_type=None, big_text=None, inbox=None, big_pic_path=None, large_icon=None, intent=None
)
```
参数说明
<div
class=
"table-d"
align=
"center"
>
...
...
jpush/__init__.py
View file @
e22f1d33
...
...
@@ -75,7 +75,7 @@ __all__ = [
schedulepayload
,
]
__version__
=
'3.3.
4
'
__version__
=
'3.3.
5
'
VERSION
=
tuple
(
map
(
int
,
__version__
.
split
(
'.'
)))
# Silence urllib3 INFO logging by default
...
...
jpush/push/payload.py
View file @
e22f1d33
...
...
@@ -37,7 +37,7 @@ def notification(alert=None, ios=None, android=None, winphone=None):
def
ios
(
alert
=
None
,
badge
=
'+1'
,
sound
=
None
,
content_available
=
False
,
mutable_content
=
False
,
category
=
None
,
extras
=
None
,
sound_disable
=
False
):
mutable_content
=
False
,
category
=
None
,
extras
=
None
,
sound_disable
=
False
,
thread_id
=
None
):
"""iOS/APNS specific platform override payload.
:keyword alert: iOS format alert, as either a string or dictionary.
...
...
@@ -76,12 +76,15 @@ def ios(alert=None, badge='+1', sound=None, content_available=False,
payload
[
'mutable-content'
]
=
1
if
category
:
payload
[
'category'
]
=
category
if
thread_id
:
payload
[
'thread-id'
]
=
thread_id
if
extras
is
not
None
:
payload
[
'extras'
]
=
extras
return
payload
def
android
(
alert
,
title
=
None
,
builder_id
=
None
,
extras
=
None
,
priority
=
None
,
category
=
None
,
style
=
None
,
alert_type
=
None
,
big_text
=
None
,
inbox
=
None
,
big_pic_path
=
None
):
priority
=
None
,
category
=
None
,
style
=
None
,
alert_type
=
None
,
big_text
=
None
,
inbox
=
None
,
big_pic_path
=
None
,
large_icon
=
None
,
intent
=
None
):
"""Android specific platform override payload.
:keyword alert: String alert text.If you set alert to a empty string,then the payload
...
...
@@ -114,6 +117,10 @@ def android(alert, title=None, builder_id=None, extras=None,
payload
[
'inbox'
]
=
inbox
if
big_pic_path
is
not
None
:
payload
[
'big_pic_path'
]
=
big_pic_path
if
large_icon
is
not
None
:
payload
[
'large_icon'
]
=
large_icon
if
intent
is
not
None
:
payload
[
'intent'
]
=
intent
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