Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxiuwen committed Jan 3, 2024
1 parent bd55502 commit 71418e6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/document/android/multi_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Android SDK 初始化时会生成登录 ID 用于在多设备登录和消息推
```java
// 同步方法,会阻塞当前线程。异步方法为 asyncGetSelfIdsOnOtherPlatform(EMValueCallBack)。
List<String> ids = EMClient.getInstance().contactManager().getSelfIdsOnOtherPlatform();
// 选择一个登录 ID 作为消息发送方
// 选择一个登录 ID 作为消息接收方
String toChatUsername = ids.get(0);
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息发送方
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息接收方
EMMessage message = EMMessage.createTxtSendMessage(content, toChatUsername);
// 发送消息。
EMClient.getInstance().chatManager().sendMessage(message);
Expand Down
4 changes: 2 additions & 2 deletions docs/document/ios/multi_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ iOS SDK 初始化时会生成登录 ID 用于在多设备登录和消息推送

```objectivec
[EMClient.sharedClient.contactManager getSelfIdsOnOtherPlatformWithCompletion:^(NSArray<NSString *> * _Nullable aList, EMError * _Nullable aError) {
// 选择一个登录 ID 作为消息发送方
// 选择一个登录 ID 作为消息接收方
NSString *to = aList.firstObject;
if (to.length > 0) {
EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:@"Hello World"];
// 创建一条文本消息,content 为消息文字内容,to 传入登录 ID 作为消息发送方
// 创建一条文本消息,content 为消息文字内容,to 传入登录 ID 作为消息接收方
EMChatMessage *message = [[EMChatMessage alloc] initWithConversationID:to body:body ext:nil];
// 发送消息。
[EMClient.sharedClient.chatManager sendMessage:message progress:nil completion:^(EMChatMessage * _Nullable message, EMError * _Nullable error) {
Expand Down
4 changes: 2 additions & 2 deletions docs/document/unity/multi_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
SDKClient.Instance.ContactManager.GetSelfIdsOnOtherPlatform(new ValueCallBack<List<string>>(
onSuccess: (list) =>
{
// 选择一个登录 ID 作为消息发送方
// 选择一个登录 ID 作为消息接收方
string toChatUsername = list[0];
string content = "content";
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息发送方
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息接收方
Message msg = Message.CreateTextSendMessage(toChatUsername, content);
// 发送消息。
SDKClient.Instance.ChatManager.SendMessage(ref msg, new CallBack(
Expand Down
4 changes: 2 additions & 2 deletions docs/document/windows/multi_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
SDKClient.Instance.ContactManager.GetSelfIdsOnOtherPlatform(new ValueCallBack<List<string>>(
onSuccess: (list) =>
{
// 选择一个登录 ID 作为消息发送方
// 选择一个登录 ID 作为消息接收方
string toChatUsername = list[0];
string content = "content";
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息发送方
// 创建一条文本消息,content 为消息文字内容,toChatUsername 传入登录 ID 作为消息接收方
Message msg = Message.CreateTextSendMessage(toChatUsername, content);
// 发送消息。
SDKClient.Instance.ChatManager.SendMessage(ref msg, new CallBack(
Expand Down

0 comments on commit 71418e6

Please sign in to comment.