use of com.fanap.podchat.requestobject.RequestGetContact in project pod-chat-android-sdk by FanapSoft.
the class AssistantCacheTest method populateContactsFromServer.
public void populateContactsFromServer() {
chatListeners = new ChatListener() {
@Override
public void onGetContacts(String content, ChatResponse<ResultContact> response) {
if (!response.isCache()) {
print("Received List: " + content);
contacts.addAll(response.getResult().getContacts());
chat.removeListener(chatListeners);
resumeProcess();
}
}
};
chat.setListener(chatListeners);
RequestGetContact request = new RequestGetContact.Builder().count(50).offset(0).build();
chat.getContacts(request, null);
pauseProcess();
print("Received Contact List: " + contacts.size());
}
use of com.fanap.podchat.requestobject.RequestGetContact in project pod-chat-android-sdk by FanapSoft.
the class ContactCacheTest method populateContactsFromCache.
public void populateContactsFromCache() {
chatListeners = new ChatListener() {
@Override
public void onGetContacts(String content, ChatResponse<ResultContact> response) {
if (response.isCache()) {
System.out.println("Received Cache List: " + content);
cacheContacts.addAll(response.getResult().getContacts());
chat.removeListener(chatListeners);
resumeProcess();
}
}
};
chat.setListener(chatListeners);
RequestGetContact request = new RequestGetContact.Builder().count(50).offset(0).build();
chat.getContacts(request, null);
pauseProcess();
System.out.println("Received Cache List: " + cacheContacts.size());
}
Aggregations