NIMSDK-AOS  9.15.0
Public 成员函数 | 所有成员列表
com.netease.nimlib.sdk.ysf.YsfService接口 参考

Created by hzsunyj on 2019-05-16. 更多...

Public 成员函数

InvocationFuture< Void > sendMessage (IMMessage msg, boolean resend)
 发送消息。
如果需要更新发送进度,请调用MsgServiceObserve#observeMsgStatus(com.netease.nimlib.sdk.Observer, boolean) 更多...
 
InvocationFuture< Void > sendCustomNotification (CustomNotification notification)
 发送一条指令消息。
由于SDK仅负责透传该消息,因此不会记录指令消息状态,但可以设置回调函数监听发送结果。 更多...
 
void updateIMMessageStatus (IMMessage message, boolean notify)
 更新消息记录的状态。可更新:
消息状态 IMMessage#getStatus() 不为 null 时更新
附件状态 IMMessage#getAttachStatus() 不为 null 时更新
附件内容 IMMessage#getAttachment() 不为 null 时更新 更多...
 
void updateMessage (IMMessage msg, boolean notify)
 更新消息,将原始消息替换掉 更多...
 
void registerAttachmentParser (int type, MsgAttachmentParser customParser)
 如果第三方app需要自定义的附件消息类型,再次注册自己的附件解析器。
客户自定义的消息类型为com.netease.nimlib.sdk.msg.constant.MsgTypeEnum#custom
自定义附件类型须继承自MsgAttachment。 更多...
 
InvocationFuture< Void > saveMessageToLocal (IMMessage msg, boolean notify)
 保存消息到本地数据库,但不发送到服务器端。用于第三方APP保存本地提醒一类的消息。
该接口将消息保存到数据库后,如果需要通知到UI,可将notify设置为true,此时会触发MsgServiceObserve#observeReceiveMessage(Observer, boolean)通知。 更多...
 

详细描述

Created by hzsunyj on 2019-05-16.

在文件 YsfService.java15 行定义.

成员函数说明

◆ registerAttachmentParser()

void com.netease.nimlib.sdk.ysf.YsfService.registerAttachmentParser ( int  type,
MsgAttachmentParser  customParser 
)

如果第三方app需要自定义的附件消息类型,再次注册自己的附件解析器。
客户自定义的消息类型为com.netease.nimlib.sdk.msg.constant.MsgTypeEnum#custom
自定义附件类型须继承自MsgAttachment。

参数
type消息类型
customParser附件解析器

◆ saveMessageToLocal()

InvocationFuture<Void> com.netease.nimlib.sdk.ysf.YsfService.saveMessageToLocal ( IMMessage  msg,
boolean  notify 
)

保存消息到本地数据库,但不发送到服务器端。用于第三方APP保存本地提醒一类的消息。
该接口将消息保存到数据库后,如果需要通知到UI,可将notify设置为true,此时会触发MsgServiceObserve#observeReceiveMessage(Observer, boolean)通知。

参数
msg待保存的消息对象
notify是否要通知UI更新界面
返回
InvocationFuture 可以设置回调函数。在消息存入数据库后,就会回调。

◆ sendCustomNotification()

InvocationFuture<Void> com.netease.nimlib.sdk.ysf.YsfService.sendCustomNotification ( CustomNotification  notification)

发送一条指令消息。
由于SDK仅负责透传该消息,因此不会记录指令消息状态,但可以设置回调函数监听发送结果。

参数
notification指令消息
返回
InvocationFuture 可设置回调函数,监听发送结果。

◆ sendMessage()

InvocationFuture<Void> com.netease.nimlib.sdk.ysf.YsfService.sendMessage ( IMMessage  msg,
boolean  resend 
)

发送消息。
如果需要更新发送进度,请调用MsgServiceObserve#observeMsgStatus(com.netease.nimlib.sdk.Observer, boolean)

参数
msg带发送的消息体,由MessageBuilder构造
resend如果是发送失败后重发,标记为true,否则填false
返回
InvocationFuture 可以设置回调函数。消息发送完成后才会调用,如果出错,会有具体的错误代码。

◆ updateIMMessageStatus()

void com.netease.nimlib.sdk.ysf.YsfService.updateIMMessageStatus ( IMMessage  message,
boolean  notify 
)

更新消息记录的状态。可更新:
消息状态 IMMessage#getStatus() 不为 null 时更新
附件状态 IMMessage#getAttachStatus() 不为 null 时更新
附件内容 IMMessage#getAttachment() 不为 null 时更新

参数
message待更新的消息记录
notify更新之后是否要通知UI更新界面

◆ updateMessage()

void com.netease.nimlib.sdk.ysf.YsfService.updateMessage ( IMMessage  msg,
boolean  notify 
)

更新消息,将原始消息替换掉

参数
msg待更新的消息体,由MessageBuilder构造
notify更新之后是否要通知UI更新界面

该接口的文档由以下文件生成: