new_version1

main
hrxiang 3 years ago
parent cd0865853b
commit f3261d2ce4
  1. 2
      android/build.gradle
  2. 3
      android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java
  3. 52
      android/src/main/java/io/openim/flutter_openim_sdk/listener/FriendshipListener.java
  4. 79
      android/src/main/java/io/openim/flutter_openim_sdk/listener/GroupListener.java
  5. 5
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnAdvancedMsgListener.java
  6. 11
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java
  7. 34
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConnListener.java
  8. 3
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConversationListener.java
  9. 76
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnFriendshipListener.java
  10. 97
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnGroupListener.java
  11. 8
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnMsgSendListener.java
  12. 14
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnUserListener.java
  13. 38
      android/src/main/java/io/openim/flutter_openim_sdk/listener/SDKListener.java
  14. 78
      android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java
  15. 103
      android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java
  16. 105
      android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java
  17. 47
      android/src/main/java/io/openim/flutter_openim_sdk/manager/IMManager.java
  18. 144
      android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java
  19. 35
      android/src/main/java/io/openim/flutter_openim_sdk/manager/UserManager.java
  20. 2
      android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java
  21. 58
      example/lib/main.dart
  22. 2
      example/pubspec.lock
  23. 2
      ios/Classes/BaseCallback.swift
  24. 32
      ios/Classes/Module/ConversationManager.swift
  25. 87
      ios/Classes/Module/FriendshipManager.swift
  26. 127
      ios/Classes/Module/GroupManager.swift
  27. 56
      ios/Classes/Module/IMManager.swift
  28. 106
      ios/Classes/Module/MessageManager.swift
  29. 43
      ios/Classes/Module/UserManager.swift
  30. 4
      ios/Classes/SwiftFlutterOpenimSdkPlugin.swift
  31. 2
      ios/Framework/OpenIMCore.framework/Headers/OpenIMCore.h
  32. 1790
      ios/Framework/OpenIMCore.framework/Headers/Open_im_sdk.objc.h
  33. 1
      ios/Framework/OpenIMCore.framework/Modules/module.modulemap
  34. BIN
      ios/Framework/OpenIMCore.framework/OpenIMCore
  35. 40
      ios/Framework/OpenIMCore.xcframework/Info.plist
  36. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/OpenIMCore.h
  37. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Open_im_sdk.objc.h
  38. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Universe.objc.h
  39. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/ref.h
  40. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Modules/module.modulemap
  41. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/OpenIMCore
  42. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Resources/Info.plist
  43. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h
  44. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h
  45. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h
  46. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/ref.h
  47. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Modules/module.modulemap
  48. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/OpenIMCore
  49. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Resources/Info.plist
  50. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h
  51. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h
  52. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h
  53. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/ref.h
  54. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Modules/module.modulemap
  55. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/OpenIMCore
  56. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Resources/Info.plist
  57. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/OpenIMCore.h
  58. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Open_im_sdk.objc.h
  59. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Universe.objc.h
  60. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/ref.h
  61. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Modules/module.modulemap
  62. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/OpenIMCore
  63. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Resources/Info.plist
  64. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h
  65. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h
  66. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h
  67. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/ref.h
  68. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Modules/module.modulemap
  69. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/OpenIMCore
  70. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Resources/Info.plist
  71. 15
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h
  72. 206
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h
  73. 29
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h
  74. 35
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/ref.h
  75. 9
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Modules/module.modulemap
  76. BIN
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/OpenIMCore
  77. 6
      ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Resources/Info.plist
  78. 6
      lib/flutter_openim_sdk.dart
  79. 17
      lib/src/enum/listener_type.dart
  80. 7
      lib/src/listener/connect_listener.dart
  81. 18
      lib/src/listener/friendship_listener.dart
  82. 28
      lib/src/listener/group_listener.dart
  83. 12
      lib/src/listener/impl/connect_listener.dart
  84. 96
      lib/src/listener/impl/friendship_listener.dart
  85. 132
      lib/src/listener/impl/group_listener.dart
  86. 6
      lib/src/listener/impl/msg_send_progress_listener.dart
  87. 12
      lib/src/listener/impl/user_listener.dart
  88. 2
      lib/src/listener/msg_send_progress_listener.dart
  89. 6
      lib/src/listener/user_listener.dart
  90. 101
      lib/src/manager/im_conversation_manager.dart
  91. 189
      lib/src/manager/im_friendship_manager.dart
  92. 178
      lib/src/manager/im_group_manager.dart
  93. 339
      lib/src/manager/im_manager.dart
  94. 198
      lib/src/manager/im_message_manager.dart
  95. 95
      lib/src/manager/im_user_manager.dart
  96. 23
      lib/src/models/conversation_info.dart
  97. 365
      lib/src/models/group_info.dart
  98. 118
      lib/src/models/message.dart
  99. 421
      lib/src/models/user_info.dart

@ -41,5 +41,5 @@ android {
} }
} }
dependencies { dependencies {
implementation 'io.openim:client-sdk:1.4.5@aar' implementation 'io.openim:client-sdk:1.5.4@aar'
} }

@ -18,6 +18,7 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
import io.openim.flutter_openim_sdk.manager.GroupManager; import io.openim.flutter_openim_sdk.manager.GroupManager;
import io.openim.flutter_openim_sdk.manager.IMManager; import io.openim.flutter_openim_sdk.manager.IMManager;
import io.openim.flutter_openim_sdk.manager.MessageManager; import io.openim.flutter_openim_sdk.manager.MessageManager;
import io.openim.flutter_openim_sdk.manager.UserManager;
/** /**
@ -31,6 +32,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
public static MethodChannel channel; public static MethodChannel channel;
private static IMManager imManager; private static IMManager imManager;
private static UserManager userManager;
private static FriendshipManager friendshipManager; private static FriendshipManager friendshipManager;
private static MessageManager messageManager; private static MessageManager messageManager;
private static ConversationManager conversationManager; private static ConversationManager conversationManager;
@ -41,6 +43,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
private FlutterOpenimSdkPlugin(Context context) { private FlutterOpenimSdkPlugin(Context context) {
FlutterOpenimSdkPlugin.imManager = new IMManager(); FlutterOpenimSdkPlugin.imManager = new IMManager();
FlutterOpenimSdkPlugin.userManager = new UserManager();
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager(); FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
FlutterOpenimSdkPlugin.messageManager = new MessageManager(); FlutterOpenimSdkPlugin.messageManager = new MessageManager();
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager(); FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();

@ -1,52 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnFriendshipListener;
public class FriendshipListener implements OnFriendshipListener {
@Override
public void onBlackListAdd(String s) {
CommonUtil.emitEvent("friendListener", "onBlackListAdd", s);
}
@Override
public void onBlackListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onBlackListDeleted", s);
}
@Override
public void onFriendApplicationListAccept(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAccept", s);
}
@Override
public void onFriendApplicationListAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAdded", s);
}
@Override
public void onFriendApplicationListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListDeleted", s);
}
@Override
public void onFriendApplicationListReject(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListReject", s);
}
@Override
public void onFriendInfoChanged(String s) {
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
}
@Override
public void onFriendListAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendListAdded", s);
}
@Override
public void onFriendListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendListDeleted", s);
}
}

@ -1,79 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import android.util.ArrayMap;
import java.util.HashMap;
import java.util.Map;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnGroupListener;
public class GroupListener implements OnGroupListener {
@Override
public void onApplicationProcessed(String s, String s1, int i, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("agreeOrReject", i);
map.put("opReason", s2);
CommonUtil.emitEvent("groupListener", "onApplicationProcessed", map);
}
@Override
public void onGroupCreated(String s) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
}
@Override
public void onGroupInfoChanged(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("groupInfo", s1);
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
}
@Override
public void onMemberEnter(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("memberList", s1);
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
}
@Override
public void onMemberInvited(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("memberList", s2);
CommonUtil.emitEvent("groupListener", "onMemberInvited", map);
}
@Override
public void onMemberKicked(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("memberList", s2);
CommonUtil.emitEvent("groupListener", "onMemberKicked", map);
}
@Override
public void onMemberLeave(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("member", s1);
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
}
@Override
public void onReceiveJoinApplication(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("member", s1);
map.put("opReason", s2);
CommonUtil.emitEvent("groupListener", "onReceiveJoinApplication", map);
}
}

@ -5,13 +5,12 @@ import android.util.ArrayMap;
import java.util.Map; import java.util.Map;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnAdvancedMsgListener;
public class AdvancedMsgListener implements OnAdvancedMsgListener { public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsgListener {
// final Map<String, String> values = new HashMap<>(); // final Map<String, String> values = new HashMap<>();
private final String id; private final String id;
public AdvancedMsgListener(String listenerId) { public OnAdvancedMsgListener(String listenerId) {
this.id = listenerId; this.id = listenerId;
// this.values.put("id", listenerId); // this.values.put("id", listenerId);
} }

@ -1,28 +1,25 @@
package io.openim.flutter_openim_sdk.listener; package io.openim.flutter_openim_sdk.listener;
import io.flutter.Log;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Base; import open_im_sdk_callback.Base;
public class BaseListener implements Base { public class OnBaseListener implements Base {
MethodChannel.Result result; MethodChannel.Result result;
public BaseListener(MethodChannel.Result result) { public OnBaseListener(MethodChannel.Result result) {
this.result = result; this.result = result;
} }
@Override @Override
public void onError(long l, String s) { public void onError(int l, String s) {
// Log.e("F-OpenIMSD(callback)", s);
CommonUtil.runMainThreadReturnError(result, l, s, null); CommonUtil.runMainThreadReturnError(result, l, s, null);
} }
@Override @Override
public void onSuccess(String s) { public void onSuccess(String s) {
// Log.i("F-OpenIMSDK(callback)", s);
CommonUtil.runMainThreadReturn(result, s); CommonUtil.runMainThreadReturn(result, s);
} }
} }

@ -0,0 +1,34 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnConnListener implements open_im_sdk_callback.OnConnListener {
@Override
public void onConnectFailed(int i, String s) {
CommonUtil.emitEvent("connectListener", "onConnectFailed", i, s, null);
}
@Override
public void onConnectSuccess() {
CommonUtil.emitEvent("connectListener", "onConnectSuccess", null);
}
@Override
public void onConnecting() {
CommonUtil.emitEvent("connectListener", "onConnecting", null);
}
@Override
public void onKickedOffline() {
CommonUtil.emitEvent("connectListener", "onKickedOffline", null);
}
@Override
public void onUserTokenExpired() {
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
}
}

@ -1,10 +1,9 @@
package io.openim.flutter_openim_sdk.listener; package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnConversationListener;
public class ConversationListener implements OnConversationListener {
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
@Override @Override
public void onConversationChanged(String s) { public void onConversationChanged(String s) {

@ -0,0 +1,76 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
/**
* 申请添加好友
* 主动申请者收到OnFriendApplicationAdded
* 被添加者收到OnFriendApplicationAdded ok 111加222
* <p>
* 同意好友申请
* 操作者收到 OnFriendApplicationAccepted OnFriendAdded
* 申请者收到OnFriendApplicationAccepted OnFriendAdded ok
* <p>
* 好友拒绝申请
* 操作者收到OnFriendApplicationRejected
* 申请者收到OnFriendApplicationRejected ok
* <p>
* 删除好友
* 操作者收到OnFriendDeleted ok
* <p>
* 修改备注
* 操作者收到OnFriendInfoChanged ok
* <p>
* 添加黑名单
* 操作者收到OnBlackAdded ok
* <p>
* 移除黑名单
* 操作者收到OnBlackDeleted ok
*/
public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipListener {
@Override
public void onBlackAdded(String s) {
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
}
@Override
public void onBlackDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
}
@Override
public void onFriendAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendAdded", s);
}
@Override
public void onFriendApplicationAccepted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationAccepted", s);
}
@Override
public void onFriendApplicationAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationAdded", s);
}
@Override
public void onFriendApplicationDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationDeleted", s);
}
@Override
public void onFriendApplicationRejected(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationRejected", s);
}
@Override
public void onFriendDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendDeleted", s);
}
@Override
public void onFriendInfoChanged(String s) {
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
}
}

@ -0,0 +1,97 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
/**
* 创建群
* 初始成员收到OnJoinedGroupAdded 验证ok 1111 创建 2222
* <p>
* 退出群
* 退出者收到OnJoinedGroupDeleted
* 群成员收到OnGroupMemberDeleted 2222退出群 验证ok
* <p>
* 踢出群
* 被踢者收到OnJoinedGroupDeleted
* 群成员收到OnGroupMemberDeleted 验证ok
* <p>
* 邀请进群
* 被邀请者收到OnJoinedGroupAdded
* 群成员不包括被邀请者收到OnGroupMemberAdded 1111邀请2222 验证ok
* <p>
* 申请加群
* 申请者收到OnGroupApplicationAdded
* 群主+管理员收到OnReceiveJoinGroupApplicationAdded 验证ok
* <p>
* 同意进群
* 申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
* 群成员不包括申请者收到OnGroupMemberAdded
* 审批者群主或者管理员收到OnGroupMemberAdded OnGroupApplicationAccepted 验证ok
* <p>
* 拒绝进群
* 申请者收到OnGroupApplicationRejected
* 审批者群主或者管理员收到OnGroupApplicationRejected 验证ok
* <p>
* 修改群资料 群成员收到 OnGroupInfoChanged 验证ok
*/
public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
@Override
public void onGroupApplicationAccepted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationAccepted", s);
}
@Override
public void onGroupApplicationAdded(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationAdded", s);
}
@Override
public void onGroupApplicationDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationDeleted", s);
}
@Override
public void onGroupApplicationRejected(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
}
@Override
public void onGroupInfoChanged(String s) {
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s);
}
@Override
public void onGroupMemberAdded(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberAdded", s);
}
@Override
public void onGroupMemberDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberDeleted", s);
}
@Override
public void onGroupMemberInfoChanged(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberInfoChanged", s);
}
@Override
public void onJoinedGroupAdded(String s) {
CommonUtil.emitEvent("groupListener", "onJoinedGroupAdded", s);
}
@Override
public void onJoinedGroupDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onJoinedGroupDeleted", s);
}
@Override
public void onReceiveJoinGroupApplicationAdded(String s) {
CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationAdded", s);
}
@Override
public void onReceiveJoinGroupApplicationDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationDeleted", s);
}
}

@ -7,14 +7,14 @@ import java.util.Map;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.SendMsgCallBack; import open_im_sdk_callback.SendMsgCallBack;
public class MsgSendProgressListener implements SendMsgCallBack { public class OnMsgSendListener implements SendMsgCallBack {
final private MethodChannel.Result result; final private MethodChannel.Result result;
// final private MethodCall call; // final private MethodCall call;
final private Object clientMsgID; final private Object clientMsgID;
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) { public OnMsgSendListener(MethodChannel.Result result, MethodCall call) {
this.result = result; this.result = result;
// this.call = call; // this.call = call;
Map<String, Object> args = call.argument("message"); Map<String, Object> args = call.argument("message");
@ -22,7 +22,7 @@ public class MsgSendProgressListener implements SendMsgCallBack {
} }
@Override @Override
public void onError(long l, String s) { public void onError(int l, String s) {
CommonUtil.runMainThreadReturnError(result, l, s, null); CommonUtil.runMainThreadReturnError(result, l, s, null);
} }

@ -0,0 +1,14 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnUserListener implements open_im_sdk_callback.OnUserListener {
/**
* 登录用户个人资料有变化时回调
*/
@Override
public void onSelfInfoUpdated(String s) {
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
}
}

@ -1,38 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.IMSDKListener;
public class SDKListener implements IMSDKListener {
@Override
public void onConnectFailed(long l, String s) {
CommonUtil.emitEvent("initSDKListener", "onConnectFailed", l, s, null);
}
@Override
public void onConnectSuccess() {
CommonUtil.emitEvent("initSDKListener", "onConnectSuccess", null);
}
@Override
public void onConnecting() {
CommonUtil.emitEvent("initSDKListener", "onConnecting", null);
}
@Override
public void onKickedOffline() {
CommonUtil.emitEvent("initSDKListener", "onKickedOffline", null);
}
@Override
public void onSelfInfoUpdated(String s) {
CommonUtil.emitEvent("initSDKListener", "onSelfInfoUpdated", s);
}
@Override
public void onUserTokenExpired() {
CommonUtil.emitEvent("initSDKListener", "onUserTokenExpired", null);
}
}

@ -2,74 +2,98 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.ConversationListener; import io.openim.flutter_openim_sdk.listener.OnConversationListener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
public class ConversationManager extends BaseManager { public class ConversationManager extends BaseManager {
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) { public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationListener(new ConversationListener()); Open_im_sdk.setConversationListener(new OnConversationListener());
} }
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) { public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getAllConversationList(new BaseListener(result)); Open_im_sdk.getAllConversationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) { public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationListSplit(new BaseListener(result), Open_im_sdk.getConversationListSplit(
new OnBaseListener(result),
value(methodCall, "operationID"),
int2long(methodCall, "offset"), int2long(methodCall, "offset"),
int2long(methodCall, "count")); int2long(methodCall, "count")
);
} }
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) { public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getOneConversation( Open_im_sdk.getOneConversation(
value(methodCall, "sourceID"), new OnBaseListener(result),
value(methodCall, "operationID"),
int2long(methodCall, "sessionType"), int2long(methodCall, "sessionType"),
new BaseListener(result)); value(methodCall, "sourceID")
);
} }
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) { public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMultipleConversation( Open_im_sdk.getMultipleConversation(
jsonValue(methodCall, "conversationIDList"), new OnBaseListener(result),
new BaseListener(result)); value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList")
);
} }
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) { public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteConversation( Open_im_sdk.deleteConversation(
value(methodCall, "conversationID"), new OnBaseListener(result),
new BaseListener(result)); value(methodCall, "operationID"),
value(methodCall, "conversationID")
);
} }
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) { public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationDraft( Open_im_sdk.setConversationDraft(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "conversationID"), value(methodCall, "conversationID"),
value(methodCall, "draftText"), value(methodCall, "draftText")
new BaseListener(result)); );
} }
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) { public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.pinConversation( Open_im_sdk.pinConversation(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "conversationID"), value(methodCall, "conversationID"),
value(methodCall, "isPinned"), value(methodCall, "isPinned")
new BaseListener(result)); );
} }
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) { // public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markSingleMessageHasRead( // Open_im_sdk.markSingleMessageHasRead(
new BaseListener(result), // new OnBaseListener(result),
value(methodCall, "userID")); // value(methodCall, "operationID"),
} // value(methodCall, "userID")
// );
// }
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) { public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markGroupMessageHasRead( Open_im_sdk.markGroupMessageHasRead(
new BaseListener(result), new OnBaseListener(result),
value(methodCall, "groupID")); value(methodCall, "operationID"),
value(methodCall, "groupID")
);
} }
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) { public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result)); Open_im_sdk.getTotalUnreadMsgCount(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) { public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
@ -80,7 +104,8 @@ public class ConversationManager extends BaseManager {
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) { public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationRecvMessageOpt( Open_im_sdk.setConversationRecvMessageOpt(
new BaseListener(result), new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList"), jsonValue(methodCall, "conversationIDList"),
int2long(methodCall, "status") int2long(methodCall, "status")
); );
@ -88,7 +113,8 @@ public class ConversationManager extends BaseManager {
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) { public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationRecvMessageOpt( Open_im_sdk.getConversationRecvMessageOpt(
new BaseListener(result), new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList") jsonValue(methodCall, "conversationIDList")
); );
} }

@ -2,72 +2,115 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.FriendshipListener; import io.openim.flutter_openim_sdk.listener.OnFriendshipListener;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
public class FriendshipManager extends BaseManager { public class FriendshipManager extends BaseManager {
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) { public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendListener(new FriendshipListener()); Open_im_sdk.setFriendListener(new OnFriendshipListener());
} }
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) { public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendsInfo(new BaseListener(result), Open_im_sdk.getDesignatedFriendsInfo(
jsonValue(methodCall, "uidList")); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
} }
public void addFriend(MethodCall methodCall, MethodChannel.Result result) { public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addFriend(new BaseListener(result), Open_im_sdk.addFriend(
jsonValue(methodCall)); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) { public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendApplicationList(new BaseListener(result)); Open_im_sdk.getRecvFriendApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSendFriendApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) { public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendList(new BaseListener(result)); Open_im_sdk.getFriendList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) { public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendInfo( Open_im_sdk.setFriendRemark(
jsonValue(methodCall), new BaseListener(result)); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) { public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addToBlackList(new BaseListener(result), Open_im_sdk.addBlack(
jsonValue(methodCall, "uid")); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
} }
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) { public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getBlackList(new BaseListener(result)); Open_im_sdk.getBlackList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) { public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFromBlackList(new BaseListener(result), Open_im_sdk.removeBlack(
jsonValue(methodCall, "uid")); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
} }
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) { public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.checkFriend(new BaseListener(result), Open_im_sdk.checkFriend(
jsonValue(methodCall, "uidList")); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
} }
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) { public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFromFriendList( Open_im_sdk.deleteFriend(
jsonValue(methodCall, "uid"), new BaseListener(result)); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
} }
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) { public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptFriendApplication(new BaseListener(result), Open_im_sdk.acceptFriendApplication(
jsonValue(methodCall, "uid")); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) { public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseFriendApplication(new BaseListener(result), Open_im_sdk.refuseFriendApplication(
jsonValue(methodCall, "uid")); new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) { // public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {

@ -2,104 +2,149 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.GroupListener; import io.openim.flutter_openim_sdk.listener.OnGroupListener;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
public class GroupManager extends BaseManager { public class GroupManager extends BaseManager {
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) { public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupListener(new GroupListener()); Open_im_sdk.setGroupListener(new OnGroupListener());
} }
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) { public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.inviteUserToGroup( Open_im_sdk.inviteUserToGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
value(methodCall, "reason"), value(methodCall, "reason"),
jsonValue(methodCall, "uidList"), jsonValue(methodCall, "uidList")
new BaseListener(result)); );
} }
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) { public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.kickGroupMember( Open_im_sdk.kickGroupMember(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
value(methodCall, "reason"), value(methodCall, "reason"),
jsonValue(methodCall, "uidList"), jsonValue(methodCall, "uidList")
new BaseListener(result)); );
} }
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) { public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMembersInfo( Open_im_sdk.getGroupMembersInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
jsonValue(methodCall, "uidList"), jsonValue(methodCall, "uidList")
new BaseListener(result)); );
} }
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) { public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberList( Open_im_sdk.getGroupMemberList(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
value(methodCall, "filter"), value(methodCall, "filter"),
value(methodCall, "next"), value(methodCall, "offset"),
new BaseListener(result)); value(methodCall, "count")
);
} }
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) { public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getJoinedGroupList(new BaseListener(result)); Open_im_sdk.getJoinedGroupList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void createGroup(MethodCall methodCall, MethodChannel.Result result) { public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.createGroup( Open_im_sdk.createGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "gInfo"), jsonValue(methodCall, "gInfo"),
jsonValue(methodCall, "memberList"), jsonValue(methodCall, "memberList")
new BaseListener(result)); );
} }
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) { public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupInfo(jsonValue(methodCall, "gInfo"), new BaseListener(result)); Open_im_sdk.setGroupInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
jsonValue(methodCall, "gInfo")
);
} }
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) { public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupsInfo(jsonValue(methodCall, "gidList"), new BaseListener(result)); Open_im_sdk.getGroupsInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "gidList")
);
} }
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) { public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.joinGroup( Open_im_sdk.joinGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
value(methodCall, "reason"), value(methodCall, "reason")
new BaseListener(result)); );
} }
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) { public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.quitGroup( Open_im_sdk.quitGroup(
value(methodCall, "gid"), new OnBaseListener(result),
new BaseListener(result)); value(methodCall, "operationID"),
value(methodCall, "gid")
);
} }
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) { public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.transferGroupOwner( Open_im_sdk.transferGroupOwner(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"), value(methodCall, "gid"),
value(methodCall, "uid"), value(methodCall, "uid")
new BaseListener(result)); );
}
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getRecvGroupApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void getGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) { public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupApplicationList(new BaseListener(result)); Open_im_sdk.getSendGroupApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) { public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptGroupApplication( Open_im_sdk.acceptGroupApplication(
jsonValue(methodCall, "application"), new OnBaseListener(result),
value(methodCall, "reason"), value(methodCall, "operationID"),
new BaseListener(result)); value(methodCall, "gid"),
value(methodCall, "uid"),
value(methodCall, "handleMsg")
);
} }
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) { public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseGroupApplication( Open_im_sdk.refuseGroupApplication(
jsonValue(methodCall, "application"), new OnBaseListener(result),
value(methodCall, "reason"), value(methodCall, "operationID"),
new BaseListener(result)); value(methodCall, "gid"),
value(methodCall, "uid"),
value(methodCall, "handleMsg")
);
} }

