- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
For private chat, the SDK supports sending end-to-end encrypted messages.
End-to-end encryption uses Signal's open-source encryption protocol so that messages can be viewed only by the sender and recipient. No other node on the transmission path can decrypt the content.
Send messages in the PRIVATE_E2EE conversation type. The SDK encapsulates all internal end-to-end encryption logic and automatically encrypts sent messages and decrypts received messages.
Example
TextMessage text = new TextMessage("Secret message");
Conversation conversation = new Conversation(Conversation.ConversationType.PRIVATE_E2EE, "userid1");
IMessageManager.ISendMessageCallback callback = new IMessageManager.ISendMessageCallback() {
@Override
public void onSuccess(Message message) {
Log.i("TAG", "send message success");
}
@Override
public void onError(Message message, int errorCode) {
Log.i("TAG", "send message error, code is " + errorCode);
}
};
Message message = JIM.getInstance().getMessageManager().sendMessage(text, conversation, callback);
For private chat, the SDK supports sending end-to-end encrypted messages.
End-to-end encryption uses Signal's open-source encryption protocol so that messages can be viewed only by the sender and recipient. No other node on the transmission path can decrypt the content.
Send messages in the JConversationTypePrivateE2EE conversation type. The SDK encapsulates all internal end-to-end encryption logic and automatically encrypts sent messages and decrypts received messages.
Example
JConversation *conversation = [[JConversation alloc] initWithConversationType:JConversationTypePrivateE2EE conversationId:@"userid2"];
JTextMessage *text = [[JTextMessage alloc] initWithContent:@"Secret message"];
JMessage *m = [JIM.shared.messageManager sendMessage:text
inConversation:conversation
success:^(JMessage *message) {
NSLog(@"sendMessage success");
} error:^(JErrorCode errorCode, JMessage *message) {
NSLog(@"sendMessage error");
}];
For private chat, the SDK supports sending end-to-end encrypted messages.
End-to-end encryption uses Signal's open-source encryption protocol so that messages can be viewed only by the sender and recipient. No other node on the transmission path can decrypt the content.
Send messages in the privateE2EE conversation type. The SDK encapsulates all internal end-to-end encryption logic and automatically encrypts sent messages and decrypts received messages.
Example
Conversation conversation = Conversation(ConversationType.privateE2EE, 'USER_ID');
TextMessage textMessage = TextMessage.content('Secret message');
DataCallback<Message> callback = (m, errorCode) {
if (errorCode == 0) {
print("sendMessage success, messageId is " + m.messageId);
} else {
print('sendMessage error, errorCode is ' + errorCode.toString() + ', clientMsgNo is ' + m.clientMsgNo!.toString());
}
};
Message message = await JuggleIm.instance.sendMessage(textMessage, conversation, callback);