Closed vineethsreekumar closed 2 years ago
The correct code would be something like this:
if let thread = BChatSDK.db().fetchOrCreateEntity(withID: "thread-id", withType: bThreadType) as? PThread {
if(BChatSDK.thread().canJoin(thread)) {
BChatSDK.thread().join(thread)
}
}
But there is no guarantee the user can join. In general, users need to be invited by the thread owner.
How a thread owner can invite another user?
How a thread owner can invite another user?
@bensmiley
@bensmiley we already tried fetchOrCreateEntity the thread doesnt have any meta and other data. seems we need to do invite from creator side. How we can invite a user with chatSDK ?
How we can invite a user with chat SDK android? ( Using firebase real-time database ) @bensmiley
You can add users like this:
iOS:
BChatSDK.thread().addUsers([user1, user2], to: thread)
Android:
ChatSDK.thread().addUsersToThread(thread, user1, user2).subscribe()
@bensmiley BChatSDK.thread().addUsers this will add the user right. what we need is invite a user via link and clicking on the link user should be able to join the group
@vineethsreekumar there is no built in function to do what you want. If you want that functionality you would need to build it yourself.
Is the bug present in the demo Chat SDK project? - yes
What modifications have you made to the Chat SDK? - a user could not join a group thread
iOS Version? Device or simulator? iphone 13 pro max
Steps taken to reproduce the problem: let grouptthread = BChatSDK.db().thread(forEntityID: "-N0adpBTTN_xMSYNL2f0") use join function in chatSDK.thread().join(groupthread)
Expected result: the current user should be joined to the group thread
Actual result: groupthread is nil
Comments: Can we add a user to a group thread in this way or do you have any other way to join a pivate group @bensmiley @denniszxxc @angelolloqui @ealeksandrov