Vivek Kumar Sharma
Vivek Kumar Sharma

Reputation: 21

Using ChatCamp sdk for person to person chatting

Unable to create 1 to 1 group channel for private chat by following up Documentation- Group Channel

Example:-

String CHANNEL_NAME = "person to person";
String[] PARTICIPANTS_LIST = {"27", "58"};
boolean IS_DISTINCT = true;

GroupChannel.create(CHANNEL_NAME, PARTICIPANTS_LIST, IS_DISTINCT, new                  GroupChannel.CreateListener() { 
@Override
public void onResult(GroupChannel groupChannel, ChatCampException e) {
if(e == null) {
    // New group channel has been created.
}
}
});

Upvotes: 2

Views: 114

Answers (1)

shubham
shubham

Reputation: 313

Please Update the sdk version, Error handling has been added in version 0.1.20, so you will get an error if any parameter you are passing is wrong. Also make sure the participant ids that you are passing exists. If the id does not exists then the group cannot be created, For creating the user with particular id call,

ChatCamp.connect(userId, new ChatCamp.ConnectListener() {
            @Override
            public void onConnected(User user, ChatCampException e) {
               // Handle Group creation
            }

        });

Upvotes: 2

Related Questions