android-messenger-app icon indicating copy to clipboard operation
android-messenger-app copied to clipboard

How to send a list of chat messages from other screen than chat message screen

Open ArnoldBrown opened this issue 3 years ago • 2 comments

How to send a list of chat messages to different recipient that are stored at the time of device in offline. Need to send the stored list of message once the device become online

I tried the send functionality from Recent Chat page

ConnectycubeChatService chatService = ConnectycubeChatService.getInstance();
ConnectycubeChatDialog chatDialog = new ConnectycubeChatDialog(dialog_id);
chatDialog.initForChat(chatService); <<----Logout pointed
ConnectycubeChatMessage chatMessage = new ConnectycubeChatMessage();
                  chatMessage.setRecipientId(user_id);
                  chatMessage.setBody(chat_msg);
                  chatMessage.setSaveToHistory(true);

chatDialog.sendMessage(chatMessage);

Facing issue -

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

ArnoldBrown avatar Sep 30 '21 06:09 ArnoldBrown

@masmerino 13

ArnoldBrown avatar Sep 30 '21 11:09 ArnoldBrown

hi @ArnoldBrown, some notes about your code:

  1. before call chatDialog.initForChat(chatService); you should login to the chat;
  2. here ConnectycubeChatDialog chatDialog = new ConnectycubeChatDialog(dialog_id); need to set the dialog's type and occupants ids;

Please provide the full log without any filtering and cutting from starting that app till getting this issue.

TatankaConCube avatar Sep 30 '21 13:09 TatankaConCube

no long-term activity

CubeRomanMagellan avatar Feb 12 '24 09:02 CubeRomanMagellan