@ -2,8 +2,8 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.SDKListener; import io.openim.flutter_openim_sdk.listener.OnConnListener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
@ -11,18 +11,27 @@ public class IMManager extends BaseManager {
public void initSDK(MethodCall methodCall, MethodChannel.Result result) { public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK( CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
jsonValue(methodCall), new SDKListener())); new OnConnListener(),
value(methodCall, "operationID"),
jsonValue(methodCall))
);
// CommonUtil.runMainThreadReturn(result, null); // CommonUtil.runMainThreadReturn(result, null);
} }
public void login(MethodCall methodCall, MethodChannel.Result result) { public void login(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.login( Open_im_sdk.login(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid"), value(methodCall, "uid"),
value(methodCall, "token"), new BaseListener(result)); value(methodCall, "token")
);
} }
public void logout(MethodCall methodCall, MethodChannel.Result result) { public void logout(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.logout(new BaseListener(result)); Open_im_sdk.logout(
new OnBaseListener(result),
value(methodCall, "operationID")
);
} }
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) { public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
@ -33,25 +42,25 @@ public class IMManager extends BaseManager {
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid()); // CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
// } // }
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) { // public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfo( // Open_im_sdk.getUsersInfo(
jsonValue(methodCall, "uidList"), new BaseListener(result)); // jsonValue(methodCall, "uidList"), new BaseListener(result));
} // }
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) { // public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfo( // Open_im_sdk.setSelfInfo(
jsonValue(methodCall), new BaseListener(result)); // jsonValue(methodCall), new BaseListener(result));
} // }
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) { // public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.forceSyncLoginUerInfo(); // Open_im_sdk.forceSyncLoginUerInfo();
} // }
// public void forceReConn(MethodCall methodCall, MethodChannel.Result result) { // public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceReConn(); // Open_im_sdk.forceReConn();
// } // }
public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) { // public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSdkLog(value(methodCall, "sdkLog")); // Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
} // }
} }

@ -1,28 +1,24 @@
package io.openim.flutter_openim_sdk.manager; package io.openim.flutter_openim_sdk.manager;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.AdvancedMsgListener; import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.BaseListener; import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.MsgSendProgressListener; import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnAdvancedMsgListener;
import open_im_sdk.Open_im_sdk; import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager { public class MessageManager extends BaseManager {
private final static String KEY_ID = "id"; private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>(); // private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
private static boolean initializedListener = false; /* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>(); private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
// protected void clearListeners() { protected void clearListeners() {
// initializedListener = false; initializedListener = false;
// listeners.clear(); listeners.clear();
// } }
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() { private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
@Override @Override
@ -50,21 +46,21 @@ public class MessageManager extends BaseManager {
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID); String key = methodCall.argument(KEY_ID);
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key)); Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
// listeners.put(key, new AdvancedMsgListener(key)); listeners.put(key, new AdvancedMsgListener(key));
// if (!initializedListener) { if (!initializedListener) {
// initializedListener = true; initializedListener = true;
// Open_im_sdk.addAdvancedMsgListener(sdkMsgListener); Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
// } }
} }
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
// String key = methodCall.argument(KEY_ID); String key = methodCall.argument(KEY_ID);
// listeners.remove(key); listeners.remove(key);
// if (listeners.isEmpty()) { if (listeners.isEmpty()) {
// initializedListener = false; initializedListener = false;
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener); Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
// } }
} }*/
/* /*
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
@ -83,63 +79,93 @@ public class MessageManager extends BaseManager {
} }
*/ */
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
}
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) { public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall); Open_im_sdk.sendMessage(
Open_im_sdk.sendMessage(listener, new OnMsgSendListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"), jsonValue(methodCall, "message"),
value(methodCall, "userID"), value(methodCall, "userID"),
value(methodCall, "groupID"), value(methodCall, "groupID"),
value(methodCall, "onlineUserOnly")); jsonValue(methodCall, "offlinePushInfo")
);
} }
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) { public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getHistoryMessageList(new BaseListener(result), jsonValue(methodCall)); Open_im_sdk.getHistoryMessageList(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) { public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.revokeMessage(new BaseListener(result), jsonValue(methodCall)); Open_im_sdk.revokeMessage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) { public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), jsonValue(methodCall)); Open_im_sdk.deleteMessageFromLocalStorage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
} }
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) { // public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.deleteMessages(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall)); // Open_im_sdk.deleteMessages(new OnBaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
} // }
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) { public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result), Open_im_sdk.insertSingleMessageToLocalStorage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"), jsonValue(methodCall, "message"),
value(methodCall, "receiverID"), value(methodCall, "receiverID"),
value(methodCall, "senderID")); value(methodCall, "senderID")
);
} }
public void findMessages(MethodCall methodCall, MethodChannel.Result result) { // public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.findMessages(new BaseListener(result), jsonValue(methodCall, "messageIDList")); // Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList"));
} // }
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) { public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markC2CMessageAsRead(new BaseListener(result), Open_im_sdk.markC2CMessageAsRead(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID"), value(methodCall, "userID"),
jsonValue(methodCall, "messageIDList")); jsonValue(methodCall, "messageIDList")
);
} }
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) { public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.typingStatusUpdate(value(methodCall, "userID"), Open_im_sdk.typingStatusUpdate(
value(methodCall, "typing")); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID"),
value(methodCall, "msgTip")
);
} }
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) { public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createTextMessage( Open_im_sdk.createTextMessage(
value(methodCall, "operationID"),
value(methodCall, "text"))); value(methodCall, "text")));
} }
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) { public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createTextAtMessage( Open_im_sdk.createTextAtMessage(
value(methodCall, "operationID"),
value(methodCall, "text"), value(methodCall, "text"),
jsonValue(methodCall, "atUserList"))); jsonValue(methodCall, "atUserList")));
} }
@ -147,17 +173,20 @@ public class MessageManager extends BaseManager {
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) { public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessage( Open_im_sdk.createImageMessage(
value(methodCall, "operationID"),
value(methodCall, "imagePath"))); value(methodCall, "imagePath")));
} }
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageFromFullPath( Open_im_sdk.createImageMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "imagePath"))); value(methodCall, "imagePath")));
} }
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) { public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessage( Open_im_sdk.createSoundMessage(
value(methodCall, "operationID"),
value(methodCall, "soundPath"), value(methodCall, "soundPath"),
int2long(methodCall, "duration"))); int2long(methodCall, "duration")));
} }
@ -165,6 +194,7 @@ public class MessageManager extends BaseManager {
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessageFromFullPath( Open_im_sdk.createSoundMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "soundPath"), value(methodCall, "soundPath"),
int2long(methodCall, "duration"))); int2long(methodCall, "duration")));
} }
@ -172,6 +202,7 @@ public class MessageManager extends BaseManager {
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) { public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessage( Open_im_sdk.createVideoMessage(
value(methodCall, "operationID"),
value(methodCall, "videoPath"), value(methodCall, "videoPath"),
value(methodCall, "videoType"), value(methodCall, "videoType"),
int2long(methodCall, "duration"), int2long(methodCall, "duration"),
@ -181,6 +212,7 @@ public class MessageManager extends BaseManager {
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessageFromFullPath( Open_im_sdk.createVideoMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "videoPath"), value(methodCall, "videoPath"),
value(methodCall, "videoType"), value(methodCall, "videoType"),
int2long(methodCall, "duration"), int2long(methodCall, "duration"),
@ -190,6 +222,7 @@ public class MessageManager extends BaseManager {
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) { public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessage( Open_im_sdk.createFileMessage(
value(methodCall, "operationID"),
value(methodCall, "filePath"), value(methodCall, "filePath"),
value(methodCall, "fileName"))); value(methodCall, "fileName")));
} }
@ -197,6 +230,7 @@ public class MessageManager extends BaseManager {
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessageFromFullPath( Open_im_sdk.createFileMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "filePath"), value(methodCall, "filePath"),
value(methodCall, "fileName"))); value(methodCall, "fileName")));
} }
@ -204,6 +238,7 @@ public class MessageManager extends BaseManager {
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) { public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createMergerMessage( Open_im_sdk.createMergerMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList"), jsonValue(methodCall, "messageList"),
value(methodCall, "title"), value(methodCall, "title"),
jsonValue(methodCall, "summaryList"))); jsonValue(methodCall, "summaryList")));
@ -213,11 +248,13 @@ public class MessageManager extends BaseManager {
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) { public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createForwardMessage( Open_im_sdk.createForwardMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "message"))); jsonValue(methodCall, "message")));
} }
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) { public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage( CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
value(methodCall, "operationID"),
value(methodCall, "description"), value(methodCall, "description"),
value(methodCall, "longitude"), value(methodCall, "longitude"),
value(methodCall, "latitude") value(methodCall, "latitude")
@ -226,6 +263,7 @@ public class MessageManager extends BaseManager {
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) { public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage( CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
value(methodCall, "operationID"),
value(methodCall, "data"), value(methodCall, "data"),
value(methodCall, "extension"), value(methodCall, "extension"),
value(methodCall, "description") value(methodCall, "description")
@ -234,6 +272,7 @@ public class MessageManager extends BaseManager {
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) { public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage( CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
value(methodCall, "operationID"),
value(methodCall, "quoteText"), value(methodCall, "quoteText"),
jsonValue(methodCall, "quoteMessage") jsonValue(methodCall, "quoteMessage")
)); ));
@ -241,21 +280,28 @@ public class MessageManager extends BaseManager {
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) { public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage( CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "cardMessage") jsonValue(methodCall, "cardMessage")
)); ));
} }
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) { // public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.forceSyncMsg(); // Open_im_sdk.forceSyncMsg();
} // }
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) { public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearC2CHistoryMessage(new BaseListener(result), Open_im_sdk.clearC2CHistoryMessage(
value(methodCall, "userID")); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID")
);
} }
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) { public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearGroupHistoryMessage(new BaseListener(result), Open_im_sdk.clearGroupHistoryMessage(
value(methodCall, "groupID")); new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
} }
} }

@ -0,0 +1,35 @@
package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnUserListener;
import open_im_sdk.Open_im_sdk;
public class UserManager extends BaseManager {
public void setUserListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setUserListener(new OnUserListener());
}
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList"));
}
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall));
}
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSelfUserInfo(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
}

@ -32,7 +32,7 @@ public class CommonUtil {
runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails); runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails);
} }
public synchronized static <T> void emitEvent(String method, String type, Long errCode, String errMsg, T data) { public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
runMainThread(() -> { runMainThread(() -> {
Map<String, Object> res = new ArrayMap<>(); Map<String, Object> res = new ArrayMap<>();
if (null != type) { if (null != type) {

@ -36,7 +36,6 @@ class _MyAppState extends State<MyApp> {
} }
void _login() { void _login() {
if (OpenIM.iMManager.isInitialized)
OpenIM.iMManager.login(uid: '', token: ''); OpenIM.iMManager.login(uid: '', token: '');
} }
@ -45,64 +44,27 @@ class _MyAppState extends State<MyApp> {
OpenIM.iMManager OpenIM.iMManager
..initSDK( ..initSDK(
platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios, platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios,
ipApi: '', apiAddr: '',
ipWs: '', wsAddr: '',
dbPath: '', dataDir: '',
listener: OnInitSDKListener( listener: OnConnectListener(),
onConnecting: () {},
onConnectFailed: (code, error) {},
onConnectSuccess: () {},
onKickedOffline: () {},
onUserSigExpired: () {},
onSelfInfoUpdated: (user) {},
),
) )
//
..userManager.setUserListener(OnUserListener())
// Add message listener (remove when not in use) // Add message listener (remove when not in use)
..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener( ..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener())
onRecvMessageRevoked: (msgId) {},
onRecvC2CReadReceipt: (list) {},
onRecvNewMessage: (msg) {},
))
// Set up message sending progress listener // Set up message sending progress listener
..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener( ..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener())
onProgress: (msgId, progress) {},
))
// Set up friend relationship listener // Set up friend relationship listener
..friendshipManager.setFriendshipListener(OnFriendshipListener( ..friendshipManager.setFriendshipListener(OnFriendshipListener())
onBlackListAdd: (u) {},
onBlackListDeleted: (u) {},
onFriendApplicationListAccept: (u) {},
onFriendApplicationListAdded: (u) {},
onFriendApplicationListDeleted: (u) {},
onFriendApplicationListReject: (u) {},
onFriendInfoChanged: (u) {},
onFriendListAdded: (u) {},
onFriendListDeleted: (u) {},
))
// Set up conversation listener // Set up conversation listener
..conversationManager.setConversationListener(OnConversationListener( ..conversationManager.setConversationListener(OnConversationListener())
onConversationChanged: (list) {},
onNewConversation: (list) {},
onTotalUnreadMessageCountChanged: (count) {},
onSyncServerFailed: () {},
onSyncServerFinish: () {},
onSyncServerStart: () {},
))
// Set up group listener // Set up group listener
..groupManager.setGroupListener(OnGroupListener( ..groupManager.setGroupListener(OnGroupListener(
onApplicationProcessed: (groupId, opUser, agreeOrReject, opReason) {},
onGroupCreated: (groupId) {},
onGroupInfoChanged: (groupId, info) {},
onMemberEnter: (groupId, list) {},
onMemberInvited: (groupId, opUser, list) {},
onMemberKicked: (groupId, opUser, list) {},
onMemberLeave: (groupId, info) {},
onReceiveJoinApplication: (groupId, info, opReason) {},
)); ));
} }
} }

@ -68,7 +68,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "1.0.9" version: "1.1.1"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter

@ -8,7 +8,7 @@
import Foundation import Foundation
import OpenIMCore import OpenIMCore
public class BaseCallback: NSObject, Open_im_sdkBaseProtocol { public class BaseCallback: NSObject, Open_im_sdk_callbackBaseProtocol {
private let result:FlutterResult private let result:FlutterResult

@ -21,7 +21,7 @@ public class ConversationManager: BaseServiceManager {
self["deleteConversation"] = deleteConversation self["deleteConversation"] = deleteConversation
self["setConversationDraft"] = setConversationDraft self["setConversationDraft"] = setConversationDraft
self["pinConversation"] = pinConversation self["pinConversation"] = pinConversation
self["markSingleMessageHasRead"] = markSingleMessageHasRead // self["markSingleMessageHasRead"] = markSingleMessageHasRead
self["markGroupMessageHasRead"] = markGroupMessageHasRead self["markGroupMessageHasRead"] = markGroupMessageHasRead
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
self["getConversationIDBySessionType"] = getConversationIDBySessionType self["getConversationIDBySessionType"] = getConversationIDBySessionType
@ -35,43 +35,43 @@ public class ConversationManager: BaseServiceManager {
} }
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetAllConversationList(BaseCallback(result: result)) Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[int: "offset"], methodCall[int: "count"]) Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
} }
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result)) Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"])
} }
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMultipleConversation(methodCall[jsonString: "conversationIDList"], BaseCallback(result: result)) Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
} }
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteConversation(methodCall[string: "conversationID"], BaseCallback(result: result)) Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
} }
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationDraft(methodCall[string: "conversationID"], methodCall[string: "draftText"], BaseCallback(result: result)) Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
} }
func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkPinConversation(methodCall[string: "conversationID"], methodCall[bool: "isPinned"], BaseCallback(result: result)) Open_im_sdkPinConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"])
} }
func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ // func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"]) // Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
} // }
func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "groupID"]) Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
} }
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result)) Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -80,16 +80,16 @@ public class ConversationManager: BaseServiceManager {
} }
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"], methodCall[int: "status"]) Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
} }
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"]) Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
} }
} }
public class ConversationListener: NSObject, Open_im_sdkOnConversationListenerProtocol { public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel

@ -15,14 +15,15 @@ public class FriendshipManager: BaseServiceManager {
self["setFriendListener"] = setFriendListener self["setFriendListener"] = setFriendListener
self["getFriendsInfo"] = getFriendsInfo self["getFriendsInfo"] = getFriendsInfo
self["addFriend"] = addFriend self["addFriend"] = addFriend
self["getFriendApplicationList"] = getFriendApplicationList self["getRecvFriendApplicationList"] = getRecvFriendApplicationList
self["getSendFriendApplicationList"] = getSendFriendApplicationList
self["getFriendList"] = getFriendList self["getFriendList"] = getFriendList
self["setFriendInfo"] = setFriendInfo self["setFriendRemark"] = setFriendRemark
self["addToBlackList"] = addToBlackList self["addBlacklist"] = addBlacklist
self["getBlackList"] = getBlackList self["getBlacklist"] = getBlacklist
self["deleteFromBlackList"] = deleteFromBlackList self["removeBlacklist"] = removeBlacklist
self["checkFriend"] = checkFriend self["checkFriend"] = checkFriend
self["deleteFromFriendList"] = deleteFromFriendList self["deleteFriend"] = deleteFriend
self["acceptFriendApplication"] = acceptFriendApplication self["acceptFriendApplication"] = acceptFriendApplication
self["refuseFriendApplication"] = refuseFriendApplication self["refuseFriendApplication"] = refuseFriendApplication
// self["forceSyncFriendApplication"] = forceSyncFriendApplication // self["forceSyncFriendApplication"] = forceSyncFriendApplication
@ -36,51 +37,55 @@ public class FriendshipManager: BaseServiceManager {
} }
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendsInfo(BaseCallback(result: result), methodCall[jsonString: "uidList"]) Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
} }
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall.toJsonString()) Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func getFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendApplicationList(BaseCallback(result: result)) Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
}
func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendList(BaseCallback(result: result)) Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func setFriendInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetFriendInfo(methodCall.toJsonString(), BaseCallback(result: result)) Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func addToBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddToBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"]) Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
} }
func getBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetBlackList(BaseCallback(result: result)) Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func deleteFromBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteFromBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"]) Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
} }
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[jsonString: "uidList"]) Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
} }
func deleteFromFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteFromFriendList(methodCall[jsonString: "uid"], BaseCallback(result: result)) Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
} }
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"]) Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID", methodCall.toJsonString())
} }
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"]) Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID", methodCall.toJsonString())
} }
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ // func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -99,47 +104,47 @@ public class FriendshipManager: BaseServiceManager {
// } // }
} }
public class FriendshipListener: NSObject, Open_im_sdkOnFriendshipListenerProtocol { public class FriendshipListener: NSObject, Open_im_sdk_callbackFriendshipListenerProtocol {
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
self.channel = channel self.channel = channel
} }
public func onBlackListAdd(_ userInfo: String?) { public func onBlackAdded(_ userInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListAdd", errCode: nil, errMsg: nil, data: userInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", errCode: nil, errMsg: nil, data: userInfo)
} }
public func onBlackListDeleted(_ userInfo: String?) { public func onBlackDeleted(_ userInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListDeleted", errCode: nil, errMsg: nil, data: userInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistDeleted", errCode: nil, errMsg: nil, data: userInfo)
} }
public func onFriendApplicationListAccept(_ applyUserInfo: String?) { public func onFriendApplicationAccepted(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAccept", errCode: nil, errMsg: nil, data: applyUserInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAccepted", errCode: nil, errMsg: nil, data: applyUserInfo)
} }
public func onFriendApplicationListAdded(_ applyUserInfo: String?) { public func onFriendApplicationAdded(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAdded", errCode: nil, errMsg: nil, data: applyUserInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAdded", errCode: nil, errMsg: nil, data: applyUserInfo)
} }
public func onFriendApplicationListDeleted(_ applyUserInfo: String?) { public func onFriendApplicationDeleted(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListDeleted", errCode: nil, errMsg: nil, data: applyUserInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationDeleted", errCode: nil, errMsg: nil, data: applyUserInfo)
} }
public func onFriendApplicationListReject(_ applyUserInfo: String?) { public func onFriendApplicationRejected(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListReject", errCode: nil, errMsg: nil, data: applyUserInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationRejected", errCode: nil, errMsg: nil, data: applyUserInfo)
} }
public func onFriendInfoChanged(_ friendInfo: String?) { public func onFriendInfoChanged(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
} }
public func onFriendListAdded(_ friendInfo: String?) { public func onFriendAdded(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListAdded", errCode: nil, errMsg: nil, data: friendInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
} }
public func onFriendListDeleted(_ friendInfo: String?) { public func onFriendDeleted(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListDeleted", errCode: nil, errMsg: nil, data: friendInfo) CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendDeleted", errCode: nil, errMsg: nil, data: friendInfo)
} }
} }

