Search in sources :

Example 1 with RequestReplyFileMessage

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

the class ChatActivity method replyFileMessage.

private void replyFileMessage() {
    String messageContent = "Hello! just be happy!! : ) ";
    long threadId = TEST_THREAD_ID;
    long messageId = 114334;
    Uri fileUri = getUri();
    Inviter inviter = new Inviter();
    inviter.setName("Sample Name for meta data test");
    String meta = gson.toJson(inviter);
    RequestReplyFileMessage fileMessage = new RequestReplyFileMessage.Builder(messageContent, threadId, messageId, fileUri, this, // required
    TextMessageType.Constants.POD_SPACE_PICTURE).systemMetaData(meta).setUserGroupHashCode(// required
    TEST_THREAD_HASH).setImageHc("200").setImageWc("100").setImageXc("5").setImageYc("5").build();
    presenter.replyFileMessage(fileMessage, new ProgressHandler.sendFileMessage() {

        @Override
        public void onProgressUpdate(String uniqueId, int progress, int totalBytesSent, int totalBytesToSend) {
            Log.e("CHAT_SDK_UPLOAD", "Progress %" + progress);
        }
    });
}
Also used : Inviter(com.fanap.podchat.mainmodel.Inviter) ProgressHandler(com.fanap.podchat.ProgressHandler) RequestReplyFileMessage(com.fanap.podchat.requestobject.RequestReplyFileMessage) Uri(android.net.Uri)

Aggregations

Uri (android.net.Uri)1 ProgressHandler (com.fanap.podchat.ProgressHandler)1 Inviter (com.fanap.podchat.mainmodel.Inviter)1 RequestReplyFileMessage (com.fanap.podchat.requestobject.RequestReplyFileMessage)1