Commit e22f1d33 authored by Helperhaps's avatar Helperhaps

update apis

parent da2ce84d
...@@ -171,8 +171,7 @@ notification(alert=None, ios=None, android=None, winphone=None) ...@@ -171,8 +171,7 @@ notification(alert=None, ios=None, android=None, winphone=None)
##### ios payload ##### ios payload
``` ```
ios(alert=None, badge=None, sound=None, content_available=False, ios(alert=None, badge='+1', sound=None, content_available=False, mutable_content=False, category=None, extras=None, sound_disable=False, thread_id=None):
extras=None, sound_disable=False)
``` ```
参数说明 参数说明
...@@ -190,14 +189,19 @@ ios(alert=None, badge=None, sound=None, content_available=False, ...@@ -190,14 +189,19 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td>string</td> <td>string</td>
<td>必填</td> <td>必填</td>
<td width="20%">通知内容</td> <td width="20%">通知内容</td>
<td>这里指定了,将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持 emoji 表情。</td> <td>
这里指定内容将会覆盖上级统一指定的 alert 信息;内容为空则不展示到通知栏。支持字符串形式也支持官方定义的 alert payload 结构,在该结构中包含 title 和 subtitle 等官方支持的 key
</td>
</tr> </tr>
<tr > <tr >
<td>sound</td> <td>sound</td>
<td>string</td> <td>string</td>
<td>可选</td> <td>可选</td>
<td width="20%">通知提示声音</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>
<tr > <tr >
<td>badge</td> <td>badge</td>
...@@ -211,7 +215,14 @@ ios(alert=None, badge=None, sound=None, content_available=False, ...@@ -211,7 +215,14 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td>boolean</td> <td>boolean</td>
<td>可选</td> <td>可选</td>
<td width="20%">推送唤醒</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>
<tr > <tr >
<td>category</td> <td>category</td>
...@@ -220,6 +231,13 @@ ios(alert=None, badge=None, sound=None, content_available=False, ...@@ -220,6 +231,13 @@ ios(alert=None, badge=None, sound=None, content_available=False,
<td width="20%"> </td> <td width="20%"> </td>
<td>IOS8才支持。设置APNs payload中的"category"字段值</td> <td>IOS8才支持。设置APNs payload中的"category"字段值</td>
</tr> </tr>
<tr >
<td>thread-id</td>
<td>string</td>
<td>可选</td>
<td width="20%">通知分组</td>
<td>ios 的远程通知通过该属性来对通知进行分组,同一个 thread-id 的通知归为一组。</td>
</tr>
<tr > <tr >
<td>extras</td> <td>extras</td>
<td>JSON Object</td> <td>JSON Object</td>
...@@ -236,7 +254,7 @@ ios(alert=None, badge=None, sound=None, content_available=False, ...@@ -236,7 +254,7 @@ ios(alert=None, badge=None, sound=None, content_available=False,
##### android payload ##### 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" > <div class="table-d" align="center" >
......
...@@ -75,7 +75,7 @@ __all__ = [ ...@@ -75,7 +75,7 @@ __all__ = [
schedulepayload, schedulepayload,
] ]
__version__ = '3.3.4' __version__ = '3.3.5'
VERSION = tuple(map(int, __version__.split('.'))) VERSION = tuple(map(int, __version__.split('.')))
# Silence urllib3 INFO logging by default # Silence urllib3 INFO logging by default
......
...@@ -37,7 +37,7 @@ def notification(alert=None, ios=None, android=None, winphone=None): ...@@ -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, 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. """iOS/APNS specific platform override payload.
:keyword alert: iOS format alert, as either a string or dictionary. :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, ...@@ -76,12 +76,15 @@ def ios(alert=None, badge='+1', sound=None, content_available=False,
payload['mutable-content'] = 1 payload['mutable-content'] = 1
if category: if category:
payload['category'] = category payload['category'] = category
if thread_id:
payload['thread-id'] = thread_id
if extras is not None: if extras is not None:
payload['extras'] = extras payload['extras'] = extras
return payload 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, 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. """Android specific platform override payload.
:keyword alert: String alert text.If you set alert to a empty string,then the 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, ...@@ -114,6 +117,10 @@ def android(alert, title=None, builder_id=None, extras=None,
payload['inbox'] = inbox payload['inbox'] = inbox
if big_pic_path is not None: if big_pic_path is not None:
payload['big_pic_path'] = big_pic_path 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: if extras is not None:
payload['extras'] = extras payload['extras'] = extras
return payload return payload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment