use of com.fanap.podchat.requestobject.RequestMessage in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method rejectIncomingCallWithMessage.
@Override
public void rejectIncomingCallWithMessage(String msg) {
RejectCallRequest request = new RejectCallRequest.Builder(callVO.getCallId()).build();
String uniqueId = chat.rejectVoiceCall(request);
callUniqueIds.add(uniqueId);
RequestMessage requestRejectMessage = new RequestMessage.Builder("الان نمیتونم جواب بدم", callVO.getConversationVO().getId()).messageType(TextMessageType.Constants.TEXT).jsonMetaData(new GsonBuilder().create().toJson("{\"callRejectWithMessage\":true}")).build();
callUniqueIds.add(chat.sendTextMessage(requestRejectMessage, null));
getActiveCalls();
}
use of com.fanap.podchat.requestobject.RequestMessage in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onDeviceGotFar.
@Override
public void onDeviceGotFar() {
RequestMessage requestRejectMessage = new RequestMessage.Builder("گوشی رو از گوشم دور کردم", callVO.getConversationVO().getId()).messageType(TextMessageType.Constants.TEXT).jsonMetaData(new GsonBuilder().create().toJson("{\"callRejectWithMessage\":true}")).build();
callUniqueIds.add(chat.sendTextMessage(requestRejectMessage, null));
}
use of com.fanap.podchat.requestobject.RequestMessage in project pod-chat-android-sdk by FanapSoft.
the class CallPresenter method onDeviceIsNear.
@Override
public void onDeviceIsNear() {
RequestMessage requestRejectMessage = new RequestMessage.Builder("گوشی رو گرفتم نزدیک گوشم", callVO.getConversationVO().getId()).messageType(TextMessageType.Constants.TEXT).jsonMetaData(new GsonBuilder().create().toJson("{\"callRejectWithMessage\":true}")).build();
callUniqueIds.add(chat.sendTextMessage(requestRejectMessage, null));
if (isCameraOn) {
turnOffCamera();
}
}
use of com.fanap.podchat.requestobject.RequestMessage in project pod-chat-android-sdk by FanapSoft.
the class ChatTest method sendALotOfMessageToThread.
@Test
@LargeTest
public void sendALotOfMessageToThread() {
populateThreadsListFromServerOnly();
long threadID = threads.get(0).getId();
for (Thread thread : new ArrayList<>(threads)) {
if (!thread.isClosed() && thread.getParticipantCount() > 1) {
threadID = thread.getId();
}
}
if (threadID > 0) {
int counter = 0;
int count = 5;
while (counter < count) {
RequestMessage requestMessage = new RequestMessage.Builder("This is test " + new Date().getTime(), threadID).messageType(TextMessageType.Constants.TEXT).jsonMetaData("From android instrumental test at " + new Date().getTime()).build();
presenter.sendTextMessage(requestMessage, null);
counter++;
}
sleep(7000);
Mockito.verify(view, Mockito.atLeastOnce()).onSentMessage();
} else {
Assert.fail("no suitable thread found");
}
}
use of com.fanap.podchat.requestobject.RequestMessage in project pod-chat-android-sdk by FanapSoft.
the class ChatTestSandbox method setHashTagTest.
@Test
@LargeTest
public void setHashTagTest() {
ChatListener historyListeners = new ChatListener() {
@Override
public void onGetHistory(String content, ChatResponse<ResultHistory> history) {
System.out.println("onGetHistory: ");
Logger.json(history.getJson());
Assert.assertTrue(true);
resumeProcess();
}
@Override
public void onSent(String content, ChatResponse<ResultMessage> response) {
System.out.println("onSent: ");
Logger.json(response.getJson());
Assert.assertTrue(true);
resumeProcess();
}
};
chat.addListener(historyListeners);
RequestMessage requestMessage = new RequestMessage.Builder("#android fragment", 8085).build();
presenter.sendTextMessage(requestMessage, null);
pauseProcess();
}
Aggregations