2

I was trying to create a chat application using SendBirdSDK. But I couldn't find any methods in the documentation to start chat with a user. I downloaded the sample project and checked it, but it contains group channels and open channels only.

Is there any such methods to create 1 to 1 messages or should I need to create a groupchat with single user ID only?

Any help will be apreciated

Anand
  • 5,323
  • 5
  • 44
  • 58
  • I am trying to find the same thing as what you have mentioned above, so is it possible to directly chat with user like whatsapp in sendbird? – Niki Aug 31 '18 at 06:15

2 Answers2

3

According to the documentation,

A Group Channel is a private chat. A user may join the chat only through an invitation by another user who is already a member of the chatroom. A Group Channel can consist of one to hundreds of members. Creating a channel with two members allows 1-to-1 messaging.

So you just need to create a Group Channel with two User IDs in order it to be a 1-to-1 chat. Also, you should enable the Distinct property, because also according to the docs:

Consequently, we recommend that you enable the Distinct property in 1-to-1 messaging channels in order to reuse the same channel when a user chooses to directly message a friend. If the property is disabled, the user will create a new channel even if they have had previous conversations with the friend, and therefore will not be able to see or access previously sent messages or data.

Reference: https://docs.sendbird.com/ios#group_channel_3_creating_a_group_channel

terryk
  • 116
  • 7
0

I am not sure but in group channel they provide 1-on-1 messaging. But for that you need to create a group with other userID

You can use the reference code from here:

https://sendbird.gitbooks.io/how-to-build-an-ios-messaging-app/content/en/implement_1-on-1_messaging.html

Moin Shirazi
  • 4,372
  • 2
  • 26
  • 38
  • Thank you for your quick response. I have already read the blog. But there is no method like startMessagingWithUserId. I believe this is an outdated source code!! – Anand Dec 09 '16 at 11:55
  • please tell me how can i share the location using SendBird-Android SDK like whatsapp ? – Achin Aug 31 '17 at 06:36