How to display contacts in the list with alphabets (Like A, B, C etc)

I want to display contacts in the list with alphabets (Like A, B, C etc) and also i want to add my contact (which not registered with comet chat )in same list.Capture

Please help me how can i do this in java code.

Hi @avisharma.11,

You can refer to our UI-kit library or sample app which includes functionality like displaying user by alphabetical. And To show your contacts, you can append them at the end of the list.

UI-Kit Library:

UI-Kit Sample App:

I want to display alphabet also

Hi @avisharma.11,

Yes the alphabet will be visible as headers in users list.

Please visit the below documentation link to know more.

please help me for this in java sample app.

i appended the list of contacts (unregistered contact ) with in same list of contact but i facing issue in case of search. When i am searching in same the list then not getting any result.

Hi @avisharma.11,

If you are using UserRequest Builder with setSearchKeyword() to search the users from list then it will return only those user who are registered or created in cometchat. You won’t be able to search unregistered users using UserRequestBuilder.

If you wish to search for unregistered users, you will have to implement search at your end and in the end merge the result returned by CometChat and your results.

1 Like

How to get all registered contact of cometchat in one time (without using limit method)

Hi @avisharma.11,

It’s not possible to get all users at one time. You need to use setLimit() method with UserRequestBuilder object.
You can fetch up to 100 users in one request by appending setLimit(100) in your UserRequestBuilder and using its object with fetchNext().
To fetch the next 100 users you can use the same UserRequestBuilder object with fetchNext()

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.