特性列表

  • iOS

更新时间

查看实时消息 RTM 的特性列表,了解关键概念、参数说明、使用限制和接入注意事项。

本文提供 RTM 所具备的功能特性及对应 API 接口。

Setup

功能API 接口
创建实例initWithConfig:delegate:error
销毁实例[rtm destroy]
Token 设置AgoraRtmClientConfig 中的 token 参数
端侧加密AgoraRtmClientConfig 中的 encryptionConfig 参数
Presence 超时设置AgoraRtmClientConfig 中的 presenceTimeout 参数
日志等级设置AgoraRtmLogConfig 中的 level 参数
Proxy 设置AgoraRtmProxyConfig 中的 proxyType、server、port、account、password 参数
消息传输协议设置AgoraRtmClientConfig 中的 protocolType 参数
私有化部署设置AgoraRtmPrivateConfig 中的 serviceType、accessPointHosts 参数
事件监听
登录服务[rtm loginByToken:completion:]
登出服务[rtm logout:completion]
表格内容超出当前宽度,可横向滚动查看更多列。

Channel

功能API 接口
订阅频道[rtm subscribeWithChannel:option:completion]
取消订阅频道[rtm unsubscribeWithChannel:completion]
创建 Stream Channel[rtm createStreamChannel:error]
加入 Stream Channel[streamChannel joinWithOption:completion]
离开 Stream Channel[streamChannel leave]
销毁 Stream Channel[streamChannel destroy]
表格内容超出当前宽度,可横向滚动查看更多列。

Topic

Message

功能API 接口
发送消息[rtm publish:message:option:completion]
表格内容超出当前宽度,可横向滚动查看更多列。

在线状态

功能API 接口
查询用户在线状态getUserOnlineStatus
查询频道在线用户[[rtm getPresence] whoNow:channelType:options:completion]
查询用户所在频道[[rtm getPresence] whereNow:completion]
设置用户临时状态[[rtm getPresence] setState:channelType:items:completion]
查询用户临时状态[[rtm getPresence] getState:channelType:userId:completion]
删除用户临时状态[[rtm getPresence] removeState:channelType:keys:completion]
表格内容超出当前宽度,可横向滚动查看更多列。

存储

锁