我正在尝试集成 pusher chatkit,我对几件事感到好奇:
1)有没有办法读取特定房间的状态,类似于您加入房间时......或被房间拒绝。以下是您加入房间时的示例。
D/TAG: Message(id=102785662, sender=User(id=username1-PCKid, createdAt=2020-01-02T01:44:28Z, updatedAt=2020-01-02T01:44:28Z, name=username1, avatarURL=null, customData=null, online=true), room=Room(id=my-room2, createdById=alice, name=my room2, pushNotificationTitleOverride=null, isPrivate=false, customData=null, unreadCount=14, lastMessageAt=2020-01-15T15:34:45Z, createdAt=2020-01-01T20:48:29Z, updatedAt=2020-01-01T20:48:29Z, deletedAt=null), parts=[Part(partType=Inline, payload=Inline(type=text/plain, content=updates on click))], createdAt=Wed Jan 15 07:34:45 PST 2020, updatedAt=Wed Jan 15 07:34:45 PST 2020, deletedAt=null)
******UPDATE*** 能够通过从适配器调用它来解决数字 1:
fun addRoom(room:Room){
list.add(room);
Log.d(AppActivityTags.chatRoomsListAdapterTAG, "Room name: " + room.name)
Log.d(AppActivityTags.chatRoomsListAdapterTAG, "Room id: " + room.id)
Log.d(AppActivityTags.chatRoomsListAdapterTAG, "Room memberUserIds: " + room.memberUserIds)
Log.d(AppActivityTags.chatRoomsListAdapterTAG, "Room isPrivate: " + room.isPrivate)
}
2)我怎样才能得到一个房间的成员列表?我试过room.memberUserIds
,但它回来是空的。
3)我是kotlin的新手,也是推送者聊天工具,有人可以给我看一个如何登录的例子
currentUser.getJoinableRooms { result ->
when (result) {
is Result.Success -> {
// Do something with List<Room>
// show me joinable rooms
}
}
}
我猜这会淘汰非私人房间。
4) 我收到此错误D/ChatRoomsActivity: on subscripetoRoomMultipart reason:: Room membership required
,但用户已经是房间的成员,如推送器聊天工具控制台中所示。当前用户id=username1-PCKid