|
NIMSDK-AOS
9.20.15
|
自定义通知。
区别于IMMessage,SDK仅透传该类型消息,不负责解析和存储。消息内容由第三方APP自由扩展。
自定义通知消息可选择要不要发送给当前不在线的用户。
更多...
Public 成员函数 | |
| String | getSessionId () |
| 获取聊天对象的Id(好友帐号,群ID等)。 更多... | |
| void | setSessionId (String sessionId) |
| 设置聊天对象ID。 更多... | |
| SessionTypeEnum | getSessionType () |
| 获取会话类型。 更多... | |
| void | setSessionType (SessionTypeEnum sessionType) |
| 设置会话类型。 更多... | |
| String | getFromAccount () |
| 获取该通知的发出者帐号。 更多... | |
| void | setFromAccount (String fromAccount) |
| 设置该通知的发起者帐号 更多... | |
| long | getTime () |
| 获取消息时间,单位为ms 更多... | |
| void | setTime (long time) |
| 设置消息时间 更多... | |
| String | getContent () |
| 获取消息具体内容。 更多... | |
| void | setContent (String content) |
| 设置消息内容。 更多... | |
| boolean | isSendToOnlineUserOnly () |
| 该消息是否只发送当前在线的用户/群组。 更多... | |
| void | setSendToOnlineUserOnly (boolean sendToOnlineUserOnly) |
| 设置该消息是否只发送给当前在线的用户。 如果该值为true,只有接收方当前在线时,才能收到该消息。 如果该值为false,如果接收方当前在线,会立即收到该消息,如果不在线,会在下一次登录后收到该消息。 设置为false后,该消息和普通IM消息一样保证必达。 更多... | |
| String | getApnsText () |
| 获取如果接收方是iOS设备登录,该消息的APNS推送文本内容 更多... | |
| void | setApnsText (String apnsText) |
| 设置如果接收方是iOS设备登录,该消息的APNS推送文本内容 更多... | |
| Map< String, Object > | getPushPayload () |
| 获取第三方自定义的推送属性 更多... | |
| void | setPushPayload (Map< String, Object > pushPayload) |
| 设置第三方自定义的推送属性 更多... | |
| CustomNotificationConfig | getConfig () |
| void | setConfig (CustomNotificationConfig config) |
| NIMAntiSpamOption | getNIMAntiSpamOption () |
| 获取反垃圾配置 更多... | |
| void | setNIMAntiSpamOption (NIMAntiSpamOption antiSpamOption) |
| 设置反垃圾配置项 更多... | |
| String | getEnv () |
| 获取环境变量 用于指向不同的抄送,第三方回调等配置 更多... | |
| void | setEnv (String env) |
| 设置环境变量 用于指向不同的抄送,第三方回调等配置 更多... | |
| JSONObject | toJsonObj () |
自定义通知。
区别于IMMessage,SDK仅透传该类型消息,不负责解析和存储。消息内容由第三方APP自由扩展。
自定义通知消息可选择要不要发送给当前不在线的用户。
在文件 CustomNotification.java 第 16 行定义.
| String com.netease.nimlib.sdk.msg.model.CustomNotification.getApnsText | ( | ) |
| CustomNotificationConfig com.netease.nimlib.sdk.msg.model.CustomNotification.getConfig | ( | ) |
在文件 CustomNotification.java 第 176 行定义.
| String com.netease.nimlib.sdk.msg.model.CustomNotification.getContent | ( | ) |
获取消息具体内容。
在文件 CustomNotification.java 第 110 行定义.
| String com.netease.nimlib.sdk.msg.model.CustomNotification.getEnv | ( | ) |
| String com.netease.nimlib.sdk.msg.model.CustomNotification.getFromAccount | ( | ) |
| NIMAntiSpamOption com.netease.nimlib.sdk.msg.model.CustomNotification.getNIMAntiSpamOption | ( | ) |
| Map<String, Object> com.netease.nimlib.sdk.msg.model.CustomNotification.getPushPayload | ( | ) |
| String com.netease.nimlib.sdk.msg.model.CustomNotification.getSessionId | ( | ) |
| SessionTypeEnum com.netease.nimlib.sdk.msg.model.CustomNotification.getSessionType | ( | ) |
| long com.netease.nimlib.sdk.msg.model.CustomNotification.getTime | ( | ) |
获取消息时间,单位为ms
在文件 CustomNotification.java 第 96 行定义.
| boolean com.netease.nimlib.sdk.msg.model.CustomNotification.isSendToOnlineUserOnly | ( | ) |
该消息是否只发送当前在线的用户/群组。
在文件 CustomNotification.java 第 124 行定义.
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setApnsText | ( | String | apnsText | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setConfig | ( | CustomNotificationConfig | config | ) |
在文件 CustomNotification.java 第 180 行定义.
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setContent | ( | String | content | ) |
设置消息内容。
在文件 CustomNotification.java 第 117 行定义.
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setEnv | ( | String | env | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setFromAccount | ( | String | fromAccount | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setNIMAntiSpamOption | ( | NIMAntiSpamOption | antiSpamOption | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setPushPayload | ( | Map< String, Object > | pushPayload | ) |
设置第三方自定义的推送属性
| pushPayload | 第三方自定义的推送属性Map,开发者需要保证此Map能够转换为JsonObject,属性内容最大长度2048字节 |
在文件 CustomNotification.java 第 172 行定义.
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setSendToOnlineUserOnly | ( | boolean | sendToOnlineUserOnly | ) |
设置该消息是否只发送给当前在线的用户。
如果该值为true,只有接收方当前在线时,才能收到该消息。
如果该值为false,如果接收方当前在线,会立即收到该消息,如果不在线,会在下一次登录后收到该消息。 设置为false后,该消息和普通IM消息一样保证必达。
| sendToOnlineUserOnly | 是否只发送给在线用户/群组,云信SDK 4.1版本开始支持群组离线自定义通知. |
在文件 CustomNotification.java 第 136 行定义.
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setSessionId | ( | String | sessionId | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setSessionType | ( | SessionTypeEnum | sessionType | ) |
| void com.netease.nimlib.sdk.msg.model.CustomNotification.setTime | ( | long | time | ) |
设置消息时间
在文件 CustomNotification.java 第 103 行定义.
| JSONObject com.netease.nimlib.sdk.msg.model.CustomNotification.toJsonObj | ( | ) |
在文件 CustomNotification.java 第 222 行定义.
1.8.11