Search code examples
androidquickblox

Syncing my contacts with quickblox and retrieving those users for my custom chat application in android


I am creating the chat application. and i want to check the users of Quickblox who are all in my contact. i tried, Retrieving users by login. here, login is mobile number of the contact.

QBUsers.getUsersByLogins(getAllContacts(), requestBuilder, new QBEntityCallbackImpl<ArrayList<QBUser>>() {
                @Override
                public void onSuccess(ArrayList<QBUser> users, Bundle params) {

                    // Save users
                    //
                    Log.e("DIALOD", dialogs.toString());

                    callback.onSuccess(users, null);
                }

                @Override
                public void onError(List<String> errors) {
                    callback.onError(errors);
                }

            });

`

  QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder();
            requestBuilder.setPage(1);
            requestBuilder.setPerPage(100);

getAllContacts() will return the Mobile number of my Mobile Contact. my contact having more than 500 contact number. then the quickblox returning error. but it doesnt have any error description list .

Help me little guys..


Solution

  • I found the reason. because, getAllContacts methods returns more than hundred contact. but the requestByLogin method only allows 100 users only. so , it should be implementedd by multiple threads.