new SystemMessage()
系统通知
系统通知分为两种
- 推荐使用
JSON
格式构建, 非JSON
格式的话, Web端会正常接收, 但是会被其它端丢弃 true
时只发送给在线用户, 适合发送即时通知, 比如正在输入。false
时假如目标用户或群不在线, 会在其上线后推送过去。- 该参数只对点对点自定义系统通知有效, 对群自定义系统通知无效, 群自定义系统通知只会发给在线的群成员, 不会存离线。
Properties:
Name | Type | Argument | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
time |
Number | 时间戳 |
|||||||||
type |
String |
<optional> |
|||||||||
from |
String | 系统通知的来源, 账号或者群ID |
|||||||||
to |
String | 系统通知的目标, 账号或者群ID |
|||||||||
idServer |
String |
<optional> |
内建系统通知的 idServer |
||||||||
read |
Boolean |
<optional> |
内建系统通知是否已读 |
||||||||
category |
String |
<optional> |
|||||||||
state |
String |
<optional> |
内建系统通知的 |
||||||||
error |
NIMError |
<optional> |
内建系统通知的 |
||||||||
localCustom |
String |
<optional> |
内建系统通知的本地自定义扩展字段 |
||||||||
ps |
String |
<optional> |
内建系统通知的附言 |
||||||||
attach |
Object |
<optional> |
内建系统通知的附加信息, 参考 Properties
|
||||||||
scene |
String |
<optional> |
自定义系系统通知的场景, 参考 |
||||||||
content |
String |
<optional> |
自定义系统通知的内容 |
||||||||
isPushable |
Boolean | 是否需要推送 |
|||||||||
apnsText |
String |
<optional> |
自定义系统通知的推送文案, 仅对接收方为iOS设备有效 |
||||||||
pushPayload |
String |
<optional> |
自定义系统通知的推送属性 |
||||||||
needPushNick |
Boolean | 是否需要推送昵称 |
|||||||||
sendToOnlineUsersOnly |
Boolean |
<optional> |
自定义系统通知是否只发送给在线用户。 |
||||||||
cc |
Boolean | 自定义系统通知是否抄送 |
Members
-
<static, readonly> category :String
-
内建系统通知的种类
'team'
'friend'
Type:
- String
-
<static, readonly> state :String
-
内建系统通知的状态
'init'
: 未处理状态'passed'
: 已通过'rejected'
: 已拒绝'error'
: 错误
Type:
- String
-
<static, readonly> type :String
-
系统通知类型
'addFriend'
直接加某个用户为好友
后, 对方不需要确认, 直接成为当前登录用户的好友。- 对方会收到一条类型为
'addFriend'
的系统通知
, 此类系统通知的from
字段的值为申请方的帐号,to
字段的值为接收方的账号。
'applyFriend'
'passFriendApply'
- 见
'applyFriend'
- 见
'rejectFriendApply'
- 见
'applyFriend'
- 见
'deleteFriend'
'teamInvite'
'rejectTeamInvite'
- 见
'teamInvite'
- 见
'applyTeam'
'rejectTeamApply'
- 见
'applyTeam'
- 见
'deleteMsg'
'custom'
- 自定义系统通知
Type:
- String