Skip to content

Commit e22f1d3

Browse files
author
Helperhaps
committed
update apis
1 parent da2ce84 commit e22f1d3

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

docs/push/push.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ notification(alert=None, ios=None, android=None, winphone=None)
171171
172172
##### ios payload
173173
```
174-
ios(alert=None, badge=None, sound=None, content_available=False,
175-
extras=None, sound_disable=False)
174+
ios(alert=None, badge='+1', sound=None, content_available=False, mutable_content=False, category=None, extras=None, sound_disable=False, thread_id=None):
176175
```
177176

178177
参数说明
@@ -190,14 +189,19 @@ ios(alert=None, badge=None, sound=None, content_available=False,
190189
<td>string</td>
191190
<td>必填</td>
192191
<td width="20%">通知内容</td>
193-
<td>这里指定了,将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持 emoji 表情。</td>
192+
<td>
193+
这里指定内容将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持字符串形式也支持官方定义的 alert payload 结构,在该结构中包含 title 和 subtitle 等官方支持的 key
194+
</td>
194195
</tr>
195196
<tr >
196197
<td>sound</td>
197198
<td>string</td>
198199
<td>可选</td>
199200
<td width="20%">通知提示声音</td>
200-
<td>如果无此字段,则此消息无声音提示;有此字段,如果找到了指定的声音就播放该声音,否则播放默认声音,如果此字段为空字符串,iOS 7 为默认声音,iOS 8 为无声音。(消息) 说明:JPush 官方 API Library (SDK) 会默认填充声音字段。提供另外的方法关闭声音。</td>
201+
<td>
202+
普通通知: string类型,如果无此字段,则此消息无声音提示;有此字段,如果找到了指定的声音就播放该声音,否则播放默认声音,如果此字段为空字符串,iOS 7 为默认声音,iOS 8 及以上系统为无声音。说明:JPush 官方 SDK 会默认填充声音字段,提供另外的方法关闭声音,详情查看各 SDK 的源码。
203+
告警通知: JSON Object ,支持官方定义的 payload 结构,在该结构中包含 critical 、name 和 volume 等官方支持的 key
204+
</td>
201205
</tr>
202206
<tr >
203207
<td>badge</td>
@@ -211,7 +215,14 @@ ios(alert=None, badge=None, sound=None, content_available=False,
211215
<td>boolean</td>
212216
<td>可选</td>
213217
<td width="20%">推送唤醒</td>
214-
<td>推送的时候携带"content-available":true 说明是 Background Remote Notification,如果不携带此字段则是普通的Remote Notification。详情参考:<a href="../../client/ios_tutorials/#ios-7-background-remote-notification">Background Remote Notification</a></td>
218+
<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>
219+
</tr>
220+
<tr >
221+
<td>mutable-content</td>
222+
<td>boolean</td>
223+
<td>可选</td>
224+
<td width="20%">通知扩展</td>
225+
<td>推送的时候携带 ”mutable-content":true 说明是支持iOS10的UNNotificationServiceExtension,如果不携带此字段则是普通的 Remote Notification。详情参考:<a href="../../client/IOS/ios_new_fetures/#ios-10-service-extension">UNNotificationServiceExtension</a></td>
215226
</tr>
216227
<tr >
217228
<td>category</td>
@@ -220,6 +231,13 @@ ios(alert=None, badge=None, sound=None, content_available=False,
220231
<td width="20%"> </td>
221232
<td>IOS8才支持。设置APNs payload中的"category"字段值</td>
222233
</tr>
234+
<tr >
235+
<td>thread-id</td>
236+
<td>string</td>
237+
<td>可选</td>
238+
<td width="20%">通知分组</td>
239+
<td>ios 的远程通知通过该属性来对通知进行分组,同一个 thread-id 的通知归为一组。</td>
240+
</tr>
223241
<tr >
224242
<td>extras</td>
225243
<td>JSON Object</td>
@@ -236,7 +254,7 @@ ios(alert=None, badge=None, sound=None, content_available=False,
236254
237255
##### android payload
238256
```
239-
android(alert, title=None, builder_id=None, extras=None)
257+
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)
240258
```
241259
参数说明
242260
<div class="table-d" align="center" >

jpush/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
schedulepayload,
7676
]
7777

78-
__version__ = '3.3.4'
78+
__version__ = '3.3.5'
7979
VERSION = tuple(map(int, __version__.split('.')))
8080

8181
# Silence urllib3 INFO logging by default

jpush/push/payload.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def notification(alert=None, ios=None, android=None, winphone=None):
3737

3838

3939
def ios(alert=None, badge='+1', sound=None, content_available=False,
40-
mutable_content=False, category=None, extras=None, sound_disable=False):
40+
mutable_content=False, category=None, extras=None, sound_disable=False, thread_id=None):
4141
"""iOS/APNS specific platform override payload.
4242
4343
: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,
7676
payload['mutable-content'] = 1
7777
if category:
7878
payload['category'] = category
79+
if thread_id:
80+
payload['thread-id'] = thread_id
7981
if extras is not None:
8082
payload['extras'] = extras
8183
return payload
8284

8385
def android(alert, title=None, builder_id=None, extras=None,
84-
priority=None, category=None, style=None, alert_type=None,big_text=None, inbox=None, big_pic_path=None):
86+
priority=None, category=None, style=None, alert_type=None,
87+
big_text=None, inbox=None, big_pic_path=None, large_icon=None, intent=None):
8588
"""Android specific platform override payload.
8689
8790
: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,
114117
payload['inbox'] = inbox
115118
if big_pic_path is not None:
116119
payload['big_pic_path'] = big_pic_path
120+
if large_icon is not None:
121+
payload['large_icon'] = large_icon
122+
if intent is not None:
123+
payload['intent'] = intent
117124
if extras is not None:
118125
payload['extras'] = extras
119126
return payload

0 commit comments

Comments
 (0)