@ -24,7 +24,8 @@ public class GroupManager: BaseServiceManager {
self["joinGroup"] = joinGroup self["joinGroup"] = joinGroup
self["quitGroup"] = quitGroup self["quitGroup"] = quitGroup
self["transferGroupOwner"] = transferGroupOwner self["transferGroupOwner"] = transferGroupOwner
self["getGroupApplicationList"] = getGroupApplicationList self["getRecvGroupApplicationList"] = getRecvGroupApplicationList
self["getSendGroupApplicationList"] = getSendGroupApplicationList
self["acceptGroupApplication"] = acceptGroupApplication self["acceptGroupApplication"] = acceptGroupApplication
self["refuseGroupApplication"] = refuseGroupApplication self["refuseGroupApplication"] = refuseGroupApplication
// self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest // self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest
@ -39,62 +40,66 @@ public class GroupManager: BaseServiceManager {
} }
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInviteUserToGroup(methodCall[string: "gid"], methodCall[string: "reason"], Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
methodCall[jsonString: "uidList"], BaseCallback(result: result)) methodCall[jsonString: "uidList"])
} }
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkKickGroupMember(methodCall[string: "gid"], methodCall[string: "reason"], Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
methodCall[jsonString: "uidList"], BaseCallback(result: result)) methodCall[jsonString: "uidList"])
} }
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMembersInfo(methodCall[string: "gid"], methodCall[jsonString: "uidList"], BaseCallback(result: result)) Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"])
} }
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMemberList(methodCall[string: "gid"], methodCall[int32: "filter"], Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"],
methodCall[int32: "next"], BaseCallback(result: result)) methodCall[int32: "offset"], methodCall[int32: "count"])
} }
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result)) Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCreateGroup(methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"], BaseCallback(result: result)) Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"])
} }
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupInfo(methodCall[jsonString: "gInfo"], BaseCallback(result: result)) Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"])
} }
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupsInfo(methodCall[jsonString: "gidList"], BaseCallback(result: result)) Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"])
} }
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkJoinGroup(methodCall[string: "gid"], methodCall[string: "reason"], BaseCallback(result: result)) Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"])
} }
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkQuitGroup(methodCall[string: "gid"], BaseCallback(result: result)) Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
} }
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkTransferGroupOwner(methodCall[string: "gid"], methodCall[string: "uid"], BaseCallback(result: result)) Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"])
} }
func getGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupApplicationList(BaseCallback(result: result)) Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
}
func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAcceptGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result)) Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
} }
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRefuseGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result)) Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
} }
// func forceSyncApplyGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func forceSyncApplyGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@ -118,7 +123,7 @@ public class GroupManager: BaseServiceManager {
// } // }
} }
public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol { public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
@ -126,73 +131,51 @@ public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol {
self.channel = channel self.channel = channel
} }
public func onApplicationProcessed(_ groupId: String?, opUser: String?, agreeOrReject AgreeOrReject: Int32, opReason: String?) { public func onGroupApplicationAccepted(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
values["groupId"] = groupId }
values["opUser"] = opUser
values["agreeOrReject"] = AgreeOrReject public func onGroupApplicationAdded(_ s: String?) {
values["opReason"] = opReason CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values)
} }
// public func onApplicationProcessed(_ s: String?,s1: String?,i: Int?,s2: String?) { public func onGroupApplicationDeleted(_ s: String?) {
// let values: NSMutableDictionary = NSMutableDictionary(capacity: 0) CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
// values.setValue(s, forKey: "groupId") }
// values.setValue(s1, forKey: "opUser")
// values.setValue(i, forKey: "agreeOrReject") public func onGroupApplicationRejected(_ s: String?) {
// values.setValue(s2, forKey: "opReason") CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
// CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values) }
// }
public func onGroupCreated(_ s: String?) { public func onGroupInfoChanged(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupCreated", errCode: nil, errMsg: nil, data: values)
} }
public func onGroupInfoChanged(_ s: String?, groupInfo s1: String?) { public func onGroupMemberAdded(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["groupInfo"] = s1
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: values)
} }
public func onMemberEnter(_ s: String?, memberList s1: String?) { public func onGroupMemberDeleted(_ s: String?,member s1: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["memberList"] = s1
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberEnter", errCode: nil, errMsg: nil, data: values)
} }
public func onMemberInvited(_ s: String?,opUser s1: String?, memberList s2: String?) { public func onGroupMemberInfoChanged(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["opUser"] = s1
values["memberList"] = s2
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberInvited", errCode: nil, errMsg: nil, data: values)
} }
public func onMemberKicked(_ s: String?,opUser s1: String?,memberList s2: String?) { public func onJoinedGroupAdded(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["opUser"] = s1
values["memberList"] = s2
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberKicked", errCode: nil, errMsg: nil, data: values)
} }
public func onMemberLeave(_ s: String?,member s1: String?) { public func onJoinedGroupDeleted(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupDeleted", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["member"] = s1
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberLeave", errCode: nil, errMsg: nil, data: values)
} }
public func onReceiveJoinApplication(_ s: String?,member s1: String?,opReason s2: String?) { public func onReceiveJoinGroupApplicationAdded(_ s: String?) {
var values: [String: Any] = [:] CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
values["groupId"] = s
values["member"] = s1
values["opReason"] = s2
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinApplication", errCode: nil, errMsg: nil, data: values)
} }
public func onReceiveJoinGroupApplicationDeleted(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
}
} }

@ -18,24 +18,24 @@ public class IMMananger: BaseServiceManager {
self["logout"] = logout self["logout"] = logout
self["getLoginStatus"] = getLoginStatus self["getLoginStatus"] = getLoginStatus
// self["getLoginUid"] = getLoginUid // self["getLoginUid"] = getLoginUid
self["getUsersInfo"] = getUsersInfo // self["getUsersInfo"] = getUsersInfo
self["setSelfInfo"] = setSelfInfo // self["setSelfInfo"] = setSelfInfo
self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo // self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo
// self["forceReConn"] = forceReConn // self["forceReConn"] = forceReConn
self["setSdkLog"] = setSdkLog // self["setSdkLog"] = setSdkLog
} }
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInitSDK(methodCall.toJsonString(), SDKListener(channel: self.channel)) Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString())
callBack(result) callBack(result)
} }
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkLogin(methodCall[string: "uid"], methodCall[string: "token"], BaseCallback(result: result)) Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"])
} }
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkLogout(BaseCallback(result: result)) Open_im_sdkLogout(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@ -46,29 +46,29 @@ public class IMMananger: BaseServiceManager {
// callBack(result, Open_im_sdkGetLoginUser()) // callBack(result, Open_im_sdkGetLoginUser())
// } // }
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result)) // Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result))
} // }
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result)) // Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result))
} // }
func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkForceSyncLoginUerInfo() // Open_im_sdkForceSyncLoginUerInfo()
callBack(result) // callBack(result)
} // }
func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"]) // Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"])
} // }
// func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
// Open_im_sdkForceReConn() // Open_im_sdkForceReConn()
// callBack(result) // callBack(result)
// } // }
} }
public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol { public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
@ -76,26 +76,22 @@ public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol {
} }
public func onConnectFailed(_ errCode: Int, errMsg: String?) { public func onConnectFailed(_ errCode: Int, errMsg: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil) CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
} }
public func onConnectSuccess() { public func onConnectSuccess() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
} }
public func onConnecting() { public func onConnecting() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil)
} }
public func onKickedOffline() { public func onKickedOffline() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil)
}
public func onSelfInfoUpdated(_ userInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
} }
public func onUserTokenExpired() { public func onUserTokenExpired() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
} }
} }

@ -10,20 +10,19 @@ import OpenIMCore
public class MessageManager: BaseServiceManager { public class MessageManager: BaseServiceManager {
private let KEY_ID: String = "id" private let KEY_ID: String = "id"
private var listeners: [String: AdvancedMsgListener] = [:] // private var listeners: [String: AdvancedMsgListener] = [:]
public override func registerHandlers() { public override func registerHandlers() {
super.registerHandlers() super.registerHandlers()
self["addAdvancedMsgListener"] = addAdvancedMsgListener self["setAdvancedMsgListener"] = setAdvancedMsgListener
self["removeAdvancedMsgListener"] = removeAdvancedMsgListener
self["sendMessage"] = sendMessage self["sendMessage"] = sendMessage
self["getHistoryMessageList"] = getHistoryMessageList self["getHistoryMessageList"] = getHistoryMessageList
self["revokeMessage"] = revokeMessage self["revokeMessage"] = revokeMessage
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
self["deleteMessages"] = deleteMessages self["deleteMessages"] = deleteMessages
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
self["findMessages"] = findMessages // self["findMessages"] = findMessages
self["markC2CMessageAsRead"] = markC2CMessageAsRead self["markC2CMessageAsRead"] = markC2CMessageAsRead
self["typingStatusUpdate"] = typingStatusUpdate self["typingStatusUpdate"] = typingStatusUpdate
self["createTextMessage"] = createTextMessage self["createTextMessage"] = createTextMessage
@ -35,56 +34,41 @@ public class MessageManager: BaseServiceManager {
self["createVideoMessage"] = createVideoMessage self["createVideoMessage"] = createVideoMessage
self["createVideoMessageFromFullPath"] = createVideoMessageFromFullPath self["createVideoMessageFromFullPath"] = createVideoMessageFromFullPath
self["createFileMessage"] = createFileMessage self["createFileMessage"] = createFileMessage
self["createFileMessageFromFullPath"] = createFileMessageFromFullPath
self["createMergerMessage"] = createMergerMessage self["createMergerMessage"] = createMergerMessage
self["createForwardMessage"] = createForwardMessage self["createForwardMessage"] = createForwardMessage
self["createLocationMessage"] = createLocationMessage self["createLocationMessage"] = createLocationMessage
self["createCustomMessage"] = createCustomMessage self["createCustomMessage"] = createCustomMessage
self["createQuoteMessage"] = createQuoteMessage self["createQuoteMessage"] = createQuoteMessage
self["createCardMessage"] = createCardMessage self["createCardMessage"] = createCardMessage
self["forceSyncMsg"] = forceSyncMsg // self["forceSyncMsg"] = forceSyncMsg
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
} }
func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let key = methodCall[string: KEY_ID] let key = methodCall[string: KEY_ID]
if listeners[key] == nil { let lis = AdvancedMsgListener(channel: channel, id: key)
let lis = AdvancedMsgListener(channel: channel, id: key) open_im_sdkSetAdvancedMsgListener(lis)
listeners[key] = lis
Open_im_sdkAddAdvancedMsgListener(lis)
print("=================add msg listener======\n\(lis)")
}
callBack(result)
}
func removeAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let key = methodCall[string: KEY_ID]
if let lis = listeners[key] {
listeners[key] = nil
// Open_im_sdkRemoveAdvancedMsgListener(lis)
}
callBack(result) callBack(result)
} }
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall) let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
// sendMsgProgressListener.setCall(methodCall: methodCall) Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
// sendMsgProgressListener.setResult(result: result) methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
print("===============sendMessage===============")
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "userID"],
methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"])
} }
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall.toJsonString()) Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall.toJsonString()) Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall.toJsonString()) Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
// deprecated // deprecated
@ -92,112 +76,111 @@ public class MessageManager: BaseServiceManager {
} }
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"], Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
methodCall[string: "receiverID"], methodCall[string: "senderID"]) methodCall[string: "receiverID"], methodCall[string: "senderID"])
} }
func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ // func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"]) // Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"])
} // }
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "userID"], methodCall[jsonString: "messageIDList"]) Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
} }
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkTypingStatusUpdate(methodCall[string: "userID"], methodCall[string: "typing"]) Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"])
callBack(result)
} }
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "text"])) callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"]))
} }
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "text"], methodCall[jsonString: "atUserList"])) callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "atUserList"]))
} }
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "imagePath"])) callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
} }
func createImageMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createImageMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "imagePath"])) callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "imagePath"]))
} }
func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "soundPath"], methodCall[int64: "duration"])) callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
} }
func createSoundMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createSoundMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "soundPath"], methodCall[int64: "duration"])) callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"]))
} }
func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "videoPath"], methodCall[string: "videoType"], let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
methodCall[int64: "duration"], methodCall[string: "snapshotPath"]) methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
callBack(result, prama) callBack(result, prama)
} }
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "videoPath"], methodCall[string: "videoType"], let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
methodCall[int64: "duration"], methodCall[string: "snapshotPath"]) methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
callBack(result, prama) callBack(result, prama)
} }
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "filePath"], methodCall[string: "fileName"])) callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
} }
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "filePath"], methodCall[string: "fileName"])) callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
} }
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateMergerMessage(methodCall[jsonString: "messageList"], methodCall[string: "title"], let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
methodCall[jsonString: "summaryList"]) methodCall[jsonString: "summaryList"])
callBack(result, prama) callBack(result, prama)
} }
func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateForwardMessage(methodCall[jsonString: "message"])) callBack(result, Open_im_sdkCreateForwardMessage(methodCall[string: "operationID"], methodCall[jsonString: "message"]))
} }
func createLocationMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createLocationMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "description"], let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "operationID"], methodCall[string: "description"],
methodCall[double: "longitude"], methodCall[double: "latitude"]) methodCall[double: "longitude"], methodCall[double: "latitude"])
callBack(result, prama) callBack(result, prama)
} }
func createCustomMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createCustomMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "data"], let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "operationID"], methodCall[string: "data"],
methodCall[string: "extension"], methodCall[string: "description"]) methodCall[string: "extension"], methodCall[string: "description"])
callBack(result, prama) callBack(result, prama)
} }
func createQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"]) let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"])
callBack(result, prama) callBack(result, prama)
} }
func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
callBack(result, Open_im_sdkCreateCardMessage(methodCall[jsonString: "cardMessage"])) callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
} }
func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ // func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkForceSyncMsg() // Open_im_sdkForceSyncMsg()
callBack(result) // callBack(result)
} // }
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "userID"]) Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
} }
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "groupID"]) Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
} }
public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol { public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
private let channel: FlutterMethodChannel private let channel: FlutterMethodChannel
private let result: FlutterResult private let result: FlutterResult
private let call: FlutterMethodCall private let call: FlutterMethodCall
@ -217,7 +200,6 @@ public class MessageManager: BaseServiceManager {
// } // }
public func onError(_ errCode: Int, errMsg: String?) { public func onError(_ errCode: Int, errMsg: String?) {
print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)")
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) } DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
} }
@ -226,7 +208,6 @@ public class MessageManager: BaseServiceManager {
// return // return
// } // }
var values: [String: Any] = [:] var values: [String: Any] = [:]
print("=================onProgress============\nprogress:\(progress)")
let message = call[dict: "message"] let message = call[dict: "message"]
values["clientMsgID"] = message["clientMsgID"] values["clientMsgID"] = message["clientMsgID"]
values["progress"] = progress values["progress"] = progress
@ -234,13 +215,12 @@ public class MessageManager: BaseServiceManager {
} }
public func onSuccess(_ data: String?) { public func onSuccess(_ data: String?) {
print("=================onSuccess============\nsuccess:\(data!)")
DispatchQueue.main.async { self.result(data) } DispatchQueue.main.async { self.result(data) }
} }
} }
public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol { public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
private let channel: FlutterMethodChannel private let channel: FlutterMethodChannel
private let id: String private let id: String

@ -0,0 +1,43 @@
import Foundation
import OpenIMCore
public class UserManager: BaseServiceManager {
public override func registerHandlers() {
super.registerHandlers()
self["getUsersInfo"] = getUsersInfo
self["setSelfInfo"] = setSelfInfo
self["getSelfUserInfo"] = getSelfUserInfo
}
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetUserListener(UserListener(channel: channel))
callBack(result)
}
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
}
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetSelfInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
}
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
}
}
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onSelfInfoUpdated(_ userInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
}
}

@ -8,6 +8,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
let friendshipManager: FriendshipManager let friendshipManager: FriendshipManager
let messageManager: MessageManager let messageManager: MessageManager
let groupManager: GroupManager let groupManager: GroupManager
let userManger: UserManager
init(channel: FlutterMethodChannel) { init(channel: FlutterMethodChannel) {
self.imManager = IMMananger(channel: channel) self.imManager = IMMananger(channel: channel)
@ -15,6 +16,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
self.friendshipManager = FriendshipManager(channel: channel) self.friendshipManager = FriendshipManager(channel: channel)
self.messageManager = MessageManager(channel: channel) self.messageManager = MessageManager(channel: channel)
self.groupManager = GroupManager(channel: channel) self.groupManager = GroupManager(channel: channel)
self.userManger = UserManager(channel: channel)
} }
public static func register(with registrar: FlutterPluginRegistrar) { public static func register(with registrar: FlutterPluginRegistrar) {
@ -36,6 +38,8 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
friendshipManager.handleMethod(call: call, result: result) friendshipManager.handleMethod(call: call, result: result)
case "groupManager": case "groupManager":
groupManager.handleMethod(call: call, result: result) groupManager.handleMethod(call: call, result: result)
case "userManager":
userManger.handleMethod(call: call, result: result)
default: default:
print("Handle ManagerName Error: \(managerName) not found") print("Handle ManagerName Error: \(managerName) not found")
} }

@ -2,12 +2,14 @@
// Objective-C API for talking to the following Go packages // Objective-C API for talking to the following Go packages
// //
// open_im_sdk/open_im_sdk // open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
// //
// File is generated by gomobile bind. Do not edit. // File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__ #ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__ #define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h" #include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h" #include "Universe.objc.h"
#endif #endif

@ -1,6 +1,7 @@
framework module "OpenIMCore" { framework module "OpenIMCore" {
header "ref.h" header "ref.h"
header "Open_im_sdk.objc.h" header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h" header "Universe.objc.h"
header "OpenIMCore.h" header "OpenIMCore.h"

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>OpenIMCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OpenIMCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -0,0 +1,15 @@
// Objective-C API for talking to the following Go packages
//
// open_im_sdk/open_im_sdk
// open_im_sdk/open_im_sdk_callback
//
// File is generated by gomobile bind. Do not edit.
#ifndef __OpenIMCore_FRAMEWORK_H__
#define __OpenIMCore_FRAMEWORK_H__
#include "Open_im_sdk.objc.h"
#include "Open_im_sdk_callback.objc.h"
#include "Universe.objc.h"
#endif

@ -0,0 +1,206 @@
// Objective-C API for talking to open_im_sdk/open_im_sdk Go package.
// gobind -lang=objc open_im_sdk/open_im_sdk
//
// File is generated by gobind. Do not edit.
#ifndef __Open_im_sdk_H__
#define __Open_im_sdk_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
#include "Open_im_sdk_callback.objc.h"
@interface Open_im_sdk : NSObject
// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr
// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex
@end
FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkAddBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID);
FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg);
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m);
FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath);
FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID);
FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID);
FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType);
FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long offset, long count);
FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count);
FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList);
FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions);
FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void);
FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList);
FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
// skipped function GetUserWorker with unsupported parameter or return types
/**
* /////////////////////user/////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
// skipped function InitOnce with unsupported parameter or return types
FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id<Open_im_sdk_callbackOnConnListener> _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config);
FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID);
FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg);
FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList);
FOUNDATION_EXPORT void Open_im_sdkLogin(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token);
FOUNDATION_EXPORT void Open_im_sdkLogout(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID);
FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList);
FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkPinConversation(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned);
FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID);
FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg);
FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg);
FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID);
FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void);
FOUNDATION_EXPORT void Open_im_sdkSendMessage(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id<Open_im_sdk_callbackSendMsgCallBack> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo);
FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id<Open_im_sdk_callbackOnAdvancedMsgListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText);
FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id<Open_im_sdk_callbackOnConversationListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt);
FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id<Open_im_sdk_callbackOnFriendshipListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark);
FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo);
/**
* ////////////////////////group//////////////////////////////////////////
*/
FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id<Open_im_sdk_callbackOnGroupListener> _Nullable callback);
FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo);
FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id<Open_im_sdk_callbackOnUserListener> _Nullable listener);
FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID);
FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip);
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj);
#endif

@ -0,0 +1,29 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.
#ifndef __Universe_H__
#define __Universe_H__
@import Foundation;
#include "ref.h"
@protocol Universeerror;
@class Universeerror;
@protocol Universeerror <NSObject>
- (NSString* _Nonnull)error;
@end
@class Universeerror;
@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)error;
@end
#endif

@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__
#include <Foundation/Foundation.h>
// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.
// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;
- (int32_t)incNum;
@end
@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end
#endif

