BRTM uni-app SDK 是基于 uni-app 框架的 BRTM 客户端 SDK,开发者可以通过 BRTM uni-app SDK 轻松实现 BRTM 的功能。
createInstance
创建 Brtm Sdk 实例
createInstance(appId: string)
参数
详情
exitRoom
删除 Brtm Sdk 实例对象
destroyInstance()
监听 Sdk 事件
on(event, callback)
取消监听 Sdk 事件
off(event)
enterRoom
加入房间
enterRoom(params)
{ "roomId": "房间ID", "userSig": "用户进房鉴权码", "userInfo": { "userName": "", // 用户识别码 "userId": 2924, "userAvatar": "", // 用户头像地址 "role": "" // 用户角色类型 } }
离开房间
exitRoom(params)
sendMessage
给某个用户发送消息
sendMessage(key: string, msgContent: string, toUserId: string)
onError
错误通知
onError: (errorCode: number, errorMessage: string)
onRoomJoined
进入房间成功通知
onRoomJoined: ()
onLeaveRoom
离开房间成功通知
onLeaveRoom: ()
onMessageReceived
收到某个用户发来的房间消息通知
onMessageReceived: (key: string, content: string, userId: string)
onBroadcastMessageReceived
收到广播房间消息通知
onBroadcastMessageReceived: (key: string, content: string)
onReceiveChatMessage
收到新的聊天消息通知
onReceiveChatMessage: (chatMessage: brtm.BrtmChatMessage)
onGetAllChatMessage
onGetAllChatMessage: (chatMessageList: brtm.BrtmChatMessage[])
uni-app
BRTM uni-app SDK 是基于 uni-app 框架的 BRTM 客户端 SDK,开发者可以通过 BRTM uni-app SDK 轻松实现 BRTM 的功能。
接口
回调事件
详细信息
createInstance
创建 Brtm Sdk 实例
参数
详情
exitRoom
删除 Brtm Sdk 实例对象
监听 Sdk 事件
参数
取消监听 Sdk 事件
参数
enterRoom
加入房间
参数
exitRoom
离开房间
sendMessage
给某个用户发送消息
参数
onError
错误通知
参数
onRoomJoined
进入房间成功通知
onLeaveRoom
离开房间成功通知
onMessageReceived
收到某个用户发来的房间消息通知
参数
onBroadcastMessageReceived
收到广播房间消息通知
参数
onReceiveChatMessage
收到新的聊天消息通知
参数
onGetAllChatMessage
收到新的聊天消息通知
参数