Search in sources :

Example 1 with RequestAddContact

use of com.fanap.podchat.requestobject.RequestAddContact in project pod-chat-android-sdk by FanapSoft.

the class IntegrationTest method addContact.

@Test
public void addContact() {
    chatListeners = new ChatListener() {

        @Override
        public void onContactAdded(String content, ChatResponse<ResultAddContact> response) {
            System.out.println("Contact Removed: " + content);
            contactContent = content;
            resumeProcess();
        }
    };
    chat.addListener(chatListeners);
    RequestAddContact request = new RequestAddContact.Builder().firstName("Nadia").lastName("Anvari").username("nadia.anvari").email("nadia.anvari@fanap.ir").build();
    chat.addContact(request);
    pauseProcess();
    System.out.println("Received contact: " + contactContent);
}
Also used : ChatListener(com.fanap.podchat.chat.ChatListener) ResultAddContact(com.fanap.podchat.model.ResultAddContact) RequestAddContact(com.fanap.podchat.requestobject.RequestAddContact) Test(org.junit.Test) LargeTest(android.support.test.filters.LargeTest)

Example 2 with RequestAddContact

use of com.fanap.podchat.requestobject.RequestAddContact in project pod-chat-android-sdk by FanapSoft.

the class ChatActivity method addContact.

private void addContact() {
    // {"id":344016830,"senderName":"chat-server","senderId":0,"type":4,"content":"{\"type\":23,\"messageType\":0,\"subjectId\":0,\"uniqueId\":\"fe08a72b-09eb-45b2-b6b2-03cd4dab4855\",\"content\":\"{\\\"id\\\":15424,\\\"coreUserId\\\":31257,\\\"sendEnable\\\":true,\\\"receiveEnable\\\":true,\\\"name\\\":\\\"رضا شریفی\\\",\\\"cellphoneNumber\\\":\\\"09365090061\\\",\\\"email\\\":\\\"rezasharify1993.rsmi@gmail.com\\\",\\\"username\\\":\\\"user-15778858615492\\\",\\\"contactSynced\\\":true}\",\"time\":1606317640273}"}
    // add contact
    // presenter.addContact("",
    // "",
    // "",
    // faker.name().username() + "@gmail.com",
    // "");
    // 
    // presenter.addContact("",
    // "",
    // "",
    // "",
    // "");
    // 16844 zabix1
    List<String> usernames = new ArrayList<>();
    // usernames.add("z.mohammadi");
    // usernames.add("p.khoshghadam");
    // usernames.add("m.hasanpour");
    // usernames.add("z.ershad");
    // usernames.add("Samira.amiri");
    // usernames.add("s.heydarizadeh");
    // usernames.add("p.pahlavani");
    usernames.add("ma.amjadi");
    // for (String user :
    // usernames) {
    // 
    // 
    // try {
    // RequestAddContact request = new RequestAddContact.Builder()
    // .firstName(user + " n ")
    // .lastName(user + " i ")
    // .username(user)
    // .build();
    // 
    // presenter.addContact(request);
    // 
    // Thread.sleep(7000);
    // } catch (InterruptedException e) {
    // e.printStackTrace();
    // }
    // 
    // 
    // }
    // RequestAddContact request = new RequestAddContact.Builder()
    // .firstName("Leila")
    // .lastName("Nemati")
    // .cellphoneNumber("09126975376") //80617 //80618
    // // .cellphoneNumber()
    // // .email()
    // .build();
    // 
    // presenter.addContact(request);
    RequestAddContact request = new RequestAddContact.Builder().firstName("Nadia").lastName("Anvari").username("nadia.anvari").email("nadia.anvari@fanap.ir").build();
    presenter.addContact(request);
}
Also used : ArrayList(java.util.ArrayList) RequestAddContact(com.fanap.podchat.requestobject.RequestAddContact)

Aggregations

RequestAddContact (com.fanap.podchat.requestobject.RequestAddContact)2 LargeTest (android.support.test.filters.LargeTest)1 ChatListener (com.fanap.podchat.chat.ChatListener)1 ResultAddContact (com.fanap.podchat.model.ResultAddContact)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1