@ -0,0 +1,9 @@
framework module "OpenIMCore" {
header "ref.h"
header "Open_im_sdk.objc.h"
header "Open_im_sdk_callback.objc.h"
header "Universe.objc.h"
header "OpenIMCore.h"
export *
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

@ -7,17 +7,19 @@ export 'src/enum/listener_type.dart';
export 'src/enum/message_status.dart'; export 'src/enum/message_status.dart';
export 'src/enum/message_type.dart'; export 'src/enum/message_type.dart';
export 'src/listener/advanced_msg_listener.dart'; export 'src/listener/advanced_msg_listener.dart';
export 'src/listener/connect_listener.dart';
export 'src/listener/conversation_listener.dart'; export 'src/listener/conversation_listener.dart';
export 'src/listener/friendship_listener.dart'; export 'src/listener/friendship_listener.dart';
export 'src/listener/group_listener.dart'; export 'src/listener/group_listener.dart';
export 'src/listener/impl/advanced_msg_listener.dart'; export 'src/listener/impl/advanced_msg_listener.dart';
export 'src/listener/impl/connect_listener.dart';
export 'src/listener/impl/conversation_listener.dart'; export 'src/listener/impl/conversation_listener.dart';
export 'src/listener/impl/friendship_listener.dart'; export 'src/listener/impl/friendship_listener.dart';
export 'src/listener/impl/group_listener.dart'; export 'src/listener/impl/group_listener.dart';
export 'src/listener/impl/init_sdk_listener.dart';
export 'src/listener/impl/msg_send_progress_listener.dart'; export 'src/listener/impl/msg_send_progress_listener.dart';
export 'src/listener/init_sdk_listener.dart'; export 'src/listener/impl/user_listener.dart';
export 'src/listener/msg_send_progress_listener.dart'; export 'src/listener/msg_send_progress_listener.dart';
export 'src/listener/user_listener.dart';
export 'src/manager/im_conversation_manager.dart'; export 'src/manager/im_conversation_manager.dart';
export 'src/manager/im_friendship_manager.dart'; export 'src/manager/im_friendship_manager.dart';
export 'src/manager/im_group_manager.dart'; export 'src/manager/im_group_manager.dart';

@ -1,10 +1,11 @@
class ListenerType { class ListenerType {
static const simpleMsgListener = 'simpleMsgListener'; static final simpleMsgListener = 'simpleMsgListener';
static const initSDKListener = 'initSDKListener'; static final connectListener = 'connectListener';
static const groupListener = 'groupListener'; static final userListener = 'userListener';
static const advancedMsgListener = 'advancedMsgListener'; static final groupListener = 'groupListener';
static const conversationListener = 'conversationListener'; static final advancedMsgListener = 'advancedMsgListener';
static const friendListener = 'friendListener'; static final conversationListener = 'conversationListener';
static const signalingListener = 'signalingListener'; static final friendListener = 'friendListener';
static const msgSendProgressListener = "msgSendProgressListener"; static final signalingListener = 'signalingListener';
static final msgSendProgressListener = "msgSendProgressListener";
} }

@ -1,6 +1,4 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; abstract class ConnectListener {
abstract class InitSDKListener {
/// SDK is connecting to the server /// SDK is connecting to the server
void connecting(); void connecting();
@ -17,7 +15,4 @@ abstract class InitSDKListener {
/// Ticket expired when online. /// Ticket expired when online.
/// At this time, you need to generate a new userSig and call IMManager's login() function to log in again /// At this time, you need to generate a new userSig and call IMManager's login() function to log in again
void userSigExpired(); void userSigExpired();
/// The information of the logged-in user has been updated
void selfInfoUpdated(UserInfo info);
} }

@ -1,21 +1,21 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
abstract class FriendshipListener { abstract class FriendshipListener {
void blackListAdd(UserInfo u); void friendApplicationAdded(FriendApplicationInfo u);
void blackListDeleted(UserInfo u); void friendApplicationDeleted(FriendApplicationInfo u);
void friendApplicationListAccept(UserInfo u); void friendApplicationAccepted(FriendApplicationInfo u);
void friendApplicationListAdded(UserInfo u); void friendApplicationRejected(FriendApplicationInfo u);
void friendApplicationListDeleted(UserInfo u); void friendAdded(FriendInfo u);
void friendApplicationListReject(UserInfo u); void friendDeleted(FriendInfo u);
void friendInfoChanged(UserInfo u); void friendInfoChanged(FriendInfo u);
void friendListAdded(UserInfo u); void blacklistAdded(BlacklistInfo u);
void friendListDeleted(UserInfo u); void blacklistDeleted(BlacklistInfo u);
} }

@ -1,23 +1,27 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
abstract class GroupListener { abstract class GroupListener {
void memberEnter(String groupId, List<GroupMembersInfo> list); void joinedGroupAdded(GroupInfo info);
void memberLeave(String groupId, GroupMembersInfo info); void joinedGroupDeleted(GroupInfo info);
void memberInvited( void groupMemberAdded(GroupMembersInfo info);
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
void memberKicked( void groupMemberDeleted(GroupMembersInfo info);
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list);
void groupCreated(String groupId); void receiveJoinGroupApplicationAdded(GroupApplicationInfo info);
void groupInfoChanged(String groupId, GroupInfo info); void receiveJoinGroupApplicationDeleted(GroupApplicationInfo info);
void receiveJoinApplication( void groupApplicationAdded(GroupApplicationInfo info);
String groupId, GroupMembersInfo info, String opReason);
void applicationProcessed(String groupId, GroupMembersInfo opUser, void groupApplicationDeleted(GroupApplicationInfo info);
int agreeOrReject, String opReason);
void groupInfoChanged(GroupInfo info);
void groupMemberInfoChanged(GroupMembersInfo info);
void groupApplicationAccepted(GroupApplicationInfo info);
void groupApplicationRejected(GroupApplicationInfo info);
} }

@ -1,19 +1,18 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
import 'package:flutter_openim_sdk/src/listener/connect_listener.dart';
class OnInitSDKListener extends InitSDKListener { class OnConnectListener extends ConnectListener {
Function(int? code, String? errorMsg)? onConnectFailed; Function(int? code, String? errorMsg)? onConnectFailed;
Function()? onConnectSuccess; Function()? onConnectSuccess;
Function()? onConnecting; Function()? onConnecting;
Function()? onKickedOffline; Function()? onKickedOffline;
Function(UserInfo info)? onSelfInfoUpdated;
Function()? onUserSigExpired; Function()? onUserSigExpired;
OnInitSDKListener({ OnConnectListener({
this.onConnectFailed, this.onConnectFailed,
this.onConnectSuccess, this.onConnectSuccess,
this.onConnecting, this.onConnecting,
this.onKickedOffline, this.onKickedOffline,
this.onSelfInfoUpdated,
this.onUserSigExpired, this.onUserSigExpired,
}); });
@ -37,11 +36,6 @@ class OnInitSDKListener extends InitSDKListener {
if (null != onKickedOffline) onKickedOffline!(); if (null != onKickedOffline) onKickedOffline!();
} }
@override
void selfInfoUpdated(UserInfo info) {
if (null != onSelfInfoUpdated) onSelfInfoUpdated!(info);
}
@override @override
void userSigExpired() { void userSigExpired() {
if (null != onUserSigExpired) onUserSigExpired!(); if (null != onUserSigExpired) onUserSigExpired!();

@ -1,73 +1,93 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// OnFriendApplicationAdded
/// OnFriendApplicationAdded
///
///
/// OnFriendApplicationAccepted OnFriendAdded
/// OnFriendApplicationAccepted OnFriendAdded
///
///
/// OnFriendApplicationRejected
/// OnFriendApplicationRejected
///
///
/// OnFriendDeleted
///
///
/// OnFriendInfoChanged
///
///
/// OnBlacklistAdded
///
///
/// OnBlacklistDeleted
class OnFriendshipListener extends FriendshipListener { class OnFriendshipListener extends FriendshipListener {
Function(UserInfo u)? onBlackListAdd; Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(UserInfo u)? onBlackListDeleted; Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
Function(UserInfo u)? onFriendApplicationListAccept; Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
Function(UserInfo u)? onFriendApplicationListAdded; Function(FriendApplicationInfo i)? onFriendApplicationRejected;
Function(UserInfo u)? onFriendApplicationListDeleted; Function(FriendInfo i)? onFriendAdded;
Function(UserInfo u)? onFriendApplicationListReject; Function(FriendInfo i)? onFriendDeleted;
Function(UserInfo u)? onFriendInfoChanged; Function(FriendInfo i)? onFriendInfoChanged;
Function(UserInfo u)? onFriendListAdded; Function(BlacklistInfo i)? onBlacklistAdded;
Function(UserInfo u)? onFriendListDeleted; Function(BlacklistInfo i)? onBlacklistDeleted;
OnFriendshipListener({ OnFriendshipListener({
this.onBlackListAdd, this.onBlacklistAdded,
this.onBlackListDeleted, this.onBlacklistDeleted,
this.onFriendApplicationListAccept, this.onFriendAdded,
this.onFriendApplicationListAdded, this.onFriendApplicationAccepted,
this.onFriendApplicationListDeleted, this.onFriendApplicationAdded,
this.onFriendApplicationListReject, this.onFriendApplicationDeleted,
this.onFriendApplicationRejected,
this.onFriendDeleted,
this.onFriendInfoChanged, this.onFriendInfoChanged,
this.onFriendListAdded,
this.onFriendListDeleted,
}); });
@override @override
void blackListAdd(UserInfo u) { void blacklistAdded(BlacklistInfo u) {
if (null != onBlackListAdd) onBlackListAdd!(u); onBlacklistAdded?.call(u);
} }
@override @override
void blackListDeleted(UserInfo u) { void blacklistDeleted(BlacklistInfo u) {
if (null != onBlackListDeleted) onBlackListDeleted!(u); onBlacklistDeleted?.call(u);
} }
@override @override
void friendApplicationListAccept(UserInfo u) { void friendAdded(FriendInfo u) {
if (null != onFriendApplicationListAccept) onFriendAdded?.call(u);
onFriendApplicationListAccept!(u);
} }
@override @override
void friendApplicationListAdded(UserInfo u) { void friendApplicationAccepted(FriendApplicationInfo u) {
if (null != onFriendApplicationListAdded) onFriendApplicationListAdded!(u); onFriendApplicationAccepted?.call(u);
} }
@override @override
void friendApplicationListDeleted(UserInfo u) { void friendApplicationAdded(FriendApplicationInfo u) {
if (null != onFriendApplicationListDeleted) onFriendApplicationAdded?.call(u);
onFriendApplicationListDeleted!(u);
} }
@override @override
void friendApplicationListReject(UserInfo u) { void friendApplicationDeleted(FriendApplicationInfo u) {
if (null != onFriendApplicationListReject) onFriendApplicationDeleted?.call(u);
onFriendApplicationListReject!(u);
} }
@override @override
void friendInfoChanged(UserInfo u) { void friendApplicationRejected(FriendApplicationInfo u) {
if (null != onFriendInfoChanged) onFriendInfoChanged!(u); onFriendApplicationRejected?.call(u);
} }
@override @override
void friendListAdded(UserInfo u) { void friendDeleted(FriendInfo u) {
if (null != onFriendListAdded) onFriendListAdded!(u); onFriendDeleted?.call(u);
} }
@override @override
void friendListDeleted(UserInfo u) { void friendInfoChanged(FriendInfo u) {
if (null != onFriendListDeleted) onFriendListDeleted!(u); onFriendInfoChanged?.call(u);
} }
} }

@ -1,75 +1,121 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// OnJoinedGroupAdded
///
/// 退
/// 退 OnJoinedGroupDeleted
/// OnGroupMemberDeleted
///
///
/// OnJoinedGroupDeleted
/// OnGroupMemberDeleted
///
///
/// OnJoinedGroupAdded
/// OnGroupMemberAdded
///
///
/// OnGroupApplicationAdded
/// + OnReceiveJoinGroupApplicationAdded
///
///
/// OnJoinedGroupAdded OnGroupApplicationAccepted
/// OnGroupMemberAdded
/// OnGroupMemberAdded OnGroupApplicationAccepted
///
///
/// OnGroupApplicationRejected
/// OnGroupApplicationRejected
///
///
/// OnGroupInfoChanged
class OnGroupListener extends GroupListener { class OnGroupListener extends GroupListener {
Function(String groupId, GroupMembersInfo opUser, int agreeOrReject, Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
String opReason)? onApplicationProcessed; Function(GroupApplicationInfo info)? onGroupApplicationAdded;
Function(String groupId)? onGroupCreated; Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
Function(String groupId, GroupInfo info)? onGroupInfoChanged; Function(GroupApplicationInfo info)? onGroupApplicationRejected;
Function(String groupId, List<GroupMembersInfo> list)? onMemberEnter; Function(GroupInfo info)? onGroupInfoChanged;
Function( Function(GroupMembersInfo info)? onGroupMemberAdded;
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)? Function(GroupMembersInfo info)? onGroupMemberDeleted;
onMemberInvited; Function(GroupMembersInfo info)? onGroupMemberInfoChanged;
Function( Function(GroupInfo info)? onJoinedGroupAdded;
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list)? Function(GroupInfo info)? onJoinedGroupDeleted;
onMemberKicked; Function(GroupApplicationInfo info)? onReceiveJoinGroupApplicationAdded;
Function(String groupId, GroupMembersInfo info)? onMemberLeave; Function(GroupApplicationInfo info)? onReceiveJoinGroupApplicationDeleted;
Function(String groupId, GroupMembersInfo info, String opReason)?
onReceiveJoinApplication;
OnGroupListener({ OnGroupListener({
this.onApplicationProcessed, this.onGroupApplicationAccepted,
this.onGroupCreated, this.onGroupApplicationAdded,
this.onGroupApplicationDeleted,
this.onGroupApplicationRejected,
this.onGroupInfoChanged, this.onGroupInfoChanged,
this.onMemberEnter, this.onGroupMemberAdded,
this.onMemberInvited, this.onGroupMemberDeleted,
this.onMemberKicked, this.onGroupMemberInfoChanged,
this.onMemberLeave, this.onJoinedGroupAdded,
this.onReceiveJoinApplication, this.onJoinedGroupDeleted,
this.onReceiveJoinGroupApplicationAdded,
this.onReceiveJoinGroupApplicationDeleted,
}); });
@override @override
void applicationProcessed(String groupId, GroupMembersInfo opUser, void groupApplicationAccepted(GroupApplicationInfo info) {
int agreeOrReject, String opReason) { onGroupApplicationAccepted?.call(info);
if (null != onApplicationProcessed)
onApplicationProcessed!(groupId, opUser, agreeOrReject, opReason);
} }
@override @override
void groupCreated(String groupId) { void groupApplicationAdded(GroupApplicationInfo info) {
if (null != onGroupCreated) onGroupCreated!(groupId); onGroupApplicationAdded?.call(info);
} }
@override @override
void groupInfoChanged(String groupId, GroupInfo info) { void groupApplicationDeleted(GroupApplicationInfo info) {
if (null != onGroupInfoChanged) onGroupInfoChanged!(groupId, info); onGroupApplicationDeleted?.call(info);
} }
@override @override
void memberEnter(String groupId, List<GroupMembersInfo> list) { void groupApplicationRejected(GroupApplicationInfo info) {
if (null != onMemberEnter) onMemberEnter!(groupId, list); onGroupApplicationRejected?.call(info);
} }
@override @override
void memberInvited( void groupInfoChanged(GroupInfo info) {
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) { onGroupInfoChanged?.call(info);
if (null != onMemberInvited) onMemberInvited!(groupId, opUser, list);
} }
@override @override
void memberKicked( void groupMemberAdded(GroupMembersInfo info) {
String groupId, GroupMembersInfo opUser, List<GroupMembersInfo> list) { onGroupMemberAdded?.call(info);
if (null != onMemberKicked) onMemberKicked!(groupId, opUser, list);
} }
@override @override
void memberLeave(String groupId, GroupMembersInfo info) { void groupMemberDeleted(GroupMembersInfo info) {
if (null != onMemberLeave) onMemberLeave!(groupId, info); onGroupMemberDeleted?.call(info);
} }
@override @override
void receiveJoinApplication( void groupMemberInfoChanged(GroupMembersInfo info) {
String groupId, GroupMembersInfo info, String opReason) { onGroupMemberInfoChanged?.call(info);
if (null != onReceiveJoinApplication) }
onReceiveJoinApplication!(groupId, info, opReason);
@override
void joinedGroupAdded(GroupInfo info) {
onJoinedGroupAdded?.call(info);
}
@override
void joinedGroupDeleted(GroupInfo info) {
onJoinedGroupDeleted?.call(info);
}
@override
void receiveJoinGroupApplicationAdded(GroupApplicationInfo info) {
onReceiveJoinGroupApplicationAdded?.call(info);
}
@override
void receiveJoinGroupApplicationDeleted(GroupApplicationInfo info) {
onReceiveJoinGroupApplicationDeleted?.call(info);
} }
} }

@ -1,11 +1,11 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OnMsgSendProgressListener extends MsgSendProgressListener { class OnMsgSendProgressListener extends MsgSendProgressListener {
Function(String msgID, int progress)? onProgress; Function(String clientMsgID, int progress)? onProgress;
OnMsgSendProgressListener({this.onProgress}); OnMsgSendProgressListener({this.onProgress});
void progress(String msgID, int progress) { void progress(String clientMsgID, int progress) {
if (null != onProgress) onProgress!(msgID, progress); if (null != onProgress) onProgress!(clientMsgID, progress);
} }
} }

@ -0,0 +1,12 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OnUserListener extends UserListener {
Function(UserInfo info)? onSelfInfoUpdated;
OnUserListener({this.onSelfInfoUpdated});
@override
void selfInfoUpdated(UserInfo info) {
onSelfInfoUpdated?.call(info);
}
}

@ -1,3 +1,3 @@
abstract class MsgSendProgressListener { abstract class MsgSendProgressListener {
void progress(String msgID, int progress); void progress(String clientMsgID, int progress);
} }

@ -0,0 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
abstract class UserListener {
/// The information of the logged-in user has been updated
void selfInfoUpdated(UserInfo info);
}

@ -20,15 +20,22 @@ class ConversationManager {
/// Get all conversations /// Get all conversations
/// ///
Future<List<ConversationInfo>> getAllConversationList() => _channel Future<List<ConversationInfo>> getAllConversationList(
.invokeMethod('getAllConversationList', _buildParam({})) {String? operationID}) =>
.then((value) => _toList(value)); _channel
.invokeMethod(
'getAllConversationList',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toList(value));
/// Paging to get conversation /// Paging to get conversation
/// , [offset]index ///
Future<List<ConversationInfo>> getConversationListSplit({ Future<List<ConversationInfo>> getConversationListSplit({
int offset = 0, int offset = 0,
int count = 20, int count = 20,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -36,18 +43,20 @@ class ConversationManager {
_buildParam({ _buildParam({
'offset': offset, 'offset': offset,
'count': count, 'count': count,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toList(value)); .then((value) => _toList(value));
/// Get a single conversation info /// Get a conversation, if it doesn't exist it will be created automatically
/// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID /// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
/// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2 /// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
/// ///
/// [sourceID]idid /// [sourceID] IDID
/// [sessionType]12 /// [sessionType] 12
Future<ConversationInfo> getSingleConversation({ Future<ConversationInfo> getOneConversation({
required String sourceID, required String sourceID,
required int sessionType, required int sessionType,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -55,6 +64,7 @@ class ConversationManager {
_buildParam({ _buildParam({
"sourceID": sourceID, "sourceID": sourceID,
"sessionType": sessionType, "sessionType": sessionType,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -62,12 +72,14 @@ class ConversationManager {
/// ///
Future<List<ConversationInfo>> getMultipleConversation({ Future<List<ConversationInfo>> getMultipleConversation({
required List<String> conversationIDList, required List<String> conversationIDList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'getMultipleConversation', 'getMultipleConversation',
_buildParam({ _buildParam({
"conversationIDList": conversationIDList, "conversationIDList": conversationIDList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toList(value)); .then((value) => _toList(value));
@ -75,12 +87,14 @@ class ConversationManager {
/// ///
Future deleteConversation({ Future deleteConversation({
required String conversationID, required String conversationID,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'deleteConversation', 'deleteConversation',
_buildParam({ _buildParam({
"conversationID": conversationID, "conversationID": conversationID,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _printValue(value)); .then((value) => _printValue(value));
@ -89,6 +103,7 @@ class ConversationManager {
Future setConversationDraft({ Future setConversationDraft({
required String conversationID, required String conversationID,
required String draftText, required String draftText,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -96,6 +111,7 @@ class ConversationManager {
_buildParam({ _buildParam({
"conversationID": conversationID, "conversationID": conversationID,
"draftText": draftText, "draftText": draftText,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _printValue(value)); .then((value) => _printValue(value));
@ -104,6 +120,7 @@ class ConversationManager {
Future pinConversation({ Future pinConversation({
required String conversationID, required String conversationID,
required bool isPinned, required bool isPinned,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -111,33 +128,47 @@ class ConversationManager {
_buildParam({ _buildParam({
"conversationID": conversationID, "conversationID": conversationID,
"isPinned": isPinned, "isPinned": isPinned,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _printValue(value)); .then((value) => _printValue(value));
/// Mark single chat messages as read /// Mark single chat messages as read
/// ///
Future<dynamic> markSingleMessageHasRead({required String userID}) => // Future<dynamic> markSingleMessageHasRead({required String userID}) =>
_channel.invokeMethod( // _channel.invokeMethod(
'markSingleMessageHasRead', _buildParam({'userID': userID})); // 'markSingleMessageHasRead', _buildParam({'userID': userID}));
/// Mark group chat messages as read /// Mark group chat messages as read
/// ///
Future<dynamic> markGroupMessageHasRead({required String groupID}) => Future<dynamic> markGroupMessageHasRead({
required String groupID,
String? operationID,
}) =>
_channel.invokeMethod( _channel.invokeMethod(
'markGroupMessageHasRead', _buildParam({'groupID': groupID})); 'markGroupMessageHasRead',
_buildParam({
'groupID': groupID,
"operationID": _checkOperationID(operationID),
}));
/// Get the total number of unread messages /// Get the total number of unread messages
/// ///
Future<dynamic> getTotalUnreadMsgCount() => Future<dynamic> getTotalUnreadMsgCount({
_channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({})); String? operationID,
}) =>
_channel.invokeMethod(
'getTotalUnreadMsgCount',
_buildParam({
"operationID": _checkOperationID(operationID),
}));
/// Query conversation id /// Query conversation id
/// [sourceID] : if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID /// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID
/// [sessionType] : if it is a single chat, it value is 1. if it is a group chat, it value is 2 /// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2
/// id /// id
/// [sourceID]idid /// [sourceID] IDID
/// [sessionType]12 /// [sessionType] 12
Future<dynamic> getConversationID({ Future<dynamic> getConversationIDBySessionType({
required String sourceID, required String sourceID,
required int sessionType, required int sessionType,
}) => }) =>
@ -149,18 +180,20 @@ class ConversationManager {
})); }));
/// Message Do Not Disturb /// Message Do Not Disturb
/// [status] 1: Do not receive messages, 2: Do not notify when messages are received; 0: Normal /// [status] 1: Do not receive messages. 2: Do not notify when messages are received. 0: Normal.
/// ///
/// [status] 12线线3 /// [status] 12线线3
Future<dynamic> setConversationRecvMessageOpt({ Future<dynamic> setConversationRecvMessageOpt({
required List<String> conversationIDList, required List<String> conversationIDList,
required int status, required int status,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'setConversationRecvMessageOpt', 'setConversationRecvMessageOpt',
_buildParam({ _buildParam({
"conversationIDList": conversationIDList, "conversationIDList": conversationIDList,
"status": status, "status": status,
"operationID": _checkOperationID(operationID),
})); }));
/// Message Do Not Disturb /// Message Do Not Disturb
@ -168,12 +201,14 @@ class ConversationManager {
/// ///
Future<List<dynamic>> getConversationRecvMessageOpt({ Future<List<dynamic>> getConversationRecvMessageOpt({
required List<String> conversationIDList, required List<String> conversationIDList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'getConversationRecvMessageOpt', 'getConversationRecvMessageOpt',
_buildParam({ _buildParam({
"conversationIDList": conversationIDList, "conversationIDList": conversationIDList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _formatJson(value)); .then((value) => _formatJson(value));
@ -181,13 +216,13 @@ class ConversationManager {
/// ///
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) { ..sort((a, b) {
if ((a.isPinned == 1 && b.isPinned == 1) || if ((a.isPinned == true && b.isPinned == true) ||
(a.isPinned != 1 && b.isPinned != 1)) { (a.isPinned != true && b.isPinned != true)) {
int aCompare = a.draftTimestamp! > a.latestMsgSendTime! int aCompare = a.draftTextTime! > a.latestMsgSendTime!
? a.draftTimestamp! ? a.draftTextTime!
: a.latestMsgSendTime!; : a.latestMsgSendTime!;
int bCompare = b.draftTimestamp! > b.latestMsgSendTime! int bCompare = b.draftTextTime! > b.latestMsgSendTime!
? b.draftTimestamp! ? b.draftTextTime!
: b.latestMsgSendTime!; : b.latestMsgSendTime!;
if (aCompare > bCompare) { if (aCompare > bCompare) {
return -1; return -1;
@ -196,7 +231,7 @@ class ConversationManager {
} else { } else {
return 0; return 0;
} }
} else if (a.isPinned == 1 && b.isPinned != 1) { } else if (a.isPinned == true && b.isPinned != true) {
return -1; return -1;
} else { } else {
return 1; return 1;
@ -222,4 +257,8 @@ class ConversationManager {
static String _printValue(value) { static String _printValue(value) {
return value; return value;
} }
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
} }

@ -18,82 +18,189 @@ class FriendshipManager {
/// Get friend info by user id /// Get friend info by user id
/// ///
Future<List<UserInfo>> getFriendsInfo({required List<String> uidList}) => Future<List<UserInfo>> getFriendsInfo({
required List<String> uidList,
String? operationID,
}) =>
_channel _channel
.invokeMethod('getFriendsInfo', _buildParam({"uidList": uidList})) .invokeMethod(
.then((value) => _toList(value)); 'getFriendsInfo',
_buildParam({
"uidList": uidList,
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast())));
/// Send an friend application /// Send an friend application
/// ///
Future<dynamic> addFriend({required String uid, required String reason}) => Future<dynamic> addFriend({
required String uid,
String? reason,
String? operationID,
}) =>
_channel.invokeMethod( _channel.invokeMethod(
'addFriend', _buildParam({"uid": uid, "reqMessage": reason})); 'addFriend',
_buildParam({
"toUserID": uid,
"reqMsg": reason,
"operationID": _checkOperationID(operationID),
}));
/// Get all friend application, sent to you by others /// Get someone's request to add me as a friend
/// ///
Future<List<UserInfo>> getFriendApplicationList() => _channel Future<List<FriendApplicationInfo>> getRecvFriendApplicationList(
.invokeMethod('getFriendApplicationList', _buildParam({})) {String? operationID}) =>
.then((value) => _toList(value)); _channel
.invokeMethod(
'getRecvFriendApplicationList',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) =>
_toList(value, (v) => FriendApplicationInfo.fromJson(v.cast())));
/// Get friend requests from me
///
Future<List<FriendApplicationInfo>> getSendFriendApplicationList(
{String? operationID}) =>
_channel
.invokeMethod(
'getSendFriendApplicationList',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) =>
_toList(value, (v) => FriendApplicationInfo.fromJson(v.cast())));
/// Find all friends including those who have been added to the blacklist /// Find all friends including those who have been added to the blacklist
/// ///
Future<List<UserInfo>> getFriendList() => _channel Future<List<UserInfo>> getFriendList({String? operationID}) => _channel
.invokeMethod('getFriendList', _buildParam({})) .invokeMethod(
.then((value) => _toList(value)); 'getFriendList',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast())));
/// Find all friends including those who have been added to the blacklist /// Find all friends including those who have been added to the blacklist
/// ///
Future<List<dynamic>> getFriendListMap() => _channel Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
.invokeMethod('getFriendList', _buildParam({})) .invokeMethod(
'getFriendList',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toListMap(value)); .then((value) => _toListMap(value));
/// Modify friend information, only [comment] can be modified /// Modify friend information, only [comment] can be modified
/// ///
Future<dynamic> setFriendInfo( Future<dynamic> setFriendRemark({
{required String uid, required String comment}) => required String uid,
required String remark,
String? operationID,
}) =>
_channel.invokeMethod( _channel.invokeMethod(
'setFriendInfo', 'setFriendRemark',
_buildParam({ _buildParam({
'uid': uid, 'toUserID': uid,
'comment': comment, 'remark': remark,
"operationID": _checkOperationID(operationID),
})); }));
/// Add friends to blacklist /// Add friends to blacklist
/// ///
Future<dynamic> addToBlackList({required String uid}) => Future<dynamic> addBlacklist({
_channel.invokeMethod('addToBlackList', _buildParam({"uid": uid})); required String uid,
String? operationID,
}) =>
_channel.invokeMethod(
'addBlacklist',
_buildParam({
"uid": uid,
"operationID": _checkOperationID(operationID),
}));
/// Find all blacklist /// Find all blacklist
/// ///
Future<List<UserInfo>> getBlackList() => _channel Future<List<UserInfo>> getBlacklist({String? operationID}) => _channel
.invokeMethod('getBlackList', _buildParam({})) .invokeMethod(
.then((value) => _toList(value)); 'getBlacklist',
_buildParam({
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast())));
/// Remove from blacklist /// Remove from blacklist
/// ///
Future<dynamic> deleteFromBlackList({required String uid}) => Future<dynamic> removeBlacklist({
_channel.invokeMethod('deleteFromBlackList', _buildParam({"uid": uid})); required String uid,
String? operationID,
}) =>
_channel.invokeMethod(
'removeBlacklist',
_buildParam({
"uid": uid,
"operationID": _checkOperationID(operationID),
}));
/// Determine if there is a friendship by userId /// Determine if there is a friendship by userId
/// ///
Future<List<UserInfo>> checkFriend(List<String> uidList) => _channel Future<List<FriendshipInfo>> checkFriend({
.invokeMethod('checkFriend', _buildParam({'uidList': uidList})) required List<String> uidList,
.then((value) => _toList(value)); String? operationID,
}) =>
_channel
.invokeMethod(
'checkFriend',
_buildParam({
'uidList': uidList,
"operationID": _checkOperationID(operationID),
}))
.then((value) =>
_toList(value, (v) => FriendshipInfo.fromJson(v.cast())));
/// Dissolve friendship from friend list /// Dissolve friendship from friend list
/// ///
Future<dynamic> deleteFromFriendList({required String uid}) => Future<dynamic> deleteFriend({
_channel.invokeMethod('deleteFromFriendList', _buildParam({"uid": uid})); required String uid,
String? operationID,
}) =>
_channel.invokeMethod(
'deleteFriend',
_buildParam({
"uid": uid,
"operationID": _checkOperationID(operationID),
}));
/// Accept application of be friend /// Accept application of be friend
/// ///
Future<dynamic> acceptFriendApplication({required String uid}) => _channel Future<dynamic> acceptFriendApplication({
.invokeMethod('acceptFriendApplication', _buildParam({"uid": uid})); required String uid,
String? handleMsg,
String? operationID,
}) =>
_channel.invokeMethod(
'acceptFriendApplication',
_buildParam({
"toUserID": uid,
"handleMsg": handleMsg,
"operationID": _checkOperationID(operationID),
}));
/// Refuse application of be friend /// Refuse application of be friend
/// ///
Future<dynamic> refuseFriendApplication({required String uid}) => _channel Future<dynamic> refuseFriendApplication({
.invokeMethod('refuseFriendApplication', _buildParam({"uid": uid})); required String uid,
String? handleMsg,
String? operationID,
}) =>
_channel.invokeMethod(
'refuseFriendApplication',
_buildParam({
"toUserID": uid,
"handleMsg": handleMsg,
"operationID": _checkOperationID(operationID),
}));
/// ///
// Future<dynamic> forceSyncFriendApplication() { // Future<dynamic> forceSyncFriendApplication() {
@ -115,10 +222,10 @@ class FriendshipManager {
return param; return param;
} }
static List<UserInfo> _toList(String? value) { static List<T> _toList<T>(String? value, T f(Map map)) {
var list = _formatJson(value); var list = _formatJson(value);
if (null == list) return <UserInfo>[]; if (null == list) return <T>[];
return (list as List).map((e) => UserInfo.fromJson(e)).toList(); return (list as List).map((e) => f(e)).toList();
} }
static List<dynamic> _toListMap(String? value) { static List<dynamic> _toListMap(String? value) {
@ -133,4 +240,8 @@ class FriendshipManager {
static String _printValue(value) { static String _printValue(value) {
return value; return value;
} }
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
} }

@ -23,6 +23,7 @@ class GroupManager {
required String groupId, required String groupId,
required List<String> uidList, required List<String> uidList,
String? reason, String? reason,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -31,6 +32,7 @@ class GroupManager {
'gid': groupId, 'gid': groupId,
'reason': reason, 'reason': reason,
'uidList': uidList, 'uidList': uidList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => (_formatJson(value) as List) .then((value) => (_formatJson(value) as List)
.map((e) => GroupInviteResult.fromJson(e)) .map((e) => GroupInviteResult.fromJson(e))
@ -42,6 +44,7 @@ class GroupManager {
required String groupId, required String groupId,
required List<String> uidList, required List<String> uidList,
String? reason, String? reason,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -50,6 +53,7 @@ class GroupManager {
'gid': groupId, 'gid': groupId,
'reason': reason, 'reason': reason,
'uidList': uidList, 'uidList': uidList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => (_formatJson(value) as List) .then((value) => (_formatJson(value) as List)
.map((e) => GroupInviteResult.fromJson(e)) .map((e) => GroupInviteResult.fromJson(e))
@ -60,6 +64,7 @@ class GroupManager {
Future<List<GroupMembersInfo>> getGroupMembersInfo({ Future<List<GroupMembersInfo>> getGroupMembersInfo({
required String groupId, required String groupId,
required List<String> uidList, required List<String> uidList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -67,19 +72,20 @@ class GroupManager {
_buildParam({ _buildParam({
'gid': groupId, 'gid': groupId,
'uidList': uidList, 'uidList': uidList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => (_formatJson(value) as List) .then((value) => (_formatJson(value) as List)
.map((e) => GroupMembersInfo.fromJson(e)) .map((e) => GroupMembersInfo.fromJson(e))
.toList()); .toList());
/// Get the list of group members /// Get the list of group members
/// [filter] 0: all user, 1: group owner, 2: administrator ///
/// [next] begin index, pull and fill 0 for the first time Future<List<GroupMembersInfo>> getGroupMemberList({
///
Future<GroupMembersList> getGroupMemberList({
required String groupId, required String groupId,
int filter = 0, int filter = 0,
int next = 0, int offset = 0,
int count = 0,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -87,16 +93,22 @@ class GroupManager {
_buildParam({ _buildParam({
'gid': groupId, 'gid': groupId,
'filter': filter, 'filter': filter,
'next': next, 'offset': offset,
'count': count,
'operationID': _checkOperationID(operationID),
})) }))
.then((value) => GroupMembersList.fromJson(_formatJson(value))); .then((value) => (_formatJson(value) as List)
.map((e) => GroupMembersInfo.fromJson(e))
.toList());
/// Get the list of group members /// Get the list of group members
/// ///
Future<dynamic> getGroupMemberListMap({ Future<dynamic> getGroupMemberListMap({
required String groupId, required String groupId,
int filter = 0, int filter = 0,
int next = 0, int offset = 0,
int count = 0,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -104,49 +116,72 @@ class GroupManager {
_buildParam({ _buildParam({
'gid': groupId, 'gid': groupId,
'filter': filter, 'filter': filter,
'next': next, 'offset': offset,
'count': count,
'operationID': _checkOperationID(operationID),
})) }))
.then((value) => _formatJson(value)); .then((value) => _formatJson(value));
/// Find all groups you have joined /// Find all groups you have joined
/// ///
Future<List<GroupInfo>> getJoinedGroupList() => _channel Future<List<GroupInfo>> getJoinedGroupList({String? operationID}) => _channel
.invokeMethod('getJoinedGroupList', _buildParam({})) .invokeMethod(
'getJoinedGroupList',
_buildParam({
'operationID': _checkOperationID(operationID),
}))
.then((value) => (_formatJson(value) as List) .then((value) => (_formatJson(value) as List)
.map((e) => GroupInfo.fromJson(e)) .map((e) => GroupInfo.fromJson(e))
.toList()); .toList());
/// Find all groups you have joined /// Find all groups you have joined
/// ///
Future<List<dynamic>> getJoinedGroupListMap() => _channel Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
.invokeMethod('getJoinedGroupList', _buildParam({})) .invokeMethod(
'getJoinedGroupList',
_buildParam({
'operationID': _checkOperationID(operationID),
}))
.then((value) => _formatJson(value)); .then((value) => _formatJson(value));
/// Check if you are a member of the group /// Check if you are a member of the group
/// ///
Future<bool> isJoinedGroup({required String gid}) => getJoinedGroupList() Future<bool> isJoinedGroup({
.then((list) => list.where((e) => e.groupID == gid).length > 0); required String gid,
String? operationID,
}) =>
getJoinedGroupList(
operationID: _checkOperationID(operationID),
).then((list) => list.where((e) => e.groupID == gid).length > 0);
/// Create a group /// Create a group
/// ///
Future<dynamic> createGroup({ Future<GroupInfo> createGroup({
String? groupName, String? groupName,
String? notification, String? notification,
String? introduction, String? introduction,
String? faceUrl, String? faceUrl,
int? groupType,
String? ex,
required List<GroupMemberRole> list, required List<GroupMemberRole> list,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel
'createGroup', .invokeMethod(
_buildParam({ 'createGroup',
'gInfo': { _buildParam({
"groupName": groupName, 'gInfo': {
"notification": notification, "groupName": groupName,
"introduction": introduction, "notification": notification,
"faceUrl": faceUrl, "introduction": introduction,
}, "faceURL": faceUrl,
'memberList': list.map((e) => e.toJson()).toList() "groupType": groupType,
})); "ex": ex,
},
'memberList': list.map((e) => e.toJson()).toList(),
'operationID': _checkOperationID(operationID),
}))
.then((value) => GroupInfo.fromJson(_formatJson(value)));
/// Edit group information /// Edit group information
/// ///
@ -156,26 +191,37 @@ class GroupManager {
String? notification, String? notification,
String? introduction, String? introduction,
String? faceUrl, String? faceUrl,
String? ex,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'setGroupInfo', 'setGroupInfo',
_buildParam({ _buildParam({
"gid": groupID,
'gInfo': { 'gInfo': {
"groupID": groupID, // "groupID": groupID,
"groupName": groupName, "groupName": groupName,
"notification": notification, "notification": notification,
"introduction": introduction, "introduction": introduction,
"faceUrl": faceUrl, "faceURL": faceUrl,
"ex": ex,
}, },
'operationID': _checkOperationID(operationID),
})); }));
/// Find group information by group id /// Find group information by group id
/// ///
Future<List<GroupInfo>> getGroupsInfo({ Future<List<GroupInfo>> getGroupsInfo({
required List<String> gidList, required List<String> gidList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod('getGroupsInfo', _buildParam({'gidList': gidList})) .invokeMethod(
'getGroupsInfo',
_buildParam({
'gidList': gidList,
'operationID': _checkOperationID(operationID),
}))
.then((value) { .then((value) {
List list = _formatJson(value); List list = _formatJson(value);
return list.map((e) => GroupInfo.fromJson(e)).toList(); return list.map((e) => GroupInfo.fromJson(e)).toList();
@ -186,23 +232,27 @@ class GroupManager {
Future<dynamic> joinGroup({ Future<dynamic> joinGroup({
required String gid, required String gid,
String? reason, String? reason,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'joinGroup', 'joinGroup',
_buildParam({ _buildParam({
'gid': gid, 'gid': gid,
'reason': reason, 'reason': reason,
'operationID': _checkOperationID(operationID),
})); }));
/// Leave group /// Leave group
/// 退 /// 退
Future<dynamic> quitGroup({ Future<dynamic> quitGroup({
required String gid, required String gid,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'quitGroup', 'quitGroup',
_buildParam({ _buildParam({
'gid': gid, 'gid': gid,
'operationID': _checkOperationID(operationID),
})); }));
/// Give group permissions to others /// Give group permissions to others
@ -210,44 +260,76 @@ class GroupManager {
Future<dynamic> transferGroupOwner({ Future<dynamic> transferGroupOwner({
required String gid, required String gid,
required String uid, required String uid,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'transferGroupOwner', 'transferGroupOwner',
_buildParam({ _buildParam({
'gid': gid, 'gid': gid,
'uid': uid, 'uid': uid,
'operationID': _checkOperationID(operationID),
})); }));
/// Get the list of applications /// As the group owner or administrator, get the list of received group members' applications to join the group.
/// ///
Future<GroupApplicationList> getGroupApplicationList() => _channel Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
.invokeMethod('getGroupApplicationList', _buildParam({})) {String? operationID}) =>
.then((value) => GroupApplicationList.fromJson(_formatJson(value))); _channel
.invokeMethod(
'getRecvGroupApplicationList',
_buildParam({
'operationID': _checkOperationID(operationID),
}))
.then((value) => (_formatJson(value) as List)
.map((e) => GroupApplicationInfo.fromJson(e))
.toList());
/// Get the record of the group membership application issued by yourself
///
Future<List<GroupApplicationInfo>> getSendGroupApplicationList(
{String? operationID}) =>
_channel
.invokeMethod(
'getSendGroupApplicationList',
_buildParam({
'operationID': _checkOperationID(operationID),
}))
.then((value) => (_formatJson(value) as List)
.map((e) => GroupApplicationInfo.fromJson(e))
.toList());
/// Accept group application /// Accept group application
/// ///
Future<dynamic> acceptGroupApplication({ Future<dynamic> acceptGroupApplication({
required GroupApplicationInfo info, required String gid,
required String reason, required String uid,
String? handleMsg,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'acceptGroupApplication', 'acceptGroupApplication',
_buildParam({ _buildParam({
'application': info.toJson(), 'gid': gid,
'reason': reason, 'uid': uid,
'handleMsg': handleMsg,
'operationID': _checkOperationID(operationID),
})); }));
/// Refuse group application /// Refuse group application
/// ///
Future<dynamic> refuseGroupApplication({ Future<dynamic> refuseGroupApplication({
required GroupApplicationInfo info, required String gid,
required String reason, required String uid,
String? handleMsg,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'refuseGroupApplication', 'refuseGroupApplication',
_buildParam({ _buildParam({
'application': info.toJson(), 'gid': gid,
'reason': reason, 'uid': uid,
'handleMsg': handleMsg,
'operationID': _checkOperationID(operationID),
})); }));
/// ///
@ -280,4 +362,8 @@ class GroupManager {
static String _printValue(value) { static String _printValue(value) {
return value; return value;
} }
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
} }

@ -3,6 +3,7 @@ import 'dart:developer';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
import 'package:flutter_openim_sdk/src/manager/im_user_manager.dart';
class IMManager { class IMManager {
MethodChannel _channel; MethodChannel _channel;
@ -10,13 +11,13 @@ class IMManager {
late FriendshipManager friendshipManager; late FriendshipManager friendshipManager;
late MessageManager messageManager; late MessageManager messageManager;
late GroupManager groupManager; late GroupManager groupManager;
late UserManager userManager;
// late OfflinePushManager offlinePushManager; // late OfflinePushManager offlinePushManager;
// late SignalingManager signalingManager; // late SignalingManager signalingManager;
late InitSDKListener _initSDKListener; late ConnectListener _connectListener;
late String uid; late String uid;
late UserInfo uInfo; late UserInfo uInfo;
bool isInitialized = false;
bool isLogined = false; bool isLogined = false;
IMManager(this._channel) { IMManager(this._channel) {
@ -24,6 +25,7 @@ class IMManager {
friendshipManager = FriendshipManager(_channel); friendshipManager = FriendshipManager(_channel);
messageManager = MessageManager(_channel); messageManager = MessageManager(_channel);
groupManager = GroupManager(_channel); groupManager = GroupManager(_channel);
userManager = UserManager(_channel);
// offlinePushManager = OfflinePushManager(_channel); // offlinePushManager = OfflinePushManager(_channel);
// signalingManager = SignalingManager(_channel); // signalingManager = SignalingManager(_channel);
_addNativeCallback(_channel); _addNativeCallback(_channel);
@ -33,112 +35,88 @@ class IMManager {
_channel.setMethodCallHandler((call) { _channel.setMethodCallHandler((call) {
try { try {
log('Flutter : $call'); log('Flutter : $call');
if (call.method == ListenerType.initSDKListener) { if (call.method == ListenerType.connectListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
dynamic data = call.arguments['data'];
switch (type) { switch (type) {
case 'onSelfInfoUpdated':
uInfo = UserInfo.fromJson(_formatJson(data));
_initSDKListener.selfInfoUpdated(uInfo);
break;
case 'onConnectFailed': case 'onConnectFailed':
int? errCode = call.arguments['errCode']; int? errCode = call.arguments['errCode'];
String? errMsg = call.arguments['errMsg']; String? errMsg = call.arguments['errMsg'];
_initSDKListener.connectFailed(errCode, errMsg); _connectListener.connectFailed(errCode, errMsg);
break; break;
case 'onConnecting': case 'onConnecting':
_initSDKListener.connecting(); _connectListener.connecting();
break; break;
case 'onConnectSuccess': case 'onConnectSuccess':
_initSDKListener.connectSuccess(); _connectListener.connectSuccess();
break; break;
case 'onKickedOffline': case 'onKickedOffline':
_initSDKListener.kickedOffline(); _connectListener.kickedOffline();
break; break;
case 'onUserSigExpired': case 'onUserSigExpired':
_initSDKListener.userSigExpired(); _connectListener.userSigExpired();
break; break;
} }
} else if (call.method == ListenerType.groupListener) { } else if (call.method == ListenerType.userListener) {
var args = call.arguments; String type = call.arguments['type'];
String type = args['type']; dynamic data = call.arguments['data'];
Map<dynamic, dynamic> map = args['data'];
switch (type) { switch (type) {
case 'onMemberEnter': case 'onSelfInfoUpdated':
groupManager.groupListener.memberEnter( uInfo = UserInfo.fromJson(_formatJson(data));
map['groupId'], userManager.userListener.selfInfoUpdated(uInfo);
(_formatJson(map['memberList']) as List)
.map((e) => GroupMembersInfo.fromJson(e))
.toList(),
);
break; break;
case 'onMemberLeave': }
groupManager.groupListener.memberLeave( } else if (call.method == ListenerType.groupListener) {
map['groupId'], String type = call.arguments['type'];
GroupMembersInfo.fromJson(_formatJson(map['member'])), dynamic data = call.arguments['data'];
); switch (type) {
case 'onGroupApplicationAccepted':
final i = GroupApplicationInfo.fromJson(_formatJson(data));
groupManager.groupListener.groupApplicationAccepted(i);
break; break;
case 'onMemberInvited': case 'onGroupApplicationAdded':
groupManager.groupListener.memberInvited( final i = GroupApplicationInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupApplicationAdded(i);
GroupMembersInfo.fromJson(_formatJson(map['opUser'])),
(_formatJson(map['memberList']) as List)
.map((e) => GroupMembersInfo.fromJson(e))
.toList(),
);
break; break;
case 'onMemberKicked': case 'onGroupApplicationDeleted':
groupManager.groupListener.memberKicked( final i = GroupApplicationInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupApplicationDeleted(i);
GroupMembersInfo.fromJson(_formatJson(map['opUser'])),
(_formatJson(map['memberList']) as List)
.map((e) => GroupMembersInfo.fromJson(e))
.toList(),
);
break; break;
case 'onGroupCreated': case 'onGroupApplicationRejected':
groupManager.groupListener.groupCreated( final i = GroupApplicationInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupApplicationRejected(i);
);
break; break;
case 'onGroupInfoChanged': case 'onGroupInfoChanged':
groupManager.groupListener.groupInfoChanged( final i = GroupInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupInfoChanged(i);
GroupInfo.fromJson(_formatJson(map['groupInfo'])),
);
break; break;
case 'onReceiveJoinApplication': case 'onGroupMemberAdded':
groupManager.groupListener.receiveJoinApplication( final i = GroupMembersInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupMemberAdded(i);
GroupMembersInfo.fromJson(_formatJson(map['member'])),
map['opReason'],
);
break; break;
case 'onApplicationProcessed': case 'onGroupMemberDeleted':
groupManager.groupListener.applicationProcessed( final i = GroupMembersInfo.fromJson(_formatJson(data));
map['groupId'], groupManager.groupListener.groupMemberDeleted(i);
GroupMembersInfo.fromJson(_formatJson(map['opUser'])), break;
map['agreeOrReject'], case 'onGroupMemberInfoChanged':
map['opReason'], final i = GroupMembersInfo.fromJson(_formatJson(data));
); groupManager.groupListener.groupMemberInfoChanged(i);
break;
case 'onJoinedGroupAdded':
final i = GroupInfo.fromJson(_formatJson(data));
groupManager.groupListener.joinedGroupAdded(i);
break;
case 'onJoinedGroupDeleted':
final i = GroupInfo.fromJson(_formatJson(data));
groupManager.groupListener.joinedGroupDeleted(i);
break;
case 'onReceiveJoinGroupApplicationAdded':
final i = GroupApplicationInfo.fromJson(_formatJson(data));
groupManager.groupListener.receiveJoinGroupApplicationAdded(i);
break;
case 'onReceiveJoinGroupApplicationDeleted':
final i = GroupApplicationInfo.fromJson(_formatJson(data));
groupManager.groupListener.receiveJoinGroupApplicationDeleted(i);
break; break;
// case 'onMemberInfoChanged':
// break;
// case 'onGroupDismissed':
// break;
// case 'onGroupRecycled':
// break;
//
// case 'onGrantAdministrator':
// break;
// case 'onRevokeAdministrator':
// break;
// case 'onQuitFromGroup':
// break;
// case 'onReceiveRESTCustomData':
// break;
// case 'onGroupAttributeChanged':
// break;
} }
} else if (call.method == ListenerType.advancedMsgListener) { } else if (call.method == ListenerType.advancedMsgListener) {
var type = call.arguments['type']; var type = call.arguments['type'];
@ -147,29 +125,17 @@ class IMManager {
case 'onRecvNewMessage': case 'onRecvNewMessage':
var value = call.arguments['data']['newMessage']; var value = call.arguments['data']['newMessage'];
var msg = Message.fromJson(_formatJson(value)); var msg = Message.fromJson(_formatJson(value));
for (var listener in messageManager.advancedMsgListeners) { messageManager.advancedMsgListener.recvNewMessage(msg);
if (listener.id == id) {
listener.recvNewMessage(msg);
}
}
break; break;
case 'onRecvMessageRevoked': case 'onRecvMessageRevoked':
var value = call.arguments['data']['revokedMessage']; var value = call.arguments['data']['revokedMessage'];
for (var listener in messageManager.advancedMsgListeners) { messageManager.advancedMsgListener.recvMessageRevoked(value);
if (listener.id == id) {
listener.recvMessageRevoked(value);
}
}
break; break;
case 'onRecvC2CReadReceipt': case 'onRecvC2CReadReceipt':
var value = call.arguments['data']['haveReadMessage']; var value = call.arguments['data']['haveReadMessage'];
var l = _formatJson(value) as List; var l = _formatJson(value) as List;
var list = l.map((e) => HaveReadInfo.fromJson(e)).toList(); var list = l.map((e) => HaveReadInfo.fromJson(e)).toList();
for (var listener in messageManager.advancedMsgListeners) { messageManager.advancedMsgListener.recvC2CReadReceipt(list);
if (listener.id == id) {
listener.recvC2CReadReceipt(list);
}
}
break; break;
} }
} else if (call.method == ListenerType.msgSendProgressListener) { } else if (call.method == ListenerType.msgSendProgressListener) {
@ -226,38 +192,43 @@ class IMManager {
} else if (call.method == ListenerType.friendListener) { } else if (call.method == ListenerType.friendListener) {
String type = call.arguments['type']; String type = call.arguments['type'];
dynamic data = call.arguments['data']; dynamic data = call.arguments['data'];
UserInfo u = UserInfo.fromJson(_formatJson(data));
switch (type) { switch (type) {
case 'onBlackListAdd': case 'onBlacklistAdded':
friendshipManager.friendshipListener.blackListAdd(u); final u = BlacklistInfo.fromJson(_formatJson(data));
friendshipManager.friendshipListener.blacklistAdded(u);
break; break;
case 'onBlackListDeleted': case 'onBlacklistDeleted':
friendshipManager.friendshipListener.blackListDeleted(u); final u = BlacklistInfo.fromJson(_formatJson(data));
friendshipManager.friendshipListener.blacklistDeleted(u);
break; break;
case 'onFriendApplicationListAccept': case 'onFriendApplicationAccepted':
friendshipManager.friendshipListener final u = FriendApplicationInfo.fromJson(_formatJson(data));
.friendApplicationListAccept(u); friendshipManager.friendshipListener.friendApplicationAccepted(u);
break; break;
case 'onFriendApplicationListAdded': case 'onFriendApplicationAdded':
friendshipManager.friendshipListener final u = FriendApplicationInfo.fromJson(_formatJson(data));
.friendApplicationListAdded(u); friendshipManager.friendshipListener.friendApplicationAdded(u);
break; break;
case 'onFriendApplicationListDeleted': case 'onFriendApplicationDeleted':
friendshipManager.friendshipListener final u = FriendApplicationInfo.fromJson(_formatJson(data));
.friendApplicationListDeleted(u); friendshipManager.friendshipListener.friendApplicationDeleted(u);
break; break;
case 'onFriendApplicationListReject': case 'onFriendApplicationListRejected':
friendshipManager.friendshipListener final u = FriendApplicationInfo.fromJson(_formatJson(data));
.friendApplicationListReject(u); friendshipManager.friendshipListener.friendApplicationRejected(u);
break; break;
case 'onFriendInfoChanged': case 'onFriendInfoChanged':
final u = FriendInfo.fromJson(_formatJson(data));
friendshipManager.friendshipListener.friendInfoChanged(u); friendshipManager.friendshipListener.friendInfoChanged(u);
break; break;
case 'onFriendListAdded': case 'onFriendAdded':
friendshipManager.friendshipListener.friendListAdded(u); final u = FriendInfo.fromJson(_formatJson(data));
friendshipManager.friendshipListener.friendAdded(u);
break; break;
case 'onFriendListDeleted': case 'onFriendDeleted':
friendshipManager.friendshipListener.friendListDeleted(u); final u = FriendInfo.fromJson(_formatJson(data));
friendshipManager.friendshipListener.friendDeleted(u);
break; break;
} }
} }
@ -272,61 +243,74 @@ class IMManager {
/// Initialize SDK /// Initialize SDK
/// ///
/// [platform] Refer to [IMPlatform] /// [platform] Refer to [IMPlatform]
/// [ipApi] Api server ip address /// [apiAddr] Api server ip address
/// [ipWs] WebSocket ip address /// [wsAddr] WebSocket ip address
/// [dbPath] Data storage directory /// [dataDir] Data storage directory
/// SDK /// SDK
/// [platform] [IMPlatform] /// [platform] [IMPlatform]
/// [ipApi] SDK api地址 /// [apiAddr] SDK api地址
/// [ipWs] SDK websocket地址 /// [wsAddr] SDK websocket地址
/// [dbPath] SDK数据库存储目录 /// [dataDir] SDK数据库存储目录
Future<dynamic> initSDK({ Future<dynamic> initSDK({
required int platform, required int platform,
required String ipApi, required String apiAddr,
required String ipWs, required String wsAddr,
required String dbPath, required String dataDir,
required InitSDKListener listener, required ConnectListener listener,
int logLevel = 6,
String? objectStorage,
String? operationID,
}) { }) {
_initSDKListener = listener; _connectListener = listener;
return _channel return _channel.invokeMethod(
.invokeMethod( 'initSDK',
'initSDK', _buildParam(
_buildParam( {
{ "platform": platform,
"platform": platform, "api_addr": apiAddr,
"ipApi": ipApi, "ws_addr": wsAddr,
"ipWs": ipWs, "data_dir": dataDir,
"dbDir": dbPath "log_level": logLevel,
}, "object_storage": objectStorage,
)) "operationID": _checkOperationID(operationID),
.then((value) => isInitialized = true); },
));
} }
@deprecated @deprecated
Future<dynamic> unInitSDK() { Future<dynamic> unInitSDK() {
return _channel.invokeMethod('unInitSDK', _buildParam({})).then((value) { return _channel.invokeMethod('unInitSDK', _buildParam({}));
isInitialized = false;
return value;
});
} }
/// Login sdk /// Login sdk
/// ///
Future<UserInfo> login({required String uid, required String token}) async { Future<UserInfo> login({
this.uid = uid; required String uid,
required String token,
String? operationID,
}) async {
await _channel.invokeMethod( await _channel.invokeMethod(
'login', 'login',
_buildParam({'uid': uid, 'token': token}), _buildParam({
'uid': uid,
'token': token,
'operationID': _checkOperationID(operationID),
}),
); );
this.isLogined = true; this.isLogined = true;
this.uInfo = (await getUsersInfo([uid])).first; this.uid = uid;
this.uInfo = await userManager.getSelfUserInfo();
return uInfo; return uInfo;
} }
/// Logout sdk /// Logout sdk
/// ///
Future<dynamic> logout() async { Future<dynamic> logout({String? operationID}) async {
var value = await _channel.invokeMethod('logout', _buildParam({})); var value = await _channel.invokeMethod(
'logout',
_buildParam({
'operationID': _checkOperationID(operationID),
}));
this.isLogined = false; this.isLogined = false;
return value; return value;
} }
@ -337,65 +321,24 @@ class IMManager {
/// Current user id /// Current user id
/// id /// id
Future<String> getLoginUid() async => uid; Future<String> getLoginUserID() async => uid;
/// Current user info /// Current user info
/// ///
Future<UserInfo> getLoginUserInfo() async => uInfo; Future<UserInfo> getLoginUserInfo() async => uInfo;
/// Modify current user info
///
Future<String?> setSelfInfo(
{String? name,
String? icon,
int? gender,
String? mobile,
String? birth,
String? email,
String? ex}) =>
_channel.invokeMethod(
'setSelfInfo',
_buildParam({
'uid': uid,
'name': name,
'icon': icon,
'gender': gender,
'mobile': mobile,
'birth': birth,
'email': email,
'ex': ex,
}));
/// Query user information
///
Future<List<UserInfo>> getUsersInfo(List<String> uidList) => _channel
.invokeMethod('getUsersInfo', _buildParam({'uidList': uidList}))
.then((value) => _toList(value));
///
Future enabledSDKLog({required bool enabled}) => _channel.invokeMethod(
'setSdkLog', _buildParam({'sdkLog': enabled ? 0 : 1}));
///
Future<dynamic> forceSyncLoginUerInfo(List<String> uidList) =>
_channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({}));
///
// Future<dynamic> forceReConn() {
// return _channel.invokeMethod('forceReConn', _buildParam({}));
// }
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "imManager"; param["ManagerName"] = "imManager";
return param; return param;
} }
static List<UserInfo> _toList(String value) =>
(_formatJson(value) as List).map((e) => UserInfo.fromJson(e)).toList();
static dynamic _formatJson(value) => jsonDecode(_printValue(value)); static dynamic _formatJson(value) => jsonDecode(_printValue(value));
static String _printValue(value) { static String _printValue(value) {
return value; return value;
} }
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
} }

@ -5,28 +5,20 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class MessageManager { class MessageManager {
MethodChannel _channel; MethodChannel _channel;
List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
MsgSendProgressListener? msgSendProgressListener; MsgSendProgressListener? msgSendProgressListener;
late AdvancedMsgListener advancedMsgListener;
MessageManager(this._channel); MessageManager(this._channel);
/// Add a message listener /// Set a message listener
/// ///
Future addAdvancedMsgListener(AdvancedMsgListener listener) { Future setAdvancedMsgListener(AdvancedMsgListener listener) {
advancedMsgListeners.add(listener); this.advancedMsgListener = listener;
return _channel.invokeMethod( // advancedMsgListeners.add(listener);
'addAdvancedMsgListener',
_buildParam({
'id': listener.id,
}));
}
/// Remove a message listener
@deprecated
Future removeAdvancedMsgListener(AdvancedMsgListener listener) {
advancedMsgListeners.remove(listener);
return _channel.invokeMethod( return _channel.invokeMethod(
'removeAdvancedMsgListener', 'setAdvancedMsgListener',
_buildParam({ _buildParam({
'id': listener.id, 'id': listener.id,
})); }));
@ -47,7 +39,8 @@ class MessageManager {
required Message message, required Message message,
String? userID, String? userID,
String? groupID, String? groupID,
bool onlineUserOnly = false, OfflinePushInfo? offlinePushInfo,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'sendMessage', 'sendMessage',
@ -55,7 +48,8 @@ class MessageManager {
'message': message.toJson(), 'message': message.toJson(),
'userID': userID ?? '', 'userID': userID ?? '',
'groupID': groupID ?? '', 'groupID': groupID ?? '',
'onlineUserOnly': onlineUserOnly, 'offlinePushInfo': offlinePushInfo?.toJson(),
'operationID': _checkOperationID(operationID),
})) /*.then((value) => _toObj(value))*/; })) /*.then((value) => _toObj(value))*/;
/// Find all history message /// Find all history message
@ -67,40 +61,57 @@ class MessageManager {
String? groupID, String? groupID,
Message? startMsg, Message? startMsg,
int? count, int? count,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'getHistoryMessageList', 'getHistoryMessageList',
_buildParam({ _buildParam({
'userID': userID ?? '', 'userID': userID ?? '',
'startMsg': startMsg?.toJson() /*?? {}*/,
'groupID': groupID ?? '', 'groupID': groupID ?? '',
'startClientMsgID': startMsg?.clientMsgID ?? '',
'count': count ?? 10, 'count': count ?? 10,
'operationID': _checkOperationID(operationID),
})) }))
.then((value) => _toList(value)); .then((value) => _toList(value));
/// Revoke the sent information /// Revoke the sent information
/// ///
Future revokeMessage({required Message message}) => Future revokeMessage({
_channel.invokeMethod('revokeMessage', _buildParam(message.toJson())); required Message message,
String? operationID,
}) =>
_channel.invokeMethod(
'revokeMessage',
_buildParam(message.toJson()
..addAll({
"operationID": _checkOperationID(operationID),
})));
/// Delete message /// Delete message
/// ///
Future deleteMessageFromLocalStorage({required Message message}) => Future deleteMessageFromLocalStorage({
required Message message,
String? operationID,
}) =>
_channel.invokeMethod( _channel.invokeMethod(
'deleteMessageFromLocalStorage', _buildParam(message.toJson())); 'deleteMessageFromLocalStorage',
_buildParam(message.toJson()
..addAll({
"operationID": _checkOperationID(operationID),
})));
/// ///
@deprecated // Future deleteMessages({required List<Message> msgList}) =>
Future deleteMessages({required List<Message> msgList}) => // _channel.invokeMethod('deleteMessages',
_channel.invokeMethod('deleteMessages', // _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
_buildParam({"msgList": msgList.map((e) => e.toJson()).toList()}));
/// ///
Future insertSingleMessageToLocalStorage({ Future insertSingleMessageToLocalStorage({
String? receiverID, String? receiverID,
String? senderID, String? senderID,
Message? message, Message? message,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'insertSingleMessageToLocalStorage', 'insertSingleMessageToLocalStorage',
@ -108,53 +119,68 @@ class MessageManager {
"message": message?.toJson(), "message": message?.toJson(),
"receiverID": receiverID, "receiverID": receiverID,
"senderID": senderID, "senderID": senderID,
"operationID": _checkOperationID(operationID),
})); }));
/// Query the message according to the message id /// Query the message according to the message id
Future findMessages({required List<String> messageIDList}) => // Future findMessages({required List<String> messageIDList}) =>
_channel.invokeMethod( // _channel.invokeMethod(
'findMessages', // 'findMessages',
_buildParam({ // _buildParam({
"messageIDList": messageIDList, // "messageIDList": messageIDList,
})); // }));
/// Mark c2c message as read /// Mark c2c message as read
/// c2c消息已读 /// c2c消息已读
Future markC2CMessageAsRead({ Future markC2CMessageAsRead({
required String userID, required String userID,
required List<String> messageIDList, required List<String> messageIDList,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'markC2CMessageAsRead', 'markC2CMessageAsRead',
_buildParam({ _buildParam({
"messageIDList": messageIDList, "messageIDList": messageIDList,
"userID": userID, "userID": userID,
"operationID": _checkOperationID(operationID),
})); }));
/// Typing /// Typing
/// ///
Future typingStatusUpdate({ Future typingStatusUpdate({
required String userID, required String userID,
bool typing = false, String? msgTip,
String? operationID,
}) => }) =>
_channel.invokeMethod( _channel.invokeMethod(
'typingStatusUpdate', 'typingStatusUpdate',
_buildParam({ _buildParam({
"typing": typing ? 'yes' : 'no', "msgTip": msgTip,
"userID": userID, "userID": userID,
"operationID": _checkOperationID(operationID),
})); }));
/// Create text message /// Create text message
/// ///
Future<Message> createTextMessage({required String text}) => _channel Future<Message> createTextMessage({
.invokeMethod('createTextMessage', _buildParam({'text': text})) required String text,
.then((value) => _toObj(value)); String? operationID,
}) =>
_channel
.invokeMethod(
'createTextMessage',
_buildParam({
'text': text,
"operationID": _checkOperationID(operationID),
}))
.then((value) => _toObj(value));
/// Create @ message /// Create @ message
/// @ /// @
Future<Message> createTextAtMessage({ Future<Message> createTextAtMessage({
required String text, required String text,
required List<String> atUidList, required List<String> atUidList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -162,26 +188,40 @@ class MessageManager {
_buildParam({ _buildParam({
'text': text, 'text': text,
'atUserList': atUidList, 'atUserList': atUidList,
"operationID": _checkOperationID(operationID),
}), }),
) )
.then((value) => _toObj(value)); .then((value) => _toObj(value));
/// Create picture message /// Create picture message
/// ///
Future<Message> createImageMessage({required String imagePath}) => _channel Future<Message> createImageMessage({
.invokeMethod( required String imagePath,
'createImageMessage', String? operationID,
_buildParam({'imagePath': imagePath}), }) =>
) _channel
.then((value) => _toObj(value)); .invokeMethod(
'createImageMessage',
_buildParam({
'imagePath': imagePath,
"operationID": _checkOperationID(operationID),
}),
)
.then((value) => _toObj(value));
/// Create picture message /// Create picture message
/// ///
Future<Message> createImageMessageFromFullPath({required String imagePath}) => Future<Message> createImageMessageFromFullPath({
required String imagePath,
String? operationID,
}) =>
_channel _channel
.invokeMethod( .invokeMethod(
'createImageMessageFromFullPath', 'createImageMessageFromFullPath',
_buildParam({'imagePath': imagePath}), _buildParam({
'imagePath': imagePath,
"operationID": _checkOperationID(operationID),
}),
) )
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -190,11 +230,16 @@ class MessageManager {
Future<Message> createSoundMessage({ Future<Message> createSoundMessage({
required String soundPath, required String soundPath,
required int duration, required int duration,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'createSoundMessage', 'createSoundMessage',
_buildParam({'soundPath': soundPath, "duration": duration}), _buildParam({
'soundPath': soundPath,
"duration": duration,
"operationID": _checkOperationID(operationID),
}),
) )
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -203,11 +248,16 @@ class MessageManager {
Future<Message> createSoundMessageFromFullPath({ Future<Message> createSoundMessageFromFullPath({
required String soundPath, required String soundPath,
required int duration, required int duration,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'createSoundMessageFromFullPath', 'createSoundMessageFromFullPath',
_buildParam({'soundPath': soundPath, "duration": duration}), _buildParam({
'soundPath': soundPath,
"duration": duration,
"operationID": _checkOperationID(operationID),
}),
) )
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -218,6 +268,7 @@ class MessageManager {
required String videoType, required String videoType,
required int duration, required int duration,
required String snapshotPath, required String snapshotPath,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -227,6 +278,7 @@ class MessageManager {
'videoType': videoType, 'videoType': videoType,
'duration': duration, 'duration': duration,
'snapshotPath': snapshotPath, 'snapshotPath': snapshotPath,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -237,6 +289,7 @@ class MessageManager {
required String videoType, required String videoType,
required int duration, required int duration,
required String snapshotPath, required String snapshotPath,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -246,6 +299,7 @@ class MessageManager {
'videoType': videoType, 'videoType': videoType,
'duration': duration, 'duration': duration,
'snapshotPath': snapshotPath, 'snapshotPath': snapshotPath,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -254,6 +308,7 @@ class MessageManager {
Future<Message> createFileMessage({ Future<Message> createFileMessage({
required String filePath, required String filePath,
required String fileName, required String fileName,
String? operationID,
}) { }) {
return _channel return _channel
.invokeMethod( .invokeMethod(
@ -261,6 +316,7 @@ class MessageManager {
_buildParam({ _buildParam({
'filePath': filePath, 'filePath': filePath,
'fileName': fileName, 'fileName': fileName,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
} }
@ -270,6 +326,7 @@ class MessageManager {
Future<Message> createFileMessageFromFullPath({ Future<Message> createFileMessageFromFullPath({
required String filePath, required String filePath,
required String fileName, required String fileName,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -277,6 +334,7 @@ class MessageManager {
_buildParam({ _buildParam({
'filePath': filePath, 'filePath': filePath,
'fileName': fileName, 'fileName': fileName,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -286,6 +344,7 @@ class MessageManager {
required List<Message> messageList, required List<Message> messageList,
required String title, required String title,
required List<String> summaryList, required List<String> summaryList,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -294,17 +353,22 @@ class MessageManager {
'messageList': messageList.map((e) => e.toJson()).toList(), 'messageList': messageList.map((e) => e.toJson()).toList(),
'title': title, 'title': title,
'summaryList': summaryList, 'summaryList': summaryList,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
/// Create forward message /// Create forward message
/// ///
Future<Message> createForwardMessage({required Message message}) { Future<Message> createForwardMessage({
required Message message,
String? operationID,
}) {
return _channel return _channel
.invokeMethod( .invokeMethod(
'createForwardMessage', 'createForwardMessage',
_buildParam({ _buildParam({
'message': message.toJson(), 'message': message.toJson(),
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
} }
@ -315,6 +379,7 @@ class MessageManager {
required double latitude, required double latitude,
required double longitude, required double longitude,
required String description, required String description,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -323,6 +388,7 @@ class MessageManager {
'latitude': latitude, 'latitude': latitude,
'longitude': longitude, 'longitude': longitude,
'description': description, 'description': description,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -332,6 +398,7 @@ class MessageManager {
required String data, required String data,
required String extension, required String extension,
required String description, required String description,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -340,6 +407,7 @@ class MessageManager {
'data': data, 'data': data,
'extension': extension, 'extension': extension,
'description': description, 'description': description,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -348,6 +416,7 @@ class MessageManager {
Future<Message> createQuoteMessage({ Future<Message> createQuoteMessage({
required String text, required String text,
required Message quoteMsg, required Message quoteMsg,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
@ -355,6 +424,7 @@ class MessageManager {
_buildParam({ _buildParam({
'quoteText': text, 'quoteText': text,
'quoteMessage': quoteMsg.toJson(), 'quoteMessage': quoteMsg.toJson(),
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
@ -362,24 +432,42 @@ class MessageManager {
/// ///
Future<Message> createCardMessage({ Future<Message> createCardMessage({
required Map<String, dynamic> data, required Map<String, dynamic> data,
String? operationID,
}) => }) =>
_channel _channel
.invokeMethod( .invokeMethod(
'createCardMessage', 'createCardMessage',
_buildParam({ _buildParam({
'cardMessage': data, 'cardMessage': data,
"operationID": _checkOperationID(operationID),
})) }))
.then((value) => _toObj(value)); .then((value) => _toObj(value));
/// Clear all c2c history message /// Clear all c2c history message
/// ///
Future<dynamic> clearC2CHistoryMessage({required String uid}) => _channel Future<dynamic> clearC2CHistoryMessage({
.invokeMethod('clearC2CHistoryMessage', _buildParam({"userID": uid})); required String uid,
String? operationID,
}) =>
_channel.invokeMethod(
'clearC2CHistoryMessage',
_buildParam({
"userID": uid,
"operationID": _checkOperationID(operationID),
}));
/// Clear all group history /// Clear all group history
/// ///
Future<dynamic> clearGroupHistoryMessage({required String gid}) => _channel Future<dynamic> clearGroupHistoryMessage({
.invokeMethod('clearGroupHistoryMessage', _buildParam({"groupID": gid})); required String gid,
String? operationID,
}) =>
_channel.invokeMethod(
'clearGroupHistoryMessage',
_buildParam({
"groupID": gid,
"operationID": _checkOperationID(operationID),
}));
/// ///
// void forceSyncMsg() { // void forceSyncMsg() {
@ -401,4 +489,8 @@ class MessageManager {
static String _printValue(value) { static String _printValue(value) {
return value; return value;
} }
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
} }

@ -0,0 +1,95 @@
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class UserManager {
MethodChannel _channel;
late UserListener userListener;
UserManager(this._channel);
/// Observe user info changes
///
Future setUserListener(UserListener listener) {
this.userListener = listener;
return _channel.invokeMethod('setUserListener', _buildParam({}));
}
/// Query user information
///
Future<List<UserInfo>> getUsersInfo({
required List<String> uidList,
String? operationID,
}) =>
_channel
.invokeMethod(
'getUsersInfo',
_buildParam({
'uidList': uidList,
'operationID': _checkOperationID(operationID),
}))
.then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast())));
/// Get the information of the currently logged in user
///
Future<UserInfo> getSelfUserInfo({
String? operationID,
}) =>
_channel
.invokeMethod(
'getSelfUserInfo',
_buildParam({
'operationID': _checkOperationID(operationID),
}))
.then((value) => UserInfo.fromJson(_formatJson(value)));
/// Modify current user info
///
Future<String?> setSelfInfo({
String? nickname,
String? faceURL,
int? gender,
int? appMangerLevel,
String? phoneNumber,
String? birth,
String? email,
String? ex,
String? operationID,
}) =>
_channel.invokeMethod(
'setSelfInfo',
_buildParam({
// 'userID': userID,
'nickname': nickname,
'faceURL': faceURL,
'gender': gender,
'appMangerLevel': appMangerLevel,
'phoneNumber': phoneNumber,
'birth': birth,
'email': email,
'ex': ex,
'operationID': _checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "userManager";
return param;
}
static List<T> _toList<T>(String? value, T f(Map map)) {
var list = _formatJson(value);
if (null == list) return <T>[];
return (list as List).map((e) => f(e)).toList();
}
static dynamic _formatJson(value) => jsonDecode(_printValue(value));
static String _printValue(value) {
return value;
}
static String _checkOperationID(String? obj) {
return obj ?? DateTime.now().millisecondsSinceEpoch.toString();
}
}

@ -10,16 +10,16 @@ class ConversationInfo {
String? userID; String? userID;
String? groupID; String? groupID;
String? showName; String? showName;
String? faceUrl; String? faceURL;
int? recvMsgOpt; int? recvMsgOpt;
int? unreadCount; int? unreadCount;
int? groupAtType;
Message? latestMsg; Message? latestMsg;
int? latestMsgSendTime; int? latestMsgSendTime;
String? draftText; String? draftText;
int? draftTimestamp; int? draftTextTime;
bool? isPinned;
/// pinned value is 1 String? ext;
dynamic isPinned;
ConversationInfo( ConversationInfo(
{required this.conversationID, {required this.conversationID,
@ -27,13 +27,13 @@ class ConversationInfo {
this.userID, this.userID,
this.groupID, this.groupID,
this.showName, this.showName,
this.faceUrl, this.faceURL,
this.recvMsgOpt, this.recvMsgOpt,
this.unreadCount, this.unreadCount,
this.latestMsg, this.latestMsg,
this.latestMsgSendTime, this.latestMsgSendTime,
this.draftText, this.draftText,
this.draftTimestamp, this.draftTextTime,
this.isPinned}); this.isPinned});
ConversationInfo.fromJson(Map<String, dynamic> json) ConversationInfo.fromJson(Map<String, dynamic> json)
@ -43,7 +43,7 @@ class ConversationInfo {
userID = json['userID']; userID = json['userID'];
groupID = json['groupID']; groupID = json['groupID'];
showName = json['showName']; showName = json['showName'];
faceUrl = json['faceUrl']; faceURL = json['faceURL'];
recvMsgOpt = json['recvMsgOpt']; recvMsgOpt = json['recvMsgOpt'];
unreadCount = json['unreadCount']; unreadCount = json['unreadCount'];
// latestMsg = json['latestMsg']; // latestMsg = json['latestMsg'];
@ -60,7 +60,7 @@ class ConversationInfo {
latestMsgSendTime = json['latestMsgSendTime']; latestMsgSendTime = json['latestMsgSendTime'];
draftText = json['draftText']; draftText = json['draftText'];
draftTimestamp = json['draftTimestamp']; draftTextTime = json['draftTextTime'];
isPinned = json['isPinned']; isPinned = json['isPinned'];
} }
@ -71,13 +71,13 @@ class ConversationInfo {
data['userID'] = this.userID; data['userID'] = this.userID;
data['groupID'] = this.groupID; data['groupID'] = this.groupID;
data['showName'] = this.showName; data['showName'] = this.showName;
data['faceUrl'] = this.faceUrl; data['faceURL'] = this.faceURL;
data['recvMsgOpt'] = this.recvMsgOpt; data['recvMsgOpt'] = this.recvMsgOpt;
data['unreadCount'] = this.unreadCount; data['unreadCount'] = this.unreadCount;
data['latestMsg'] = this.latestMsg?.toJson(); data['latestMsg'] = this.latestMsg?.toJson();
data['latestMsgSendTime'] = this.latestMsgSendTime; data['latestMsgSendTime'] = this.latestMsgSendTime;
data['draftText'] = this.draftText; data['draftText'] = this.draftText;
data['draftTimestamp'] = this.draftTimestamp; data['draftTextTime'] = this.draftTextTime;
data['isPinned'] = this.isPinned; data['isPinned'] = this.isPinned;
return data; return data;
} }
@ -86,7 +86,6 @@ class ConversationInfo {
bool get isGroupChat => conversationType == ConversationType.group_chat; bool get isGroupChat => conversationType == ConversationType.group_chat;
bool get isTop => isPinned == 1;
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>

@ -3,30 +3,43 @@ class GroupInfo {
String? groupName; String? groupName;
String? notification; String? notification;
String? introduction; String? introduction;
String? faceUrl; String? faceURL;
String? ownerId; String? ownerUserID;
int? createTime; int? createTime;
int? memberCount; int? memberCount;
int? status;
String? creatorUserID;
int? groupType;
String? ex;
GroupInfo( GroupInfo({
{required this.groupID, required this.groupID,
this.groupName, this.groupName,
this.notification, this.notification,
this.introduction, this.introduction,
this.faceUrl, this.faceURL,
this.ownerId, this.ownerUserID,
this.createTime, this.createTime,
this.memberCount}); this.memberCount,
this.status,
this.creatorUserID,
this.groupType,
this.ex,
});
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] { GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
/*groupID = json['groupID'];*/ /*groupID = json['groupID'];*/
groupName = json['groupName']; groupName = json['groupName'];
notification = json['notification']; notification = json['notification'];
introduction = json['introduction']; introduction = json['introduction'];
faceUrl = json['faceUrl']; faceURL = json['faceURL'];
ownerId = json['ownerId']; ownerUserID = json['ownerUserID'];
createTime = json['createTime']; createTime = json['createTime'];
memberCount = json['memberCount']; memberCount = json['memberCount'];
status = json['status'];
creatorUserID = json['creatorUserID'];
groupType = json['groupType'];
ex = json['ex'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,217 +48,257 @@ class GroupInfo {
data['groupName'] = this.groupName; data['groupName'] = this.groupName;
data['notification'] = this.notification; data['notification'] = this.notification;
data['introduction'] = this.introduction; data['introduction'] = this.introduction;
data['faceUrl'] = this.faceUrl; data['faceURL'] = this.faceURL;
data['ownerId'] = this.ownerId; data['ownerUserID'] = this.ownerUserID;
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
data['memberCount'] = this.memberCount; data['memberCount'] = this.memberCount;
return data; data['status'] = this.status;
} data['creatorUserID'] = this.creatorUserID;
} data['groupType'] = this.groupType;
data['ex'] = this.ex;
class GroupMembersList {
int? nextSeq;
List<GroupMembersInfo>? data;
GroupMembersList({this.nextSeq, this.data});
GroupMembersList.fromJson(Map<String, dynamic> json) {
nextSeq = json['nextSeq'];
if (json['data'] is List) {
data = (json['data'] as List)
.map((e) => GroupMembersInfo.fromJson(e))
.toList();
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['nextSeq'] = this.nextSeq;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data; return data;
} }
} }
class GroupMembersInfo { class GroupMembersInfo {
String? groupID; String? groupID;
String? userId; String? userID;
int? role; String? nickname;
String? faceURL;
int? roleLevel;
int? joinTime; int? joinTime;
String? nickName; int? joinSource;
String? faceUrl; String? operatorUserID;
dynamic ext; String? ext;
GroupMembersInfo({ GroupMembersInfo({
this.groupID, this.groupID,
this.userId, this.userID,
this.role, this.roleLevel,
this.joinTime, this.joinTime,
this.nickName, this.nickname,
this.faceUrl, this.faceURL,
this.ext, this.ext,
this.joinSource,
this.operatorUserID,
}); });
GroupMembersInfo.fromJson(Map<String, dynamic> json) { GroupMembersInfo.fromJson(Map<String, dynamic> json) {
groupID = json['groupID']; groupID = json['groupID'];
userId = json['userId']; userID = json['userID'];
role = json['role']; roleLevel = json['roleLevel'];
joinTime = json['joinTime']; joinTime = json['joinTime'];
nickName = json['nickName']; nickname = json['nickname'];
faceUrl = json['faceUrl']; faceURL = json['faceURL'];
ext = json['ext']; ext = json['ext'];
joinSource = json['joinSource'];
operatorUserID = json['operatorUserID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['groupID'] = this.groupID; data['groupID'] = this.groupID;
data['userId'] = this.userId; data['userID'] = this.userID;
data['role'] = this.role; data['roleLevel'] = this.roleLevel;
data['joinTime'] = this.joinTime; data['joinTime'] = this.joinTime;
data['nickName'] = this.nickName; data['nickname'] = this.nickname;
data['faceUrl'] = this.faceUrl; data['faceURL'] = this.faceURL;
data['ext'] = this.ext; data['ext'] = this.ext;
return data; data['joinSource'] = this.joinSource;
} data['operatorUserID'] = this.operatorUserID;
}
class GroupInviteResult {
String? uid;
int? result;
GroupInviteResult({this.uid, this.result});
GroupInviteResult.fromJson(Map<String, dynamic> json) {
uid = json['uid'];
result = json['result'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['uid'] = this.uid;
data['result'] = this.result;
return data; return data;
} }
} }
class GroupMemberRole { class GroupMemberRole {
String? uid; String? userID;
int? setRole;
/// 1 ordinary member, 2 group owners, 3 administrators
/// 1, 23
int? roleLevel;
GroupMemberRole({this.uid, this.setRole}); GroupMemberRole({this.userID, this.roleLevel = 1});
GroupMemberRole.fromJson(Map<String, dynamic> json) { GroupMemberRole.fromJson(Map<String, dynamic> json) {
uid = json['uid']; userID = json['userID'];
setRole = json['setRole']; roleLevel = json['roleLevel'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['uid'] = this.uid; data['userID'] = this.userID;
data['setRole'] = this.setRole; data['roleLevel'] = this.roleLevel;
return data; return data;
} }
} }
class GroupApplicationInfo { class GroupApplicationInfo {
String? id;
String? groupID; String? groupID;
String? fromUserID; String? groupName;
String? toUserID; String? notification;
int? flag; //INIT = 0, REFUSE = -1, AGREE = 1 String? introduction;
String? groupFaceURL;
int? createTime;
int? status;
String? creatorUserID;
int? groupType;
String? ownerUserID;
int? memberCount;
String? userID;
String? nickname;
String? userFaceURL;
int? gender;
int? handleResult; //REFUSE = -1, AGREE = 1
String? reqMsg; String? reqMsg;
String? handledMsg; String? handledMsg;
int? createTime; int? reqTime;
String? fromUserNickName; String? handleUserID;
String? toUserNickName; int? handledTime;
String? fromUserFaceURL; String? ex;
String? toUserFaceURL;
String? handledUser; GroupApplicationInfo({
int? type; //APPLICATION = 0, INVITE = 1 this.groupID,
int? handleStatus; //UNHANDLED = 0, BY_OTHER = 1, BY_SELF = 2 this.groupName,
int? handleResult; //REFUSE = 0, AGREE = 1 this.notification,
this.introduction,
GroupApplicationInfo( this.groupFaceURL,
{this.id, this.createTime,
this.groupID, this.status,
this.fromUserID, this.creatorUserID,
this.toUserID, this.groupType,
this.flag, this.ownerUserID,
this.reqMsg, this.memberCount,
this.handledMsg, this.userID,
this.createTime, this.nickname,
this.fromUserNickName, this.userFaceURL,
this.toUserNickName, this.gender,
this.fromUserFaceURL, this.handleResult,
this.toUserFaceURL, this.reqMsg,
this.handledUser, this.handledMsg,
this.type, this.reqTime,
this.handleStatus, this.handleUserID,
this.handleResult}); this.handledTime,
this.ex,
});
GroupApplicationInfo.fromJson(Map<String, dynamic> json) { GroupApplicationInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
groupID = json['groupID']; groupID = json['groupID'];
fromUserID = json['fromUserID']; groupName = json['groupName'];
toUserID = json['toUserID']; notification = json['notification'];
flag = json['flag']; introduction = json['introduction'];
reqMsg = json['reqMsg']; groupFaceURL = json['groupFaceURL'];
handledMsg = json['handledMsg'];
createTime = json['createTime']; createTime = json['createTime'];
fromUserNickName = json['fromUserNickName']; status = json['status'];
toUserNickName = json['toUserNickName']; creatorUserID = json['creatorUserID'];
fromUserFaceURL = json['fromUserFaceURL']; groupType = json['groupType'];
toUserFaceURL = json['toUserFaceURL']; ownerUserID = json['ownerUserID'];
handledUser = json['handledUser']; memberCount = json['memberCount'];
type = json['type']; userID = json['userID'];
handleStatus = json['handleStatus']; nickname = json['nickname'];
userFaceURL = json['userFaceURL'];
gender = json['gender'];
handleResult = json['handleResult']; handleResult = json['handleResult'];
reqMsg = json['reqMsg'];
handledMsg = json['handledMsg'];
reqTime = json['reqTime'];
handleUserID = json['handleUserID'];
handledTime = json['handledTime'];
ex = json['ex'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final data = Map<String, dynamic>();
data['id'] = this.id;
data['groupID'] = this.groupID; data['groupID'] = this.groupID;
data['fromUserID'] = this.fromUserID; data['groupName'] = this.groupName;
data['toUserID'] = this.toUserID; data['notification'] = this.notification;
data['flag'] = this.flag; data['introduction'] = this.introduction;
data['reqMsg'] = this.reqMsg; data['groupFaceURL'] = this.groupFaceURL;
data['handledMsg'] = this.handledMsg;
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
data['fromUserNickName'] = this.fromUserNickName; data['status'] = this.status;
data['toUserNickName'] = this.toUserNickName; data['creatorUserID'] = this.creatorUserID;
data['fromUserFaceURL'] = this.fromUserFaceURL; data['groupType'] = this.groupType;
data['toUserFaceURL'] = this.toUserFaceURL; data['ownerUserID'] = this.ownerUserID;
data['handledUser'] = this.handledUser; data['memberCount'] = this.memberCount;
data['type'] = this.type; data['userID'] = this.userID;
data['handleStatus'] = this.handleStatus; data['nickname'] = this.nickname;
data['userFaceURL'] = this.userFaceURL;
data['gender'] = this.gender;
data['handleResult'] = this.handleResult; data['handleResult'] = this.handleResult;
data['reqMsg'] = this.reqMsg;
data['handledMsg'] = this.handledMsg;
data['reqTime'] = this.reqTime;
data['handleUserID'] = this.handleUserID;
data['handledTime'] = this.handledTime;
data['ex'] = this.ex;
return data; return data;
} }
} }
class GroupApplicationList { class GroupInviteResult {
int? count; String? userID;
List<GroupApplicationInfo>? user; int? result;
GroupApplicationList({this.count, this.user}); GroupInviteResult({this.userID, this.result});
GroupApplicationList.fromJson(Map<String, dynamic> json) { GroupInviteResult.fromJson(Map<String, dynamic> json) {
count = json['count']; userID = json['userID'];
if (json['user'] is List) { result = json['result'];
user = (json['user'] as List)
.map((e) => GroupApplicationInfo.fromJson(e))
.toList();
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['count'] = this.count; data['userID'] = this.userID;
if (this.user != null) { data['result'] = this.result;
data['user'] = this.user!.map((v) => v.toJson()).toList();
}
return data; return data;
} }
} }
// class GroupMembersList {
// int? nextSeq;
// List<GroupMembersInfo>? data;
//
// GroupMembersList({this.nextSeq, this.data});
//
// GroupMembersList.fromJson(Map<String, dynamic> json) {
// nextSeq = json['nextSeq'];
// if (json['data'] is List) {
// data = (json['data'] as List)
// .map((e) => GroupMembersInfo.fromJson(e))
// .toList();
// }
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['nextSeq'] = this.nextSeq;
// if (this.data != null) {
// data['data'] = this.data!.map((v) => v.toJson()).toList();
// }
// return data;
// }
// }
//
// class GroupApplicationList {
// int? count;
// List<GroupApplicationInfo>? user;
//
// GroupApplicationList({this.count, this.user});
//
// GroupApplicationList.fromJson(Map<String, dynamic> json) {
// count = json['count'];
// if (json['user'] is List) {
// user = (json['user'] as List)
// .map((e) => GroupApplicationInfo.fromJson(e))
// .toList();
// }
// }
//
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['count'] = this.count;
// if (this.user != null) {
// data['user'] = this.user!.map((v) => v.toJson()).toList();
// }
// return data;
// }
// }

@ -3,6 +3,9 @@ class Message {
String? serverMsgID; String? serverMsgID;
int? createTime; int? createTime;
int? sendTime; int? sendTime;
/// [ConversationType]
int? sessionType;
String? sendID; String? sendID;
String? recvID; String? recvID;
int? msgFrom; int? msgFrom;
@ -10,8 +13,7 @@ class Message {
/// [MessageType] /// [MessageType]
int? contentType; int? contentType;
int? platformID; int? platformID;
List<String>? forceList; String? senderNickname;
String? senderNickName;
String? senderFaceUrl; String? senderFaceUrl;
String? groupID; String? groupID;
String? content; String? content;
@ -20,11 +22,10 @@ class Message {
/// [MessageStatus] /// [MessageStatus]
int? status; int? status;
String? remark; OfflinePushInfo? offlinePush;
String? attachedInfo;
String? ex;
dynamic ext; dynamic ext;
/// [ConversationType]
int? sessionType;
PictureElem? pictureElem; PictureElem? pictureElem;
SoundElem? soundElem; SoundElem? soundElem;
VideoElem? videoElem; VideoElem? videoElem;
@ -34,28 +35,30 @@ class Message {
CustomElem? customElem; CustomElem? customElem;
QuoteElem? quoteElem; QuoteElem? quoteElem;
MergeElem? mergeElem; MergeElem? mergeElem;
NotificationElem? notificationElem;
Message({ Message({
this.clientMsgID, this.clientMsgID,
this.serverMsgID, this.serverMsgID,
this.createTime, this.createTime,
this.sendTime, this.sendTime,
this.sessionType,
this.sendID, this.sendID,
this.recvID, this.recvID,
this.msgFrom, this.msgFrom,
this.contentType, this.contentType,
this.platformID, this.platformID,
this.forceList, this.senderNickname,
this.senderNickName,
this.senderFaceUrl, this.senderFaceUrl,
this.groupID, this.groupID,
this.content, this.content,
this.seq, this.seq,
this.isRead, this.isRead,
this.status, this.status,
this.remark, this.offlinePush,
this.attachedInfo,
this.ex,
this.ext, this.ext,
this.sessionType,
this.pictureElem, this.pictureElem,
this.soundElem, this.soundElem,
this.videoElem, this.videoElem,
@ -65,6 +68,7 @@ class Message {
this.customElem, this.customElem,
this.quoteElem, this.quoteElem,
this.mergeElem, this.mergeElem,
this.notificationElem,
}); });
Message.fromJson( Message.fromJson(
@ -78,17 +82,18 @@ class Message {
msgFrom = json['msgFrom']; msgFrom = json['msgFrom'];
contentType = json['contentType']; contentType = json['contentType'];
platformID = json['platformID']; platformID = json['platformID'];
if (json['forceList'] is List) { senderNickname = json['senderNickname'];
forceList = (json['forceList'] as List).map((e) => '$e').toList();
}
senderNickName = json['senderNickName'];
senderFaceUrl = json['senderFaceUrl']; senderFaceUrl = json['senderFaceUrl'];
groupID = json['groupID']; groupID = json['groupID'];
content = json['content']; content = json['content'];
seq = json['seq']; seq = json['seq'];
isRead = json['isRead']; isRead = json['isRead'];
status = json['status']; status = json['status'];
remark = json['remark']; offlinePush = json['offlinePush'] != null
? OfflinePushInfo.fromJson(json['offlinePush'])
: null;
attachedInfo = json['attachedInfo'];
ex = json['ex'];
ext = json['ext']; ext = json['ext'];
sessionType = json['sessionType']; sessionType = json['sessionType'];
pictureElem = json['pictureElem'] != null pictureElem = json['pictureElem'] != null
@ -116,6 +121,9 @@ class Message {
mergeElem = json['mergeElem'] != null mergeElem = json['mergeElem'] != null
? MergeElem.fromJson(json['mergeElem']) ? MergeElem.fromJson(json['mergeElem'])
: null; : null;
notificationElem = json['notificationElem'] != null
? NotificationElem.fromJson(json['notificationElem'])
: null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -129,15 +137,16 @@ class Message {
data['msgFrom'] = this.msgFrom; data['msgFrom'] = this.msgFrom;
data['contentType'] = this.contentType; data['contentType'] = this.contentType;
data['platformID'] = this.platformID; data['platformID'] = this.platformID;
data['forceList'] = this.forceList; data['senderNickname'] = this.senderNickname;
data['senderNickName'] = this.senderNickName;
data['senderFaceUrl'] = this.senderFaceUrl; data['senderFaceUrl'] = this.senderFaceUrl;
data['groupID'] = this.groupID; data['groupID'] = this.groupID;
data['content'] = this.content; data['content'] = this.content;
data['seq'] = this.seq; data['seq'] = this.seq;
data['isRead'] = this.isRead; data['isRead'] = this.isRead;
data['status'] = this.status; data['status'] = this.status;
data['remark'] = this.remark; data['offlinePush'] = this.offlinePush?.toJson();
data['attachedInfo'] = this.attachedInfo;
data['ex'] = this.ex;
data['ext'] = this.ext; data['ext'] = this.ext;
data['sessionType'] = this.sessionType; data['sessionType'] = this.sessionType;
data['pictureElem'] = this.pictureElem?.toJson(); data['pictureElem'] = this.pictureElem?.toJson();
@ -149,6 +158,7 @@ class Message {
data['customElem'] = this.customElem?.toJson(); data['customElem'] = this.customElem?.toJson();
data['quoteElem'] = this.quoteElem?.toJson(); data['quoteElem'] = this.quoteElem?.toJson();
data['mergeElem'] = this.mergeElem?.toJson(); data['mergeElem'] = this.mergeElem?.toJson();
data['notificationElem'] = this.notificationElem?.toJson();
return data; return data;
} }
@ -205,7 +215,7 @@ class PictureElem {
} }
class PictureInfo { class PictureInfo {
String? uuID; String? uuid;
String? type; String? type;
int? size; int? size;
int? width; int? width;
@ -213,10 +223,10 @@ class PictureInfo {
String? url; String? url;
PictureInfo( PictureInfo(
{this.uuID, this.type, this.size, this.width, this.height, this.url}); {this.uuid, this.type, this.size, this.width, this.height, this.url});
PictureInfo.fromJson(Map<String, dynamic> json) { PictureInfo.fromJson(Map<String, dynamic> json) {
uuID = json['uuID']; uuid = json['uuid'];
type = json['type']; type = json['type'];
size = json['size']; size = json['size'];
width = json['width']; width = json['width'];
@ -226,7 +236,7 @@ class PictureInfo {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['uuID'] = this.uuID; data['uuid'] = this.uuid;
data['type'] = this.type; data['type'] = this.type;
data['size'] = this.size; data['size'] = this.size;
data['width'] = this.width; data['width'] = this.width;
@ -237,21 +247,21 @@ class PictureInfo {
} }
class SoundElem { class SoundElem {
String? uuID; String? uuid;
String? soundPath; String? soundPath;
String? sourceUrl; String? sourceUrl;
int? dataSize; int? dataSize;
int? duration; int? duration;
SoundElem( SoundElem(
{this.uuID, {this.uuid,
this.soundPath, this.soundPath,
this.sourceUrl, this.sourceUrl,
this.dataSize, this.dataSize,
this.duration}); this.duration});
SoundElem.fromJson(Map<String, dynamic> json) { SoundElem.fromJson(Map<String, dynamic> json) {
uuID = json['uuID']; uuid = json['uuid'];
soundPath = json['soundPath']; soundPath = json['soundPath'];
sourceUrl = json['sourceUrl']; sourceUrl = json['sourceUrl'];
dataSize = json['dataSize']; dataSize = json['dataSize'];
@ -260,7 +270,7 @@ class SoundElem {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['uuID'] = this.uuID; data['uuid'] = this.uuid;
data['soundPath'] = this.soundPath; data['soundPath'] = this.soundPath;
data['sourceUrl'] = this.sourceUrl; data['sourceUrl'] = this.sourceUrl;
data['dataSize'] = this.dataSize; data['dataSize'] = this.dataSize;
@ -332,17 +342,17 @@ class VideoElem {
class FileElem { class FileElem {
String? filePath; String? filePath;
String? uuID; String? uuid;
String? sourceUrl; String? sourceUrl;
String? fileName; String? fileName;
int? fileSize; int? fileSize;
FileElem( FileElem(
{this.filePath, this.uuID, this.sourceUrl, this.fileName, this.fileSize}); {this.filePath, this.uuid, this.sourceUrl, this.fileName, this.fileSize});
FileElem.fromJson(Map<String, dynamic> json) { FileElem.fromJson(Map<String, dynamic> json) {
filePath = json['filePath']; filePath = json['filePath'];
uuID = json['uuID']; uuid = json['uuid'];
sourceUrl = json['sourceUrl']; sourceUrl = json['sourceUrl'];
fileName = json['fileName']; fileName = json['fileName'];
fileSize = json['fileSize']; fileSize = json['fileSize'];
@ -351,7 +361,7 @@ class FileElem {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['filePath'] = this.filePath; data['filePath'] = this.filePath;
data['uuID'] = this.uuID; data['uuid'] = this.uuid;
data['sourceUrl'] = this.sourceUrl; data['sourceUrl'] = this.sourceUrl;
data['fileName'] = this.fileName; data['fileName'] = this.fileName;
data['fileSize'] = this.fileSize; data['fileSize'] = this.fileSize;
@ -485,6 +495,25 @@ class MergeElem {
} }
} }
class NotificationElem {
String? detail;
String? defaultTips;
NotificationElem({this.detail, this.defaultTips});
NotificationElem.fromJson(Map<String, dynamic> json) {
detail = json['detail'];
defaultTips = json['defaultTips'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['detail'] = this.detail;
data['defaultTips'] = this.defaultTips;
return data;
}
}
class HaveReadInfo { class HaveReadInfo {
String? uid; String? uid;
List<String>? msgIDList; List<String>? msgIDList;
@ -523,3 +552,32 @@ class HaveReadInfo {
return data; return data;
} }
} }
class OfflinePushInfo {
String? title;
String? desc;
String? ex;
String? iOSPushSound;
bool? iOSBadgeCount;
OfflinePushInfo(
{this.title, this.desc, this.ex, this.iOSPushSound, this.iOSBadgeCount});
OfflinePushInfo.fromJson(Map<String, dynamic> json) {
title = json['title'];
desc = json['desc'];
ex = json['ex'];
iOSPushSound = json['iOSPushSound'];
iOSBadgeCount = json['iOSBadgeCount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
data['desc'] = this.desc;
data['ex'] = this.ex;
data['iOSPushSound'] = this.iOSPushSound;
data['iOSBadgeCount'] = this.iOSBadgeCount;
return data;
}
}

@ -1,91 +1,388 @@
/// Is a friend not in the blacklist
///
/// Not a friend on the blacklist
///
/// Not a friend is not on the blacklist
///
class UserInfo { class UserInfo {
String uid; String? userID;
String? name; String? nickname;
String? icon; String? faceURL;
int? gender; int? gender;
String? mobile; String? phoneNumber;
String? birth; int? birth;
String? email; String? email;
String? ex; String? ex;
String? comment; int? createTime;
int? isInBlackList; String? remark;
String? reqMessage;
String? applyTime; PublicUserInfo? publicInfo;
int? flag; FriendInfo? friendInfo;
BlacklistInfo? blackInfo;
UserInfo(
{required this.uid, bool? isFriendship;
this.name, bool? isBlacklist;
this.icon,
this.gender, UserInfo({
this.mobile, this.publicInfo,
this.birth, this.friendInfo,
this.email, this.blackInfo,
this.ex, this.isFriendship,
this.comment, this.isBlacklist,
this.isInBlackList, //
this.reqMessage, this.userID,
this.applyTime, this.nickname,
this.flag}); this.faceURL,
this.phoneNumber,
UserInfo.fromJson(Map<String, dynamic> json) : uid = json['uid'] { this.birth,
name = json['name']; this.gender,
icon = json['icon']; this.email,
this.ex,
this.createTime,
this.remark,
});
// UserInfo.self(Map<String, dynamic> json) {
// userID = json['userID'];
// nickname = json['nickname'];
// faceURL = json['faceURL'];
// gender = json['gender'];
// phoneNumber = json['phoneNumber'];
// birth = json['birth'];
// email = json['email'];
// ex = json['ex'];
// createTime = json['createTime'];
// }
UserInfo.fromJson(Map<String, dynamic> json) {
publicInfo = json['publicInfo'] != null
? PublicUserInfo.fromJson(json['publicInfo'])
: null;
friendInfo = json['friendInfo'] != null
? FriendInfo.fromJson(json['friendInfo'])
: null;
blackInfo = json['blackInfo'] != null
? BlacklistInfo.fromJson(json['blackInfo'])
: null;
//
isFriendship = friendInfo != null;
isBlacklist = blackInfo != null;
userID = json['userID'] ?? _userID;
nickname = json['nickname'] ?? _nickname;
faceURL = json['faceURL'] ?? _faceUrl;
gender = json['gender'] ?? _gender;
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
birth = json['birth'] ?? _birth;
email = json['email'] ?? _email;
remark = json['remark'] ?? _remark;
ex = json['ex'];
createTime = json['createTime'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['publicInfo'] = this.publicInfo?.toJson();
data['friendInfo'] = this.friendInfo?.toJson();
data['blackInfo'] = this.blackInfo?.toJson();
//
data['isFriendship'] = this.isFriendship;
data['isBlacklist'] = this.isBlacklist;
data['userID'] = this.userID;
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth;
data['email'] = this.email;
data['ex'] = this.ex;
data['createTime'] = this.createTime;
data['remark'] = this.remark;
return data;
}
// bool get isFriendship => null != friendInfo;
//
// bool get isBlacklist => null != blackInfo;
bool get isMale => gender == 1;
String get _userID => isFriendship!
? friendInfo!.userID!
: (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
String? get _nickname => isFriendship!
? friendInfo?.nickname
: (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
String? get _faceUrl => isFriendship!
? friendInfo?.faceURL
: (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
int? get _gender => isFriendship!
? friendInfo?.gender
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
String? get _phoneNumber => friendInfo?.phoneNumber;
int? get _birth => friendInfo?.birth;
String? get _email => friendInfo?.email;
String? get _remark => friendInfo?.remark;
String getShowName() => _trimBlank(remark) ?? _trimBlank(nickname) ?? userID!;
static String? _trimBlank(String? value) {
if (value == null || value.trim().isEmpty) return null;
return value;
}
}
class PublicUserInfo {
String? userID;
String? nickname;
String? faceURL;
int? gender;
int? appMangerLevel;
PublicUserInfo({
this.userID,
this.nickname,
this.faceURL,
this.gender,
this.appMangerLevel,
});
PublicUserInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
nickname = json['nickname'];
faceURL = json['faceURL'];
gender = json['gender']; gender = json['gender'];
mobile = json['mobile']; appMangerLevel = json['appMangerLevel'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['appMangerLevel'] = this.appMangerLevel;
return data;
}
}
class FriendInfo {
String? userID;
String? nickname;
String? faceURL;
int? gender;
String? phoneNumber;
int? birth;
String? email;
String? remark;
String? ex;
int? createTime;
int? addSource;
String? operatorUserID;
FriendInfo({
this.userID,
this.nickname,
this.faceURL,
this.gender,
this.phoneNumber,
this.birth,
this.email,
this.remark,
this.ex,
this.createTime,
this.addSource,
this.operatorUserID,
});
FriendInfo.fromJson(Map<String, dynamic> json) {
// ownerUserID = json['ownerUserID'];
userID = json['userID'];
remark = json['remark'];
createTime = json['createTime'];
addSource = json['addSource'];
operatorUserID = json['operatorUserID'];
nickname = json['nickname'];
faceURL = json['faceURL'];
gender = json['gender'];
phoneNumber = json['phoneNumber'];
birth = json['birth']; birth = json['birth'];
email = json['email']; email = json['email'];
ex = json['ex']; ex = json['ex'];
comment = json['comment'];
isInBlackList = json['isInBlackList'];
reqMessage = json['reqMessage'];
applyTime = json['applyTime'];
flag = json['flag'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final data = Map<String, dynamic>();
data['uid'] = this.uid; // data['ownerUserID'] = this.ownerUserID;
data['name'] = this.name; data['userID'] = this.userID;
data['icon'] = this.icon; data['remark'] = this.remark;
data['createTime'] = this.createTime;
data['addSource'] = this.addSource;
data['operatorUserID'] = this.operatorUserID;
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender; data['gender'] = this.gender;
data['mobile'] = this.mobile; data['phoneNumber'] = this.phoneNumber;
data['birth'] = this.birth; data['birth'] = this.birth;
data['email'] = this.email; data['email'] = this.email;
data['ex'] = this.ex; data['ex'] = this.ex;
data['comment'] = this.comment;
data['isInBlackList'] = this.isInBlackList;
data['reqMessage'] = this.reqMessage;
data['applyTime'] = this.applyTime;
data['flag'] = this.flag;
return data; return data;
} }
}
class BlacklistInfo {
String? userID;
String? nickname;
String? faceURL;
int? gender;
int? createTime;
int? addSource;
String? operatorUserID;
String? ex;
String getShowName() { BlacklistInfo({
if (null != comment && comment!.trim().isNotEmpty) { this.userID,
return comment!; this.nickname,
} else if (null != name && name!.trim().isNotEmpty) { this.faceURL,
return name!; this.gender,
} this.createTime,
return uid; this.addSource,
this.operatorUserID,
this.ex,
});
BlacklistInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
nickname = json['nickname'];
faceURL = json['faceURL'];
gender = json['gender'];
createTime = json['createTime'];
addSource = json['addSource'];
operatorUserID = json['operatorUserID'];
ex = json['ex'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['userID'] = this.userID;
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['createTime'] = this.createTime;
data['addSource'] = this.addSource;
data['operatorUserID'] = this.operatorUserID;
data['ex'] = this.ex;
return data;
} }
}
bool get isMan => gender == 1; class FriendshipInfo {
String? userID;
bool get isWoman => gender == 2; /// 1 means friend (and not blacklist)
/// 1
int? result;
/// blacklist FriendshipInfo({this.userID, this.result});
bool get isBlocked => isInBlackList == 1;
FriendshipInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
result = json['result'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['userID'] = this.userID;
data['result'] = this.result;
return data;
}
}
class FriendApplicationInfo {
String? fromUserID;
String? fromNickname;
String? fromFaceURL;
int? fromGender;
String? toUserID;
String? toNickname;
String? toFaceURL;
int? toGender;
int? handleResult;
String? reqMsg;
int? createTime;
String? handlerUserID;
String? handleMsg;
int? handleTime;
String? ex;
FriendApplicationInfo(
{this.fromUserID,
this.fromNickname,
this.fromFaceURL,
this.fromGender,
this.toUserID,
this.toNickname,
this.toFaceURL,
this.toGender,
this.handleResult,
this.reqMsg,
this.createTime,
this.handlerUserID,
this.handleMsg,
this.handleTime,
this.ex});
FriendApplicationInfo.fromJson(Map<String, dynamic> json) {
fromUserID = json['fromUserID'];
fromNickname = json['fromNickname'];
fromFaceURL = json['fromFaceURL'];
fromGender = json['fromGender'];
toUserID = json['toUserID'];
toNickname = json['toNickname'];
toFaceURL = json['toFaceURL'];
toGender = json['toGender'];
handleResult = json['handleResult'];
reqMsg = json['reqMsg'];
createTime = json['createTime'];
handlerUserID = json['handlerUserID'];
handleMsg = json['handleMsg'];
handleTime = json['handleTime'];
ex = json['ex'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['fromUserID'] = this.fromUserID;
data['fromNickname'] = this.fromNickname;
data['fromFaceURL'] = this.fromFaceURL;
data['fromGender'] = this.fromGender;
data['toUserID'] = this.toUserID;
data['toNickname'] = this.toNickname;
data['toFaceURL'] = this.toFaceURL;
data['toGender'] = this.toGender;
data['handleResult'] = this.handleResult;
data['reqMsg'] = this.reqMsg;
data['createTime'] = this.createTime;
data['handlerUserID'] = this.handlerUserID;
data['handleMsg'] = this.handleMsg;
data['handleTime'] = this.handleTime;
data['ex'] = this.ex;
return data;
}
/// friend application waiting handle /// friend application waiting handle
bool get isWaitingHandle => flag == 0; bool get isWaitingHandle => handleResult == 0;
/// friend application agreed /// friend application agreed
bool get isAgreed => flag == 1; bool get isAgreed => handleResult == 1;
/// friend application rejected /// friend application rejected
bool get isRejected => flag == -1; bool get isRejected => handleResult == -1;
/// exist friendship
bool get isFriendship => isAgreed;
} }

Loading…
Cancel
Save