Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d419351170 | ||
|
|
8cd7278b50 | ||
|
|
46cc7ff229 | ||
|
|
1356f13fb3 | ||
|
|
1c7f1e7c19 | ||
|
|
034f95e96e | ||
|
|
946474ad02 | ||
|
|
6bd8ec0d2b | ||
|
|
de511cf90d | ||
|
|
a9f2e267cf | ||
|
|
642cc61a2e | ||
|
|
de8c192055 | ||
|
|
05cb6c430c | ||
|
|
b07d104799 | ||
|
|
207e0807e9 | ||
|
|
373e4ddc82 | ||
|
|
b3c0b16092 | ||
|
|
8c50207f7c | ||
|
|
3bf9570d8d | ||
|
|
2a8a6ff7d9 | ||
|
|
9c8b9990c9 | ||
|
|
705863ba66 | ||
|
|
fd39b328bc | ||
|
|
90b96cb413 | ||
|
|
7894327b2c | ||
|
|
96e90d3c0a | ||
|
|
8cc844a408 | ||
|
|
9856ac8281 | ||
|
|
c9fd5d6dfb | ||
|
|
056581f52e | ||
|
|
af0ca0932f | ||
|
|
c0618458fa | ||
|
|
27eb0f78d2 | ||
|
|
169da36d0b | ||
|
|
6bd36c424a | ||
|
|
7995c4af1d | ||
|
|
5bdb9879a7 | ||
|
|
79cbae718c | ||
|
|
61fb9b7dd9 | ||
|
|
bd364ea2fd | ||
|
|
d43259d171 | ||
|
|
ce0c6ff832 | ||
|
|
1f6312d9d3 | ||
|
|
63e5ecf896 | ||
|
|
70a46ed151 | ||
|
|
f04d45f6b8 | ||
|
|
80c79d0fc6 | ||
|
|
4d8ba65f9b | ||
|
|
9df556b837 | ||
|
|
96d6b755cd | ||
|
|
3af726a6f7 | ||
|
|
041d6656bc | ||
|
|
43afb8775a |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
||||
## 3.3.0
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/OpenIMSDK/openim-sdk-core/releases/tag/v3.3.0)
|
||||
|
||||
## 3.0.0
|
||||
|
||||
- The super update is not compatible with the previous version
|
||||
|
||||
|
||||
## 2.3.5+4
|
||||
|
||||
- Fix bug
|
||||
|
||||
## 2.3.5+3
|
||||
|
||||
- Fix bug for signaling
|
||||
|
||||
@@ -52,5 +52,5 @@ android {
|
||||
dependencies {
|
||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||
api 'io.openim:core-sdk:2.3.5-t34@aar'
|
||||
implementation 'io.openim:core-sdk:3.3.0@aar'
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="io.openim.flutter_openim_sdk">
|
||||
</manifest>
|
||||
package="io.openim.flutter_openim_sdk">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.openim.flutter_openim_sdk;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -9,30 +10,31 @@ import java.lang.reflect.Method;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
|
||||
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
||||
import io.flutter.plugin.common.MethodChannel.Result;
|
||||
import io.openim.flutter_openim_sdk.connectivity.ConnectivityListener;
|
||||
import io.openim.flutter_openim_sdk.connectivity.VisibilityListener;
|
||||
import io.openim.flutter_openim_sdk.manager.ConversationManager;
|
||||
import io.openim.flutter_openim_sdk.manager.FriendshipManager;
|
||||
import io.openim.flutter_openim_sdk.manager.GroupManager;
|
||||
import io.openim.flutter_openim_sdk.manager.IMManager;
|
||||
import io.openim.flutter_openim_sdk.manager.MessageManager;
|
||||
import io.openim.flutter_openim_sdk.manager.OrganizationManager;
|
||||
import io.openim.flutter_openim_sdk.manager.SignalingManager;
|
||||
import io.openim.flutter_openim_sdk.manager.UserManager;
|
||||
import io.openim.flutter_openim_sdk.manager.WorkMomentsManager;
|
||||
|
||||
|
||||
/**
|
||||
* FlutterOpenimSdkPlugin
|
||||
*/
|
||||
public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler {
|
||||
public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware {
|
||||
/// The MethodChannel that will the communication between Flutter and native Android
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
/// when the Flutter Engine is detached from the Activity
|
||||
|
||||
private static final String CHANNEL_NAME = "flutter_openim_sdk";
|
||||
public static MethodChannel channel;
|
||||
private static IMManager imManager;
|
||||
private static UserManager userManager;
|
||||
@@ -40,30 +42,30 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
private static MessageManager messageManager;
|
||||
private static ConversationManager conversationManager;
|
||||
private static GroupManager groupManager;
|
||||
private static SignalingManager signalingManager;
|
||||
private static WorkMomentsManager workMomentsManager;
|
||||
private static OrganizationManager organizationManager;
|
||||
private static Activity activity;
|
||||
private static Context context;
|
||||
private ConnectivityListener connectivityListener;
|
||||
private VisibilityListener visibilityListener;
|
||||
public static boolean isInitialized;
|
||||
|
||||
public FlutterOpenimSdkPlugin() {
|
||||
}
|
||||
|
||||
private FlutterOpenimSdkPlugin(Context context) {
|
||||
FlutterOpenimSdkPlugin.imManager = new IMManager();
|
||||
FlutterOpenimSdkPlugin.userManager = new UserManager();
|
||||
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
|
||||
FlutterOpenimSdkPlugin.messageManager = new MessageManager();
|
||||
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();
|
||||
FlutterOpenimSdkPlugin.groupManager = new GroupManager();
|
||||
FlutterOpenimSdkPlugin.signalingManager = new SignalingManager();
|
||||
FlutterOpenimSdkPlugin.workMomentsManager = new WorkMomentsManager();
|
||||
FlutterOpenimSdkPlugin.organizationManager = new OrganizationManager();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
|
||||
FlutterOpenimSdkPlugin.channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "flutter_openim_sdk");
|
||||
FlutterOpenimSdkPlugin.channel.setMethodCallHandler(new FlutterOpenimSdkPlugin(flutterPluginBinding.getApplicationContext()));
|
||||
// channel.setMethodCallHandler(this);
|
||||
channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), CHANNEL_NAME);
|
||||
context = flutterPluginBinding.getApplicationContext();
|
||||
channel.setMethodCallHandler(this);
|
||||
connectivityListener = new ConnectivityListener(context);
|
||||
visibilityListener = new VisibilityListener();
|
||||
connectivityListener.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,6 +76,30 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
|
||||
@Override
|
||||
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
|
||||
FlutterOpenimSdkPlugin.channel.setMethodCallHandler(null);
|
||||
connectivityListener.unregisterReceiver();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
|
||||
visibilityListener.register(activity = binding.getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivityForConfigChanges() {
|
||||
visibilityListener.unregisterReceiver(activity);
|
||||
activity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
|
||||
visibilityListener.register(activity = binding.getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromActivity() {
|
||||
visibilityListener.unregisterReceiver(activity);
|
||||
activity = null;
|
||||
}
|
||||
|
||||
void parse(@NonNull MethodCall call, @NonNull Result result) {
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.os.Build;
|
||||
|
||||
public class Connectivity {
|
||||
static final String CONNECTIVITY_NONE = "none";
|
||||
static final String CONNECTIVITY_WIFI = "wifi";
|
||||
static final String CONNECTIVITY_MOBILE = "mobile";
|
||||
static final String CONNECTIVITY_ETHERNET = "ethernet";
|
||||
static final String CONNECTIVITY_BLUETOOTH = "bluetooth";
|
||||
static final String CONNECTIVITY_VPN = "vpn";
|
||||
private final ConnectivityManager connectivityManager;
|
||||
|
||||
public Connectivity(ConnectivityManager connectivityManager) {
|
||||
this.connectivityManager = connectivityManager;
|
||||
}
|
||||
|
||||
String getNetworkType() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
Network network = connectivityManager.getActiveNetwork();
|
||||
NetworkCapabilities capabilities = connectivityManager.getNetworkCapabilities(network);
|
||||
if (capabilities == null) {
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
|
||||
return CONNECTIVITY_WIFI;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) {
|
||||
return CONNECTIVITY_ETHERNET;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) {
|
||||
return CONNECTIVITY_VPN;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)) {
|
||||
return CONNECTIVITY_MOBILE;
|
||||
}
|
||||
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH)) {
|
||||
return CONNECTIVITY_BLUETOOTH;
|
||||
}
|
||||
}
|
||||
|
||||
return getNetworkTypeLegacy();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private String getNetworkTypeLegacy() {
|
||||
// handle type for Android versions less than Android 6
|
||||
android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo();
|
||||
if (info == null || !info.isConnected()) {
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
int type = info.getType();
|
||||
switch (type) {
|
||||
case ConnectivityManager.TYPE_BLUETOOTH:
|
||||
return CONNECTIVITY_BLUETOOTH;
|
||||
case ConnectivityManager.TYPE_ETHERNET:
|
||||
return CONNECTIVITY_ETHERNET;
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
case ConnectivityManager.TYPE_WIMAX:
|
||||
return CONNECTIVITY_WIFI;
|
||||
case ConnectivityManager.TYPE_VPN:
|
||||
return CONNECTIVITY_VPN;
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
case ConnectivityManager.TYPE_MOBILE_DUN:
|
||||
case ConnectivityManager.TYPE_MOBILE_HIPRI:
|
||||
return CONNECTIVITY_MOBILE;
|
||||
default:
|
||||
return CONNECTIVITY_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public ConnectivityManager getConnectivityManager() {
|
||||
return connectivityManager;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.os.Build;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
|
||||
public class ConnectivityListener implements open_im_sdk_callback.Base {
|
||||
public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||
private Context context;
|
||||
private ConnectivityManager connectivityManager;
|
||||
private Connectivity connectivity;
|
||||
private ConnectivityBroadcastReceiver receiver;
|
||||
private ConnectivityManager.NetworkCallback networkCallback;
|
||||
|
||||
public ConnectivityListener(Context context) {
|
||||
this.context = context;
|
||||
this.connectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
this.connectivity = new Connectivity(connectivityManager);
|
||||
this.receiver = new ConnectivityBroadcastReceiver(this);
|
||||
}
|
||||
|
||||
private void onChangedNetworkStatus() {
|
||||
String status = connectivity.getNetworkType();
|
||||
if (Connectivity.CONNECTIVITY_MOBILE.equals(status) || Connectivity.CONNECTIVITY_WIFI.equals(status)) {
|
||||
Log.i("ConnectivityListener", "networkStatusChanged: " + status);
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.networkStatusChanged(this, String.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
networkCallback = new ConnectivityManager.NetworkCallback() {
|
||||
@Override
|
||||
public void onAvailable(Network network) {
|
||||
onChangedNetworkStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLost(Network network) {
|
||||
}
|
||||
};
|
||||
connectivity.getConnectivityManager().registerDefaultNetworkCallback(networkCallback);
|
||||
} else {
|
||||
context.registerReceiver(receiver, new IntentFilter(CONNECTIVITY_ACTION));
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterReceiver() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (networkCallback != null) {
|
||||
connectivity.getConnectivityManager().unregisterNetworkCallback(networkCallback);
|
||||
networkCallback = null;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
context.unregisterReceiver(receiver);
|
||||
receiver = null;
|
||||
} catch (Exception e) {
|
||||
//listen never called, ignore the error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
|
||||
}
|
||||
|
||||
public static class ConnectivityBroadcastReceiver extends BroadcastReceiver {
|
||||
ConnectivityListener listener;
|
||||
|
||||
public ConnectivityBroadcastReceiver(ConnectivityListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (null != listener && CONNECTIVITY_ACTION.equals(intent.getAction())) {
|
||||
listener.onChangedNetworkStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package io.openim.flutter_openim_sdk.connectivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import io.flutter.Log;
|
||||
import io.openim.flutter_openim_sdk.FlutterOpenimSdkPlugin;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class VisibilityListener implements Application.ActivityLifecycleCallbacks, open_im_sdk_callback.Base {
|
||||
public void register(Activity activity) {
|
||||
if (null != activity) {
|
||||
activity.getApplication().registerActivityLifecycleCallbacks(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterReceiver(Activity activity) {
|
||||
if (null != activity) {
|
||||
activity.getApplication().unregisterActivityLifecycleCallbacks(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
Log.i("VisibilityListener", "onActivityCreated");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityStarted");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityResumed");
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.setAppBackgroundStatus(this, String.valueOf(System.currentTimeMillis()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityPaused");
|
||||
if (FlutterOpenimSdkPlugin.isInitialized) {
|
||||
Open_im_sdk.setAppBackgroundStatus(this, String.valueOf(System.currentTimeMillis()), true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityStopped");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
|
||||
Log.i("VisibilityListener", "onActivitySaveInstanceState");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
Log.i("VisibilityListener", "onActivityDestroyed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,19 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
this.id = listenerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgDeleted(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onMsgDeleted", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessageV2", s);
|
||||
values.put("messageRevoked", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onNewRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@@ -25,7 +33,7 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
public void onRecvC2CReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("c2cMessageReadReceipt", s);
|
||||
values.put("msgReceiptList", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||
}
|
||||
|
||||
@@ -33,16 +41,17 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
public void onRecvGroupReadReceipt(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("groupMessageReadReceipt", s);
|
||||
values.put("groupMsgReceiptList", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvGroupReadReceipt", values);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRecvMessageExtensionsAdded(String s, String s1) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("msgID", s);
|
||||
values.put("list", s1);
|
||||
values.put("reactionExtensionList", s1);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsAdded", values);
|
||||
}
|
||||
|
||||
@@ -51,7 +60,7 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("msgID", s);
|
||||
values.put("list", s1);
|
||||
values.put("reactionExtensionList", s1);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsChanged", values);
|
||||
}
|
||||
|
||||
@@ -60,23 +69,23 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("msgID", s);
|
||||
values.put("list", s1);
|
||||
values.put("reactionExtensionKeyList", s1);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsDeleted", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvMessageRevoked(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("revokedMessage", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageRevoked", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("newMessage", s);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvNewMessage", values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecvOfflineNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("message", s);
|
||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvOfflineNewMessage", values);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ public class OnBaseListener implements Base {
|
||||
|
||||
@Override
|
||||
public void onError(int l, String s) {
|
||||
Log.i("F-OpenIMSDK(flutter call native)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
Log.i("F-OpenIMSDK(flutter call native)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||
CommonUtil.runMainThreadReturn(result, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipLi
|
||||
|
||||
@Override
|
||||
public void onBlackAdded(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
|
||||
CommonUtil.emitEvent("friendListener", "onBlackAdded", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlackDeleted(String s) {
|
||||
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
|
||||
CommonUtil.emitEvent("friendListener", "onBlackDeleted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,11 @@ public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupDismissed(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupDismissed", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGroupInfoChanged(String s) {
|
||||
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnOrganizationListener implements open_im_sdk_callback.OnOrganizationListener {
|
||||
@Override
|
||||
public void onOrganizationUpdated() {
|
||||
CommonUtil.emitEvent("organizationListener", "onOrganizationUpdated", null);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnSignalingListener implements open_im_sdk_callback.OnSignalingListener {
|
||||
|
||||
@Override
|
||||
public void onInvitationCancelled(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInvitationCancelled", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInvitationTimeout(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInvitationTimeout", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeAccepted(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeAccepted", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeAcceptedByOtherDevice(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeAcceptedByOtherDevice", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeRejected(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeRejected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInviteeRejectedByOtherDevice(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onInviteeRejectedByOtherDevice", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveCustomSignal(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onReceiveCustomSignal", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveNewInvitation(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onReceiveNewInvitation", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomParticipantConnected(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onRoomParticipantConnected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomParticipantDisconnected(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onRoomParticipantDisconnected", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamChange(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onStreamChange", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHangUp(String s) {
|
||||
CommonUtil.emitEvent("signalingListener", "onHangUp", s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk_callback.UploadFileCallback;
|
||||
|
||||
public class OnUploadFileListener implements UploadFileCallback {
|
||||
final private MethodChannel.Result result;
|
||||
final private Object id;
|
||||
|
||||
public OnUploadFileListener(MethodChannel.Result result, MethodCall call) {
|
||||
this.result = result;
|
||||
this.id = call.argument("id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void complete(long size, String url, long type) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("size", size);
|
||||
values.put("url", url);
|
||||
values.put("type", type);
|
||||
CommonUtil.emitEvent("uploadFileListener", "complete", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hashPartComplete(String partHash, String fileHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("partHash", partHash);
|
||||
values.put("fileHash", fileHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "hashPartComplete", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hashPartProgress(long index, long size, String partHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("index", index);
|
||||
values.put("size", size);
|
||||
values.put("partHash", partHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "hashPartProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(long size) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("size", size);
|
||||
CommonUtil.emitEvent("uploadFileListener", "open", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partSize(long partSize, long num) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("partSize", partSize);
|
||||
values.put("num", num);
|
||||
CommonUtil.emitEvent("uploadFileListener", "partSize", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadComplete(long fileSize, long streamSize, long storageSize) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("fileSize", fileSize);
|
||||
values.put("streamSize", streamSize);
|
||||
values.put("storageSize", storageSize);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadProgress", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadID(String uploadID) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("uploadID", uploadID);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadID", values);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadPartComplete(long index, long partSize, String partHash) {
|
||||
if (null != id) {
|
||||
final Map<String, Object> values = new ArrayMap<>();
|
||||
values.put("id", id);
|
||||
values.put("index", index);
|
||||
values.put("partSize", partSize);
|
||||
values.put("partHash", partHash);
|
||||
CommonUtil.emitEvent("uploadFileListener", "uploadPartComplete", values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,9 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
||||
public void onSelfInfoUpdated(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserStatusChanged(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package io.openim.flutter_openim_sdk.listener;
|
||||
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
|
||||
public class OnWorkMomentsListener implements open_im_sdk_callback.OnWorkMomentsListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void onRecvNewNotification() {
|
||||
CommonUtil.emitEvent("workMomentsListener", "OnRecvNewNotification", null);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class ConversationManager extends BaseManager {
|
||||
Open_im_sdk.getOneConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "sessionType"),
|
||||
value(methodCall, "sessionType"),
|
||||
value(methodCall, "sourceID")
|
||||
);
|
||||
}
|
||||
@@ -49,13 +49,6 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationDraft(
|
||||
@@ -75,19 +68,19 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.markSingleMessageHasRead(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// value(methodCall, "userID")
|
||||
// );
|
||||
// }
|
||||
|
||||
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageHasRead(
|
||||
public void hideConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.hideConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markConversationMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markConversationMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,6 +93,7 @@ public class ConversationManager extends BaseManager {
|
||||
|
||||
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getConversationIDBySessionType(
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "sourceID"),
|
||||
int2long(methodCall, "sessionType")));
|
||||
}
|
||||
@@ -108,7 +102,7 @@ public class ConversationManager extends BaseManager {
|
||||
Open_im_sdk.setConversationRecvMessageOpt(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "conversationIDList"),
|
||||
value(methodCall, "conversationID"),
|
||||
int2long(methodCall, "status")
|
||||
);
|
||||
}
|
||||
@@ -121,8 +115,8 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void setOneConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setOneConversationPrivateChat(
|
||||
public void setConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationPrivateChat(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
@@ -130,8 +124,16 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversationFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversationFromLocalAndSvr(
|
||||
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
@@ -154,7 +156,7 @@ public class ConversationManager extends BaseManager {
|
||||
}
|
||||
|
||||
public void getAtAllTag(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag());
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag(value(methodCall, "operationID")));
|
||||
}
|
||||
|
||||
public void setGlobalRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -165,12 +167,30 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void setOneConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setOneConversationBurnDuration(
|
||||
public void setConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationBurnDuration(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "burnDuration")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationIsMsgDestruct(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationIsMsgDestruct(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "isMsgDestruct")
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationMsgDestructTime(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationMsgDestructTime(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
int2long(methodCall, "duration")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@ public class FriendshipManager extends BaseManager {
|
||||
}
|
||||
|
||||
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getDesignatedFriendsInfo(
|
||||
Open_im_sdk.getSpecifiedFriendsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,15 +31,15 @@ public class FriendshipManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvFriendApplicationList(
|
||||
public void getFriendApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendFriendApplicationList(
|
||||
public void getFriendApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
@@ -64,7 +64,7 @@ public class FriendshipManager extends BaseManager {
|
||||
Open_im_sdk.addBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class FriendshipManager extends BaseManager {
|
||||
Open_im_sdk.removeBlack(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class FriendshipManager extends BaseManager {
|
||||
Open_im_sdk.checkFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class FriendshipManager extends BaseManager {
|
||||
Open_im_sdk.deleteFriend(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.inviteUserToGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,18 +28,18 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.kickGroupMember(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupMembersInfo(
|
||||
Open_im_sdk.getSpecifiedGroupMembersInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "uidList")
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "userIDList")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.getGroupMemberList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "filter"),
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count")
|
||||
@@ -66,8 +66,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.createGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gInfo"),
|
||||
jsonValue(methodCall, "memberList")
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,16 +74,15 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.setGroupInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
jsonValue(methodCall, "gInfo")
|
||||
jsonValue(methodCall, "groupInfo")
|
||||
);
|
||||
}
|
||||
|
||||
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupsInfo(
|
||||
Open_im_sdk.getSpecifiedGroupsInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "gidList")
|
||||
jsonValue(methodCall, "groupIDList")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -92,7 +90,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.joinGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "reason"),
|
||||
value(methodCall, "joinSource")
|
||||
);
|
||||
@@ -102,7 +100,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.quitGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -110,20 +108,20 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.transferGroupOwner(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid")
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getRecvGroupApplicationList(
|
||||
public void getGroupApplicationListAsRecipient(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsRecipient(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSendGroupApplicationList(
|
||||
public void getGroupApplicationListAsApplicant(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getGroupApplicationListAsApplicant(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
@@ -133,8 +131,8 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.acceptGroupApplication(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
@@ -144,8 +142,8 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.refuseGroupApplication(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "handleMsg")
|
||||
);
|
||||
|
||||
@@ -155,7 +153,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.dismissGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid")
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -163,7 +161,7 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.changeGroupMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "mute")
|
||||
);
|
||||
}
|
||||
@@ -172,8 +170,8 @@ public class GroupManager extends BaseManager {
|
||||
Open_im_sdk.changeGroupMemberMute(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
int2long(methodCall, "seconds")
|
||||
);
|
||||
}
|
||||
@@ -181,8 +179,8 @@ public class GroupManager extends BaseManager {
|
||||
public void setGroupMemberNickname(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setGroupMemberNickname(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "gid"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "groupNickname")
|
||||
);
|
||||
}
|
||||
@@ -259,4 +257,11 @@ public class GroupManager extends BaseManager {
|
||||
jsonValue(methodCall, "info")
|
||||
);
|
||||
}
|
||||
|
||||
public void isJoinGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.isJoinGroup(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,27 +2,33 @@ 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.FlutterOpenimSdkPlugin;
|
||||
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnConnListener;
|
||||
import io.openim.flutter_openim_sdk.listener.OnListenerForService;
|
||||
import io.openim.flutter_openim_sdk.listener.OnUploadFileListener;
|
||||
import io.openim.flutter_openim_sdk.util.CommonUtil;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class IMManager extends BaseManager {
|
||||
|
||||
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
|
||||
boolean initialized = Open_im_sdk.initSDK(
|
||||
new OnConnListener(),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall))
|
||||
);
|
||||
jsonValue(methodCall));
|
||||
FlutterOpenimSdkPlugin.isInitialized = initialized;
|
||||
CommonUtil.runMainThreadReturn(result, initialized);
|
||||
}
|
||||
|
||||
public void unInitSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.unInitSDK(value(methodCall, "operationID"));
|
||||
}
|
||||
|
||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.login(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "uid"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "token")
|
||||
);
|
||||
}
|
||||
@@ -35,23 +41,15 @@ public class IMManager extends BaseManager {
|
||||
}
|
||||
|
||||
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus());
|
||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginStatus(value(methodCall, "operationID")));
|
||||
}
|
||||
|
||||
public void wakeUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.wakeUp(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void uploadImage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.uploadImage(
|
||||
public void uploadFile(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.uploadFile(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "path"),
|
||||
value(methodCall, "token"),
|
||||
value(methodCall, "obj")
|
||||
jsonValue(methodCall),
|
||||
new OnUploadFileListener(result, methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -72,17 +70,18 @@ public class IMManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void networkChanged(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.networkChanged(
|
||||
|
||||
public void networkStatusChanged(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.networkStatusChanged(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setListenerForService(new OnListenerForService());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
// public void setListenerForService(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setListenerForService(new OnListenerForService());
|
||||
//
|
||||
// result.success(null);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -100,19 +100,12 @@ public class MessageManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.revokeMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -120,13 +113,33 @@ public class MessageManager extends BaseManager {
|
||||
Open_im_sdk.deleteMessageFromLocalStorage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessages(new OnBaseListener(result, methodCall), CommonUtil.getSDKJsonParam(methodCall));
|
||||
// }
|
||||
public void deleteMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocal(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.insertSingleMessageToLocalStorage(
|
||||
@@ -148,20 +161,11 @@ public class MessageManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markC2CMessageAsRead(
|
||||
public void markMessagesAsReadByMsgID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markMessagesAsReadByMsgID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void markGroupMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markGroupMessageAsRead(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
value(methodCall, "conversationID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
@@ -317,109 +321,6 @@ public class MessageManager extends BaseManager {
|
||||
));
|
||||
}
|
||||
|
||||
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearC2CHistoryMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void searchLocalMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchLocalMessages(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "filter")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocal(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteAllMsgFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteAllMsgFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void markMessageAsReadByConID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.markMessageAsReadByConID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
jsonValue(methodCall, "messageIDList")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearC2CHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearC2CHistoryMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void clearGroupHistoryMessageFromLocalAndSvr(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearGroupHistoryMessageFromLocalAndSvr(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getHistoryMessageListReverse(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getHistoryMessageListReverse(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void newRevokeMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.newRevokeMessage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAdvancedHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void findMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.findMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "searchParams")
|
||||
);
|
||||
}
|
||||
|
||||
public void createAdvancedTextMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
CommonUtil.runMainThreadReturn(result,
|
||||
Open_im_sdk.createAdvancedTextMessage(
|
||||
@@ -439,6 +340,57 @@ public class MessageManager extends BaseManager {
|
||||
));
|
||||
}
|
||||
|
||||
public void searchLocalMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchLocalMessages(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "filter")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public void getAdvancedHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAdvancedHistoryMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void getAdvancedHistoryMessageListReverse(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getAdvancedHistoryMessageListReverse(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
public void findMessageList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.findMessageList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "searchParams")
|
||||
);
|
||||
}
|
||||
|
||||
public void setMessageLocalEx(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setMessageLocalEx(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "clientMsgID"),
|
||||
value(methodCall, "localEx")
|
||||
);
|
||||
}
|
||||
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.sendMessageNotOss(
|
||||
new OnMsgSendListener(result, methodCall),
|
||||
@@ -492,47 +444,47 @@ public class MessageManager extends BaseManager {
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setMessageReactionExtensions(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
jsonValue(methodCall, "list")
|
||||
);
|
||||
}
|
||||
|
||||
public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.deleteMessageReactionExtensions(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
jsonValue(methodCall, "list")
|
||||
);
|
||||
}
|
||||
|
||||
public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getMessageListReactionExtensions(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "messageList")
|
||||
);
|
||||
}
|
||||
|
||||
public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.addMessageReactionExtensions(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "message"),
|
||||
jsonValue(methodCall, "list")
|
||||
);
|
||||
}
|
||||
|
||||
public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getMessageListSomeReactionExtensions(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "messageList"),
|
||||
jsonValue(methodCall, "list")
|
||||
);
|
||||
}
|
||||
// public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.setMessageReactionExtensions(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// jsonValue(methodCall, "message"),
|
||||
// jsonValue(methodCall, "list")
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.deleteMessageReactionExtensions(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// jsonValue(methodCall, "message"),
|
||||
// jsonValue(methodCall, "list")
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.getMessageListReactionExtensions(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// jsonValue(methodCall, "messageList")
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.addMessageReactionExtensions(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// jsonValue(methodCall, "message"),
|
||||
// jsonValue(methodCall, "list")
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
|
||||
// Open_im_sdk.getMessageListSomeReactionExtensions(
|
||||
// new OnBaseListener(result, methodCall),
|
||||
// value(methodCall, "operationID"),
|
||||
// jsonValue(methodCall, "messageList"),
|
||||
// jsonValue(methodCall, "list")
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
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.OnOrganizationListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class OrganizationManager extends BaseManager {
|
||||
|
||||
public void setOrganizationListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setOrganizationListener(new OnOrganizationListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void getSubDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSubDepartment(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "departmentID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void getDepartmentMember(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getDepartmentMember(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "departmentID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void getUserInDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUserInDepartment(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "userID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getDepartmentMemberAndSubDepartment(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getDepartmentMemberAndSubDepartment(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "departmentID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getDepartmentInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getDepartmentInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "departmentID")
|
||||
);
|
||||
}
|
||||
|
||||
public void searchOrganization(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.searchOrganization(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "searchParam"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
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.OnSignalingListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class SignalingManager extends BaseManager {
|
||||
|
||||
public void setSignalingListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setSignalingListener(new OnSignalingListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void signalingInvite(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingInvite(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingInviteInGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingInviteInGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingAccept(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingAccept(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingReject(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingReject(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingCancel(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingCancel(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingHungUp(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingHungUp(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "signalingInfo"));
|
||||
}
|
||||
|
||||
public void signalingGetRoomByGroupID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingGetRoomByGroupID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"));
|
||||
}
|
||||
|
||||
public void signalingGetTokenByRoomID(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingGetTokenByRoomID(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "roomID"));
|
||||
}
|
||||
|
||||
public void signalingUpdateMeetingInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingUpdateMeetingInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "info"));
|
||||
}
|
||||
|
||||
public void signalingCreateMeeting(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingCreateMeeting(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "info"));
|
||||
}
|
||||
|
||||
public void signalingJoinMeeting(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingJoinMeeting(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "info"));
|
||||
}
|
||||
|
||||
public void signalingOperateStream(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingOperateStream(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "streamType"),
|
||||
value(methodCall, "roomID"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "mute"),
|
||||
value(methodCall, "muteAll"));
|
||||
}
|
||||
|
||||
public void signalingGetMeetings(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingGetMeetings(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"));
|
||||
}
|
||||
|
||||
public void signalingCloseRoom(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingCloseRoom(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "roomID"));
|
||||
}
|
||||
|
||||
public void signalingSendCustomSignal(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.signalingSendCustomSignal(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "customInfo"),
|
||||
value(methodCall, "roomID"));
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class UserManager extends BaseManager {
|
||||
Open_im_sdk.getUsersInfo(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "uidList"));
|
||||
jsonValue(methodCall, "userIDList"));
|
||||
}
|
||||
|
||||
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
|
||||
@@ -34,4 +34,39 @@ public class UserManager extends BaseManager {
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
public void subscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.subscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void unsubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.unsubscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void getSubscribeUsersStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getSubscribeUsersStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getUserStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUserStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"));
|
||||
}
|
||||
|
||||
public void getUsersInfoStranger(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInfoStranger(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDs"),
|
||||
value(methodCall, "groupID"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
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.OnWorkMomentsListener;
|
||||
import open_im_sdk.Open_im_sdk;
|
||||
|
||||
public class WorkMomentsManager extends BaseManager {
|
||||
|
||||
public void setWorkMomentsListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setWorkMomentsListener(new OnWorkMomentsListener());
|
||||
|
||||
result.success(null);
|
||||
}
|
||||
|
||||
public void getWorkMomentsUnReadCount(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getWorkMomentsUnReadCount(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"));
|
||||
}
|
||||
|
||||
public void getWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "offset"),
|
||||
int2long(methodCall, "count"));
|
||||
}
|
||||
|
||||
public void clearWorkMomentsNotification(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.clearWorkMomentsNotification(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"));
|
||||
}
|
||||
}
|
||||
29
example/ios/Podfile.lock
Normal file
29
example/ios/Podfile.lock
Normal file
@@ -0,0 +1,29 @@
|
||||
PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_openim_sdk (0.0.1):
|
||||
- Flutter
|
||||
- OpenIMSDKCore (= 3.0.0)
|
||||
- "OpenIMSDKCore (3.0.0+1)"
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_openim_sdk (from `.symlinks/plugins/flutter_openim_sdk/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- OpenIMSDKCore
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_openim_sdk:
|
||||
:path: ".symlinks/plugins/flutter_openim_sdk/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_openim_sdk: 12daf3769f8bf40001970304445b6155c146b7eb
|
||||
OpenIMSDKCore: 2e38a5b9be23e588b5049ebd378161cf277e41a0
|
||||
|
||||
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
|
||||
|
||||
COCOAPODS: 1.11.2
|
||||
@@ -9,8 +9,8 @@
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
79CF11091A38454F94DA1EB4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
@@ -30,16 +30,16 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
3F8F3496860058CED33C418C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
564E6205C72C7CB32AC49601 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
85A1617DD2AFC45DFFDD8B11 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -54,17 +54,17 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */,
|
||||
79CF11091A38454F94DA1EB4 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
4B877210D623EE0FDE18A08F /* Frameworks */ = {
|
||||
0EDFEBEB76AE7FAFA44EF2AF /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */,
|
||||
2F48A41A58786A29BEEBCFE3 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -87,7 +87,7 @@
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
E653626F5A38799455FF26C4 /* Pods */,
|
||||
4B877210D623EE0FDE18A08F /* Frameworks */,
|
||||
0EDFEBEB76AE7FAFA44EF2AF /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -117,9 +117,9 @@
|
||||
E653626F5A38799455FF26C4 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */,
|
||||
3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
|
||||
076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
|
||||
85A1617DD2AFC45DFFDD8B11 /* Pods-Runner.debug.xcconfig */,
|
||||
3F8F3496860058CED33C418C /* Pods-Runner.release.xcconfig */,
|
||||
564E6205C72C7CB32AC49601 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -131,7 +131,7 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */,
|
||||
DFE84742E2B41158E8703A14 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
@@ -226,7 +226,7 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */ = {
|
||||
DFE84742E2B41158E8703A14 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -348,7 +348,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -480,7 +480,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -504,7 +504,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.flutterOpenimSdkExample;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -1,122 +1,103 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,19 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,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>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -22,6 +24,8 @@
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
@@ -41,9 +45,5 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
@@ -14,6 +14,13 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
OpenIM.iMManager.initSDK(
|
||||
platformID: 1,
|
||||
apiAddr: '',
|
||||
wsAddr: '',
|
||||
dataDir: '/',
|
||||
objectStorage: 'minio',
|
||||
listener: OnConnectListener());
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -68,7 +68,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "2.3.5+2"
|
||||
version: "3.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
||||
@@ -10,22 +10,22 @@ public class ConversationManager: BaseServiceManager {
|
||||
self["getConversationListSplit"] = getConversationListSplit
|
||||
self["getOneConversation"] = getOneConversation
|
||||
self["getMultipleConversation"] = getMultipleConversation
|
||||
self["deleteConversation"] = deleteConversation
|
||||
self["setConversationDraft"] = setConversationDraft
|
||||
self["pinConversation"] = pinConversation
|
||||
// self["markSingleMessageHasRead"] = markSingleMessageHasRead
|
||||
self["markGroupMessageHasRead"] = markGroupMessageHasRead
|
||||
self["hideConversation"] = hideConversation
|
||||
self["markConversationMessageAsRead"] = markConversationMessageAsRead
|
||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
||||
self["setOneConversationPrivateChat"] = setOneConversationPrivateChat
|
||||
self["deleteConversationFromLocalAndSvr"] = deleteConversationFromLocalAndSvr
|
||||
self["setConversationPrivateChat"] = setConversationPrivateChat
|
||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||
self["deleteConversationAndDeleteAllMsg"] = deleteConversationAndDeleteAllMsg
|
||||
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
|
||||
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
||||
self["getAtAllTag"] = getAtAllTag
|
||||
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
|
||||
self["setOneConversationBurnDuration"] = setOneConversationBurnDuration
|
||||
self["setConversationBurnDuration"] = setConversationBurnDuration
|
||||
}
|
||||
|
||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -42,17 +42,13 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"])
|
||||
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "sessionType"], methodCall[string: "sourceID"])
|
||||
}
|
||||
|
||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
|
||||
}
|
||||
@@ -61,12 +57,12 @@ public class ConversationManager: BaseServiceManager {
|
||||
Open_im_sdkPinConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"])
|
||||
}
|
||||
|
||||
// func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"])
|
||||
// }
|
||||
func hideConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkHideConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
func markConversationMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkConversationMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -74,24 +70,28 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||
let conversationID = Open_im_sdkGetConversationIDBySessionType( methodCall[string: "operationID"],methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||
callBack(result, conversationID)
|
||||
}
|
||||
|
||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"])
|
||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func setOneConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOneConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
func setConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
||||
}
|
||||
|
||||
func deleteConversationFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversationFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -103,15 +103,15 @@ public class ConversationManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result, Open_im_sdkGetAtAllTag())
|
||||
callBack(result, Open_im_sdkGetAtAllTag(methodCall[string: "operationID"]))
|
||||
}
|
||||
|
||||
func setGlobalRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGlobalRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "status"])
|
||||
}
|
||||
|
||||
func setOneConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOneConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
|
||||
func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["getFriendsInfo"] = getFriendsInfo
|
||||
self["addFriend"] = addFriend
|
||||
self["getRecvFriendApplicationList"] = getRecvFriendApplicationList
|
||||
self["getSendFriendApplicationList"] = getSendFriendApplicationList
|
||||
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
|
||||
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
|
||||
self["getFriendList"] = getFriendList
|
||||
self["setFriendRemark"] = setFriendRemark
|
||||
self["addBlacklist"] = addBlacklist
|
||||
@@ -20,9 +20,6 @@ public class FriendshipManager: BaseServiceManager {
|
||||
self["acceptFriendApplication"] = acceptFriendApplication
|
||||
self["refuseFriendApplication"] = refuseFriendApplication
|
||||
self["searchFriends"] = searchFriends
|
||||
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
|
||||
// self["forceSyncFriend"] = forceSyncFriend
|
||||
// self["forceSyncBlackList"] = forceSyncBlackList
|
||||
}
|
||||
|
||||
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -31,19 +28,19 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetSpecifiedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -55,7 +52,7 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -63,15 +60,15 @@ public class FriendshipManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"])
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -85,20 +82,6 @@ public class FriendshipManager: BaseServiceManager {
|
||||
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||
}
|
||||
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncFriendApplication()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncFriend()
|
||||
// callBack(result)
|
||||
// }
|
||||
//
|
||||
// func forceSyncBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
// Open_im_sdkForceSyncBlackList()
|
||||
// callBack(result)
|
||||
// }
|
||||
}
|
||||
|
||||
public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListenerProtocol {
|
||||
@@ -109,11 +92,15 @@ public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListe
|
||||
}
|
||||
|
||||
public func onBlackAdded(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackAdded", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onBlackDeleted(_ blackInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackDeleted", errCode: nil, errMsg: nil, data: blackInfo)
|
||||
}
|
||||
|
||||
public func onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendApplicationAccepted(_ friendApplication: String?) {
|
||||
@@ -132,16 +119,12 @@ public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListe
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationRejected", errCode: nil, errMsg: nil, data: friendApplication)
|
||||
}
|
||||
|
||||
public func onFriendInfoChanged(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendAdded(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendDeleted(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendDeleted", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
|
||||
public func onFriendInfoChanged(_ friendInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ public class GroupManager: BaseServiceManager {
|
||||
self["joinGroup"] = joinGroup
|
||||
self["quitGroup"] = quitGroup
|
||||
self["transferGroupOwner"] = transferGroupOwner
|
||||
self["getRecvGroupApplicationList"] = getRecvGroupApplicationList
|
||||
self["getSendGroupApplicationList"] = getSendGroupApplicationList
|
||||
self["getGroupApplicationListAsRecipient"] = getGroupApplicationListAsRecipient
|
||||
self["getGroupApplicationListAsApplicant"] = getGroupApplicationListAsApplicant
|
||||
self["acceptGroupApplication"] = acceptGroupApplication
|
||||
self["refuseGroupApplication"] = refuseGroupApplication
|
||||
self["dismissGroup"] = dismissGroup
|
||||
@@ -34,6 +34,7 @@ public class GroupManager: BaseServiceManager {
|
||||
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
|
||||
self["searchGroupMembers"] = searchGroupMembers
|
||||
self["setGroupMemberInfo"] = setGroupMemberInfo
|
||||
self["isJoinGroup"] = isJoinGroup
|
||||
}
|
||||
|
||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -42,21 +43,21 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||
methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetSpecifiedGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"],
|
||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "filter"],
|
||||
methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||
}
|
||||
|
||||
@@ -65,59 +66,59 @@ public class GroupManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"])
|
||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"])
|
||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupInfo"])
|
||||
}
|
||||
|
||||
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"])
|
||||
Open_im_sdkGetSpecifiedGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupIDList"])
|
||||
}
|
||||
|
||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
|
||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"], methodCall[int32: "joinSource"])
|
||||
}
|
||||
|
||||
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"])
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"])
|
||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
||||
}
|
||||
|
||||
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"])
|
||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[bool: "mute"])
|
||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[bool: "mute"])
|
||||
}
|
||||
|
||||
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[int:"seconds"])
|
||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"seconds"])
|
||||
}
|
||||
|
||||
func setGroupMemberNickname(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string:"uid"],methodCall[string:"groupNickname"])
|
||||
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[string:"groupNickname"])
|
||||
}
|
||||
|
||||
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -155,16 +156,20 @@ public class GroupManager: BaseServiceManager {
|
||||
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetGroupMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
||||
}
|
||||
|
||||
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
|
||||
public func onGroupApplicationAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
@@ -181,6 +186,10 @@ public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtoco
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupDismissed(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupDismissed", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onGroupInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
@@ -3,24 +3,73 @@ import OpenIMCore
|
||||
|
||||
public class IMMananger: BaseServiceManager {
|
||||
|
||||
let reachability = try? Reachability()
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["initSDK"] = initSDK
|
||||
self["unInitSDK"] = unInitSDK
|
||||
self["login"] = login
|
||||
self["logout"] = logout
|
||||
self["getLoginStatus"] = getLoginStatus
|
||||
self["wakeUp"] = wakeUp
|
||||
self["uploadImage"] = uploadImage
|
||||
self["uploadFile"] = uploadFile
|
||||
self["updateFcmToken"] = updateFcmToken
|
||||
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
||||
self["networkStatusChanged"] = networkStatusChanged
|
||||
}
|
||||
|
||||
fileprivate func addObservers() {
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(applicationWillEnterForeground),
|
||||
name: UIApplication.willEnterForegroundNotification,
|
||||
object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(applicationDidEnterBackground),
|
||||
name: UIApplication.didEnterBackgroundNotification,
|
||||
object: nil)
|
||||
|
||||
if let reachability {
|
||||
do {
|
||||
try reachability.startNotifier()
|
||||
} catch (let e) {
|
||||
print("reachability: \(e)")
|
||||
}
|
||||
|
||||
reachability.whenReachable = { _ in
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString)
|
||||
}
|
||||
reachability.whenUnreachable = { _ in
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc
|
||||
fileprivate func applicationDidEnterBackground() {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString, true)
|
||||
}
|
||||
|
||||
@objc
|
||||
fileprivate func applicationWillEnterForeground() {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||
}), UUID().uuidString, false)
|
||||
}
|
||||
|
||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||
callBack(result, Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||
addObservers()
|
||||
}
|
||||
|
||||
func unInitSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkUnInitSDK(methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"])
|
||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "token"])
|
||||
}
|
||||
|
||||
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -28,15 +77,11 @@ public class IMMananger: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
callBack(result, Open_im_sdkGetLoginStatus())
|
||||
callBack(result, Open_im_sdkGetLoginStatus(methodCall[string: "operationID"]))
|
||||
}
|
||||
|
||||
func wakeUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkWakeUp(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func uploadImage(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUploadImage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "path"], methodCall[string: "token"], methodCall[string: "obj"])
|
||||
func uploadFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUploadFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(), UploadFileListener(channel: self.channel,id: methodCall[string: "id"]))
|
||||
}
|
||||
|
||||
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -47,6 +92,9 @@ public class IMMananger: BaseServiceManager {
|
||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "isBackground"])
|
||||
}
|
||||
|
||||
func networkStatusChanged(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkNetworkStatusChanged(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
@@ -59,7 +107,7 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
||||
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||
}
|
||||
|
||||
|
||||
public func onConnectSuccess() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
@@ -76,3 +124,79 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
}
|
||||
|
||||
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
private let id: String
|
||||
|
||||
init(channel:FlutterMethodChannel, id: String) {
|
||||
self.channel = channel
|
||||
self.id = id
|
||||
}
|
||||
public func complete(_ size: Int64, url: String?, typ: Int) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["size"] = size
|
||||
values["url"] = url
|
||||
values["type"] = typ
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "complete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func hashPartComplete(_ partsHash: String?, fileHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["partHash"] = partsHash
|
||||
values["fileHash"] = fileHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func hashPartProgress(_ index: Int, size: Int64, partHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["index"] = index
|
||||
values["size"] = size
|
||||
values["partHash"] = partHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func open(_ size: Int64) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["size"] = size
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func partSize(_ partSize: Int64, num: Int) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["partSize"] = partSize
|
||||
values["num"] = num
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "partSize", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadComplete(_ fileSize: Int64, streamSize: Int64, storageSize: Int64) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["fileSize"] = fileSize
|
||||
values["streamSize"] = streamSize
|
||||
values["storageSize"] = storageSize
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadProgress", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadID(_ uploadID: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["uploadID"] = uploadID
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func uploadPartComplete(_ index: Int, partSize: Int64, partHash: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["index"] = index
|
||||
values["partSize"] = partSize
|
||||
values["partHash"] = partHash
|
||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@ public class MessageManager: BaseServiceManager {
|
||||
super.registerHandlers()
|
||||
self["setAdvancedMsgListener"] = setAdvancedMsgListener
|
||||
self["sendMessage"] = sendMessage
|
||||
self["getHistoryMessageList"] = getHistoryMessageList
|
||||
self["revokeMessage"] = revokeMessage
|
||||
self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage
|
||||
self["deleteMessageFromLocalAndSvr"] = deleteMessageFromLocalAndSvr
|
||||
self["deleteAllMsgFromLocal"] = deleteAllMsgFromLocal
|
||||
self["deleteAllMsgFromLocalAndSvr"] = deleteAllMsgFromLocalAndSvr
|
||||
self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage
|
||||
self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage
|
||||
self["markC2CMessageAsRead"] = markC2CMessageAsRead
|
||||
self["markGroupMessageAsRead"] = markGroupMessageAsRead
|
||||
self["markMessagesAsReadByMsgID"] = markMessagesAsReadByMsgID
|
||||
self["typingStatusUpdate"] = typingStatusUpdate
|
||||
self["createTextMessage"] = createTextMessage
|
||||
self["createTextAtMessage"] = createTextAtMessage
|
||||
@@ -34,21 +35,18 @@ public class MessageManager: BaseServiceManager {
|
||||
self["createQuoteMessage"] = createQuoteMessage
|
||||
self["createCardMessage"] = createCardMessage
|
||||
self["createFaceMessage"] = createFaceMessage
|
||||
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||
self["searchLocalMessages"] = searchLocalMessages
|
||||
self["deleteMessageFromLocalAndSvr"] = deleteMessageFromLocalAndSvr
|
||||
self["deleteAllMsgFromLocal"] = deleteAllMsgFromLocal
|
||||
self["deleteAllMsgFromLocalAndSvr"] = deleteAllMsgFromLocalAndSvr
|
||||
self["markMessageAsReadByConID"] = markMessageAsReadByConID
|
||||
self["clearC2CHistoryMessageFromLocalAndSvr"] = clearC2CHistoryMessageFromLocalAndSvr
|
||||
self["clearGroupHistoryMessageFromLocalAndSvr"] = clearGroupHistoryMessageFromLocalAndSvr
|
||||
self["getHistoryMessageListReverse"] = getHistoryMessageListReverse
|
||||
self["newRevokeMessage"] = newRevokeMessage
|
||||
self["getAdvancedHistoryMessageList"] = getAdvancedHistoryMessageList
|
||||
self["findMessageList"] = findMessageList
|
||||
self["createAdvancedTextMessage"] = createAdvancedTextMessage
|
||||
self["createAdvancedQuoteMessage"] = createAdvancedQuoteMessage
|
||||
|
||||
self["searchLocalMessages"] = searchLocalMessages
|
||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||
|
||||
self["getAdvancedHistoryMessageList"] = getAdvancedHistoryMessageList
|
||||
self["getAdvancedHistoryMessageListReverse"] = getAdvancedHistoryMessageListReverse
|
||||
|
||||
self["findMessageList"] = findMessageList
|
||||
self["setMessageLocalEx"] = setMessageLocalEx
|
||||
|
||||
self["sendMessageNotOss"] = sendMessageNotOss
|
||||
self["createImageMessageByURL"] = createImageMessageByURL
|
||||
self["createSoundMessageByURL"] = createSoundMessageByURL
|
||||
@@ -56,11 +54,7 @@ public class MessageManager: BaseServiceManager {
|
||||
self["createFileMessageByURL"] = createFileMessageByURL
|
||||
self["setCustomBusinessListener"] = setCustomBusinessListener
|
||||
self["setMessageKvInfoListener"] = setMessageKvInfoListener
|
||||
self["setMessageReactionExtensions"] = setMessageReactionExtensions
|
||||
self["deleteMessageReactionExtensions"] = deleteMessageReactionExtensions
|
||||
self["getMessageListReactionExtensions"] = getMessageListReactionExtensions
|
||||
self["addMessageReactionExtensions"] = addMessageReactionExtensions
|
||||
self["getMessageListSomeReactionExtensions"] = getMessageListSomeReactionExtensions
|
||||
|
||||
}
|
||||
|
||||
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -76,18 +70,25 @@ public class MessageManager: BaseServiceManager {
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
}
|
||||
|
||||
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[string: "clientMsgID"])
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"],
|
||||
@@ -99,12 +100,8 @@ public class MessageManager: BaseServiceManager {
|
||||
methodCall[string: "groupID"], methodCall[string: "senderID"])
|
||||
}
|
||||
|
||||
func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func markGroupMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkGroupMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "messageIDList"])
|
||||
func markMessagesAsReadByMsgID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkMarkMessagesAsReadByMsgID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -201,57 +198,30 @@ public class MessageManager: BaseServiceManager {
|
||||
callBack(result, prama)
|
||||
}
|
||||
|
||||
func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func searchLocalMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSearchLocalMessages(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "filter"])
|
||||
}
|
||||
|
||||
func deleteMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocal(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func deleteAllMsgFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkDeleteAllMsgFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func markMessageAsReadByConID(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkMarkMessageAsReadByConID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "messageIDList"])
|
||||
}
|
||||
|
||||
func clearC2CHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearC2CHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func clearGroupHistoryMessageFromLocalAndSvr(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearGroupHistoryMessageFromLocalAndSvr(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func getHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func newRevokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkNewRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||
}
|
||||
|
||||
func getAdvancedHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAdvancedHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func getAdvancedHistoryMessageListReverse(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetAdvancedHistoryMessageListReverse(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
|
||||
func findMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkFindMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"])
|
||||
}
|
||||
|
||||
func setMessageLocalEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetMessageLocalEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "clientMsgID"], methodCall[string: "localEx"])
|
||||
}
|
||||
|
||||
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||
@@ -284,26 +254,6 @@ public class MessageManager: BaseServiceManager {
|
||||
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func setMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
|
||||
}
|
||||
|
||||
func deleteMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkDeleteMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
|
||||
}
|
||||
|
||||
func getMessageListReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMessageListReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"])
|
||||
}
|
||||
|
||||
func addMessageReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddMessageReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[jsonString: "list"])
|
||||
}
|
||||
|
||||
func getMessageListSomeReactionExtensions(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetMessageListSomeReactionExtensions(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[jsonString: "list"])
|
||||
}
|
||||
}
|
||||
|
||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||
@@ -336,7 +286,6 @@ public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallB
|
||||
}
|
||||
|
||||
public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol {
|
||||
|
||||
private let channel: FlutterMethodChannel
|
||||
private let id: String
|
||||
|
||||
@@ -345,46 +294,47 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
|
||||
self.id = id
|
||||
}
|
||||
|
||||
public func onMsgDeleted(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onMsgDeleted", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
|
||||
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["messageRevoked"] = messageRevoked
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["c2cMessageReadReceipt"] = msgReceiptList
|
||||
values["msgReceiptList"] = msgReceiptList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["groupMessageReadReceipt"] = groupMsgReceiptList
|
||||
values["groupMsgReceiptList"] = groupMsgReceiptList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageRevoked(_ msgId: String?) {
|
||||
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["revokedMessage"] = msgId
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["newMessage"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onNewRecvMessageRevoked(_ messageRevoked: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["revokedMessageV2"] = messageRevoked
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onNewRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
|
||||
values["msgID"] = msgID
|
||||
values["reactionExtensionList"] = reactionExtensionList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageExtensionsChanged(_ msgID: String?, reactionExtensionList: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgID"] = msgID
|
||||
values["list"] = reactionExtensionList
|
||||
values["reactionExtensionList"] = reactionExtensionList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsChanged", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
@@ -392,18 +342,25 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgID"] = msgID
|
||||
values["list"] = reactionExtensionKeyList
|
||||
values["reactionExtensionKeyList"] = reactionExtensionKeyList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsDeleted", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
|
||||
public func onRecvNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["msgID"] = msgID
|
||||
values["list"] = reactionExtensionList
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||
}
|
||||
|
||||
|
||||
public func onRecvOfflineNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class OrganizationManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setOrganizationListener"] = setOrganizationListener
|
||||
self["getSubDepartment"] = getSubDepartment
|
||||
self["getDepartmentMember"] = getDepartmentMember
|
||||
self["getUserInDepartment"] = getUserInDepartment
|
||||
self["getDepartmentMemberAndSubDepartment"] = getDepartmentMemberAndSubDepartment
|
||||
self["getDepartmentInfo"] = getDepartmentInfo
|
||||
self["searchOrganization"] = searchOrganization
|
||||
}
|
||||
|
||||
func setOrganizationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetOrganizationListener(OrganizationListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func getDepartmentMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetDepartmentMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func getUserInDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUserInDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func getDepartmentMemberAndSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetDepartmentMemberAndSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
|
||||
}
|
||||
|
||||
func getDepartmentInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetDepartmentInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
|
||||
}
|
||||
|
||||
func searchOrganization(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkSearchOrganization(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
}
|
||||
|
||||
public class OrganizationListener: NSObject, Open_im_sdk_callbackOnOrganizationListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onOrganizationUpdated() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "organizationListener", type: "onOrganizationUpdated", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class SignalingManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setSignalingListener"] = setSignalingListener
|
||||
self["signalingInvite"] = signalingInvite
|
||||
self["signalingInviteInGroup"] = signalingInviteInGroup
|
||||
self["signalingAccept"] = signalingAccept
|
||||
self["signalingReject"] = signalingReject
|
||||
self["signalingCancel"] = signalingCancel
|
||||
self["signalingHungUp"] = signalingHungUp
|
||||
self["signalingGetRoomByGroupID"] = signalingGetRoomByGroupID
|
||||
self["signalingGetTokenByRoomID"] = signalingGetTokenByRoomID
|
||||
self["signalingUpdateMeetingInfo"] = signalingUpdateMeetingInfo
|
||||
self["signalingCreateMeeting"] = signalingCreateMeeting
|
||||
self["signalingJoinMeeting"] = signalingJoinMeeting
|
||||
self["signalingOperateStream"] = signalingOperateStream
|
||||
self["signalingGetMeetings"] = signalingGetMeetings
|
||||
self["signalingCloseRoom"] = signalingCloseRoom
|
||||
self["signalingSendCustomSignal"] = signalingSendCustomSignal
|
||||
}
|
||||
|
||||
func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetSignalingListener(SignalingListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func signalingInvite(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingInvite(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingInviteInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingInviteInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingAccept(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingAccept(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingReject(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingReject(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingCancel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingCancel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingHungUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingHungUp(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"])
|
||||
}
|
||||
|
||||
func signalingGetRoomByGroupID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingGetRoomByGroupID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||
}
|
||||
|
||||
func signalingGetTokenByRoomID(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingGetTokenByRoomID(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
|
||||
}
|
||||
|
||||
func signalingUpdateMeetingInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingUpdateMeetingInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
||||
}
|
||||
|
||||
func signalingCreateMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingCreateMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
||||
}
|
||||
|
||||
func signalingJoinMeeting(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingJoinMeeting(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
||||
}
|
||||
|
||||
func signalingOperateStream(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingOperateStream(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "streamType"], methodCall[string: "roomID"], methodCall[string: "userID"], methodCall[bool: "mute"], methodCall[bool: "muteAll"])
|
||||
}
|
||||
|
||||
func signalingGetMeetings(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingGetMeetings(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func signalingCloseRoom(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingCloseRoom(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "roomID"])
|
||||
}
|
||||
|
||||
func signalingSendCustomSignal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSignalingSendCustomSignal(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "customInfo"], methodCall[string: "roomID"])
|
||||
}
|
||||
}
|
||||
public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol {
|
||||
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onInvitationCancelled(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationCancelled", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInvitationTimeout(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInvitationTimeout", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeAccepted(byOtherDevice s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeAcceptedByOtherDevice", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeRejected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onInviteeRejected(byOtherDevice s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onInviteeRejectedByOtherDevice", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onReceiveNewInvitation(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveNewInvitation", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onHangUp(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onHangUp", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onRoomParticipantConnected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantConnected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onRoomParticipantDisconnected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onRoomParticipantDisconnected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onStreamChange(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onStreamChange", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
public func onReceiveCustomSignal(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "signalingListener", type: "onReceiveCustomSignal", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,11 @@ public class UserManager: BaseServiceManager {
|
||||
self["getUsersInfo"] = getUsersInfo
|
||||
self["setSelfInfo"] = setSelfInfo
|
||||
self["getSelfUserInfo"] = getSelfUserInfo
|
||||
self["subscribeUsersStatus"] = subscribeUsersStatus
|
||||
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
|
||||
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
|
||||
self["getUserStatus"] = getUserStatus
|
||||
self["getUsersInfoStranger"] = getUsersInfoStranger
|
||||
}
|
||||
|
||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -17,7 +22,7 @@ public class UserManager: BaseServiceManager {
|
||||
}
|
||||
|
||||
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"])
|
||||
Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
||||
}
|
||||
|
||||
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
@@ -27,6 +32,26 @@ public class UserManager: BaseServiceManager {
|
||||
func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func subscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func unsubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkUnsubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func getSubscribeUsersStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetSubscribeUsersStatus(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetUserStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||
}
|
||||
|
||||
func getUsersInfoStranger(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetUsersInfoStranger(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"], methodCall[string: "groupID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
||||
@@ -40,4 +65,9 @@ public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol
|
||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||
}
|
||||
|
||||
public func onUserStatusChanged(_ statusInfo: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class WorkMomentsManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setWorkMomentsListener"] = setWorkMomentsListener
|
||||
self["getWorkMomentsUnReadCount"] = getWorkMomentsUnReadCount
|
||||
self["getWorkMomentsNotification"] = getWorkMomentsNotification
|
||||
self["clearWorkMomentsNotification"] = clearWorkMomentsNotification
|
||||
}
|
||||
|
||||
func setWorkMomentsListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetWorkMomentsListener(WorkMomentsListener(channel: channel))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
func getWorkMomentsUnReadCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsUnReadCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func getWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
func clearWorkMomentsNotification(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkClearWorkMomentsNotification(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
}
|
||||
|
||||
public class WorkMomentsListener: NSObject, Open_im_sdk_callbackOnWorkMomentsListenerProtocol {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
public func onRecvNewNotification() {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "workMomentsListener", type: "OnRecvNewNotification", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
}
|
||||
405
ios/Classes/Reachability.swift
Normal file
405
ios/Classes/Reachability.swift
Normal file
@@ -0,0 +1,405 @@
|
||||
/*
|
||||
Copyright (c) 2014, Ashley Mills
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import SystemConfiguration
|
||||
import Foundation
|
||||
|
||||
public enum ReachabilityError: Error {
|
||||
case failedToCreateWithAddress(sockaddr, Int32)
|
||||
case failedToCreateWithHostname(String, Int32)
|
||||
case unableToSetCallback(Int32)
|
||||
case unableToSetDispatchQueue(Int32)
|
||||
case unableToGetFlags(Int32)
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "Notification.Name.reachabilityChanged")
|
||||
public let ReachabilityChangedNotification = NSNotification.Name("ReachabilityChangedNotification")
|
||||
|
||||
public extension Notification.Name {
|
||||
static let reachabilityChanged = Notification.Name("reachabilityChanged")
|
||||
}
|
||||
|
||||
public class Reachability {
|
||||
|
||||
public typealias NetworkReachable = (Reachability) -> ()
|
||||
public typealias NetworkUnreachable = (Reachability) -> ()
|
||||
|
||||
@available(*, unavailable, renamed: "Connection")
|
||||
public enum NetworkStatus: CustomStringConvertible {
|
||||
case notReachable, reachableViaWiFi, reachableViaWWAN
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .reachableViaWWAN: return "Cellular"
|
||||
case .reachableViaWiFi: return "WiFi"
|
||||
case .notReachable: return "No Connection"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum Connection: CustomStringConvertible {
|
||||
case unavailable, wifi, cellular
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .cellular: return "Cellular"
|
||||
case .wifi: return "WiFi"
|
||||
case .unavailable: return "No Connection"
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "unavailable")
|
||||
public static let none: Connection = .unavailable
|
||||
}
|
||||
|
||||
public var whenReachable: NetworkReachable?
|
||||
public var whenUnreachable: NetworkUnreachable?
|
||||
|
||||
@available(*, deprecated, renamed: "allowsCellularConnection")
|
||||
public let reachableOnWWAN: Bool = true
|
||||
|
||||
/// Set to `false` to force Reachability.connection to .none when on cellular connection (default value `true`)
|
||||
public var allowsCellularConnection: Bool
|
||||
|
||||
// The notification center on which "reachability changed" events are being posted
|
||||
public var notificationCenter: NotificationCenter = NotificationCenter.default
|
||||
|
||||
@available(*, deprecated, renamed: "connection.description")
|
||||
public var currentReachabilityString: String {
|
||||
return "\(connection)"
|
||||
}
|
||||
|
||||
@available(*, unavailable, renamed: "connection")
|
||||
public var currentReachabilityStatus: Connection {
|
||||
return connection
|
||||
}
|
||||
|
||||
public var connection: Connection {
|
||||
if flags == nil {
|
||||
try? setReachabilityFlags()
|
||||
}
|
||||
|
||||
switch flags?.connection {
|
||||
case .unavailable?, nil: return .unavailable
|
||||
case .cellular?: return allowsCellularConnection ? .cellular : .unavailable
|
||||
case .wifi?: return .wifi
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate var isRunningOnDevice: Bool = {
|
||||
#if targetEnvironment(simulator)
|
||||
return false
|
||||
#else
|
||||
return true
|
||||
#endif
|
||||
}()
|
||||
|
||||
fileprivate(set) var notifierRunning = false
|
||||
fileprivate let reachabilityRef: SCNetworkReachability
|
||||
fileprivate let reachabilitySerialQueue: DispatchQueue
|
||||
fileprivate let notificationQueue: DispatchQueue?
|
||||
fileprivate(set) var flags: SCNetworkReachabilityFlags? {
|
||||
didSet {
|
||||
guard flags != oldValue else { return }
|
||||
notifyReachabilityChanged()
|
||||
}
|
||||
}
|
||||
|
||||
required public init(reachabilityRef: SCNetworkReachability,
|
||||
queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) {
|
||||
self.allowsCellularConnection = true
|
||||
self.reachabilityRef = reachabilityRef
|
||||
self.reachabilitySerialQueue = DispatchQueue(label: "uk.co.ashleymills.reachability", qos: queueQoS, target: targetQueue)
|
||||
self.notificationQueue = notificationQueue
|
||||
}
|
||||
|
||||
public convenience init(hostname: String,
|
||||
queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) throws {
|
||||
guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else {
|
||||
throw ReachabilityError.failedToCreateWithHostname(hostname, SCError())
|
||||
}
|
||||
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
|
||||
}
|
||||
|
||||
public convenience init(queueQoS: DispatchQoS = .default,
|
||||
targetQueue: DispatchQueue? = nil,
|
||||
notificationQueue: DispatchQueue? = .main) throws {
|
||||
var zeroAddress = sockaddr()
|
||||
zeroAddress.sa_len = UInt8(MemoryLayout<sockaddr>.size)
|
||||
zeroAddress.sa_family = sa_family_t(AF_INET)
|
||||
|
||||
guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else {
|
||||
throw ReachabilityError.failedToCreateWithAddress(zeroAddress, SCError())
|
||||
}
|
||||
|
||||
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
|
||||
}
|
||||
|
||||
deinit {
|
||||
stopNotifier()
|
||||
}
|
||||
}
|
||||
|
||||
public extension Reachability {
|
||||
|
||||
// MARK: - *** Notifier methods ***
|
||||
func startNotifier() throws {
|
||||
guard !notifierRunning else { return }
|
||||
|
||||
let callback: SCNetworkReachabilityCallBack = { (reachability, flags, info) in
|
||||
guard let info = info else { return }
|
||||
|
||||
// `weakifiedReachability` is guaranteed to exist by virtue of our
|
||||
// retain/release callbacks which we provided to the `SCNetworkReachabilityContext`.
|
||||
let weakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info).takeUnretainedValue()
|
||||
|
||||
// The weak `reachability` _may_ no longer exist if the `Reachability`
|
||||
// object has since been deallocated but a callback was already in flight.
|
||||
weakifiedReachability.reachability?.flags = flags
|
||||
}
|
||||
|
||||
let weakifiedReachability = ReachabilityWeakifier(reachability: self)
|
||||
let opaqueWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.passUnretained(weakifiedReachability).toOpaque()
|
||||
|
||||
var context = SCNetworkReachabilityContext(
|
||||
version: 0,
|
||||
info: UnsafeMutableRawPointer(opaqueWeakifiedReachability),
|
||||
retain: { (info: UnsafeRawPointer) -> UnsafeRawPointer in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
_ = unmanagedWeakifiedReachability.retain()
|
||||
return UnsafeRawPointer(unmanagedWeakifiedReachability.toOpaque())
|
||||
},
|
||||
release: { (info: UnsafeRawPointer) -> Void in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
unmanagedWeakifiedReachability.release()
|
||||
},
|
||||
copyDescription: { (info: UnsafeRawPointer) -> Unmanaged<CFString> in
|
||||
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
|
||||
let weakifiedReachability = unmanagedWeakifiedReachability.takeUnretainedValue()
|
||||
let description = weakifiedReachability.reachability?.description ?? "nil"
|
||||
return Unmanaged.passRetained(description as CFString)
|
||||
}
|
||||
)
|
||||
|
||||
if !SCNetworkReachabilitySetCallback(reachabilityRef, callback, &context) {
|
||||
stopNotifier()
|
||||
throw ReachabilityError.unableToSetCallback(SCError())
|
||||
}
|
||||
|
||||
if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) {
|
||||
stopNotifier()
|
||||
throw ReachabilityError.unableToSetDispatchQueue(SCError())
|
||||
}
|
||||
|
||||
// Perform an initial check
|
||||
try setReachabilityFlags()
|
||||
|
||||
notifierRunning = true
|
||||
}
|
||||
|
||||
func stopNotifier() {
|
||||
defer { notifierRunning = false }
|
||||
|
||||
SCNetworkReachabilitySetCallback(reachabilityRef, nil, nil)
|
||||
SCNetworkReachabilitySetDispatchQueue(reachabilityRef, nil)
|
||||
}
|
||||
|
||||
// MARK: - *** Connection test methods ***
|
||||
@available(*, deprecated, message: "Please use `connection != .none`")
|
||||
var isReachable: Bool {
|
||||
return connection != .unavailable
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Please use `connection == .cellular`")
|
||||
var isReachableViaWWAN: Bool {
|
||||
// Check we're not on the simulator, we're REACHABLE and check we're on WWAN
|
||||
return connection == .cellular
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Please use `connection == .wifi`")
|
||||
var isReachableViaWiFi: Bool {
|
||||
return connection == .wifi
|
||||
}
|
||||
|
||||
var description: String {
|
||||
return flags?.description ?? "unavailable flags"
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension Reachability {
|
||||
|
||||
func setReachabilityFlags() throws {
|
||||
try reachabilitySerialQueue.sync { [unowned self] in
|
||||
var flags = SCNetworkReachabilityFlags()
|
||||
if !SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags) {
|
||||
self.stopNotifier()
|
||||
throw ReachabilityError.unableToGetFlags(SCError())
|
||||
}
|
||||
|
||||
self.flags = flags
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func notifyReachabilityChanged() {
|
||||
let notify = { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.connection != .unavailable ? self.whenReachable?(self) : self.whenUnreachable?(self)
|
||||
self.notificationCenter.post(name: .reachabilityChanged, object: self)
|
||||
}
|
||||
|
||||
// notify on the configured `notificationQueue`, or the caller's (i.e. `reachabilitySerialQueue`)
|
||||
notificationQueue?.async(execute: notify) ?? notify()
|
||||
}
|
||||
}
|
||||
|
||||
extension SCNetworkReachabilityFlags {
|
||||
|
||||
typealias Connection = Reachability.Connection
|
||||
|
||||
var connection: Connection {
|
||||
guard isReachableFlagSet else { return .unavailable }
|
||||
|
||||
// If we're reachable, but not on an iOS device (i.e. simulator), we must be on WiFi
|
||||
#if targetEnvironment(simulator)
|
||||
return .wifi
|
||||
#else
|
||||
var connection = Connection.unavailable
|
||||
|
||||
if !isConnectionRequiredFlagSet {
|
||||
connection = .wifi
|
||||
}
|
||||
|
||||
if isConnectionOnTrafficOrDemandFlagSet {
|
||||
if !isInterventionRequiredFlagSet {
|
||||
connection = .wifi
|
||||
}
|
||||
}
|
||||
|
||||
if isOnWWANFlagSet {
|
||||
connection = .cellular
|
||||
}
|
||||
|
||||
return connection
|
||||
#endif
|
||||
}
|
||||
|
||||
var isOnWWANFlagSet: Bool {
|
||||
#if os(iOS)
|
||||
return contains(.isWWAN)
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
}
|
||||
var isReachableFlagSet: Bool {
|
||||
return contains(.reachable)
|
||||
}
|
||||
var isConnectionRequiredFlagSet: Bool {
|
||||
return contains(.connectionRequired)
|
||||
}
|
||||
var isInterventionRequiredFlagSet: Bool {
|
||||
return contains(.interventionRequired)
|
||||
}
|
||||
var isConnectionOnTrafficFlagSet: Bool {
|
||||
return contains(.connectionOnTraffic)
|
||||
}
|
||||
var isConnectionOnDemandFlagSet: Bool {
|
||||
return contains(.connectionOnDemand)
|
||||
}
|
||||
var isConnectionOnTrafficOrDemandFlagSet: Bool {
|
||||
return !intersection([.connectionOnTraffic, .connectionOnDemand]).isEmpty
|
||||
}
|
||||
var isTransientConnectionFlagSet: Bool {
|
||||
return contains(.transientConnection)
|
||||
}
|
||||
var isLocalAddressFlagSet: Bool {
|
||||
return contains(.isLocalAddress)
|
||||
}
|
||||
var isDirectFlagSet: Bool {
|
||||
return contains(.isDirect)
|
||||
}
|
||||
var isConnectionRequiredAndTransientFlagSet: Bool {
|
||||
return intersection([.connectionRequired, .transientConnection]) == [.connectionRequired, .transientConnection]
|
||||
}
|
||||
|
||||
var description: String {
|
||||
let W = isOnWWANFlagSet ? "W" : "-"
|
||||
let R = isReachableFlagSet ? "R" : "-"
|
||||
let c = isConnectionRequiredFlagSet ? "c" : "-"
|
||||
let t = isTransientConnectionFlagSet ? "t" : "-"
|
||||
let i = isInterventionRequiredFlagSet ? "i" : "-"
|
||||
let C = isConnectionOnTrafficFlagSet ? "C" : "-"
|
||||
let D = isConnectionOnDemandFlagSet ? "D" : "-"
|
||||
let l = isLocalAddressFlagSet ? "l" : "-"
|
||||
let d = isDirectFlagSet ? "d" : "-"
|
||||
|
||||
return "\(W)\(R) \(c)\(t)\(i)\(C)\(D)\(l)\(d)"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
`ReachabilityWeakifier` weakly wraps the `Reachability` class
|
||||
in order to break retain cycles when interacting with CoreFoundation.
|
||||
|
||||
CoreFoundation callbacks expect a pair of retain/release whenever an
|
||||
opaque `info` parameter is provided. These callbacks exist to guard
|
||||
against memory management race conditions when invoking the callbacks.
|
||||
|
||||
#### Race Condition
|
||||
|
||||
If we passed `SCNetworkReachabilitySetCallback` a direct reference to our
|
||||
`Reachability` class without also providing corresponding retain/release
|
||||
callbacks, then a race condition can lead to crashes when:
|
||||
- `Reachability` is deallocated on thread X
|
||||
- A `SCNetworkReachability` callback(s) is already in flight on thread Y
|
||||
|
||||
#### Retain Cycle
|
||||
|
||||
If we pass `Reachability` to CoreFoundtion while also providing retain/
|
||||
release callbacks, we would create a retain cycle once CoreFoundation
|
||||
retains our `Reachability` class. This fixes the crashes and his how
|
||||
CoreFoundation expects the API to be used, but doesn't play nicely with
|
||||
Swift/ARC. This cycle would only be broken after manually calling
|
||||
`stopNotifier()` — `deinit` would never be called.
|
||||
|
||||
#### ReachabilityWeakifier
|
||||
|
||||
By providing both retain/release callbacks and wrapping `Reachability` in
|
||||
a weak wrapper, we:
|
||||
- interact correctly with CoreFoundation, thereby avoiding a crash.
|
||||
See "Memory Management Programming Guide for Core Foundation".
|
||||
- don't alter the public API of `Reachability.swift` in any way
|
||||
- still allow for automatic stopping of the notifier on `deinit`.
|
||||
*/
|
||||
private class ReachabilityWeakifier {
|
||||
weak var reachability: Reachability?
|
||||
init(reachability: Reachability) {
|
||||
self.reachability = reachability
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
let messageManager: MessageManager
|
||||
let groupManager: GroupManager
|
||||
let userManger: UserManager
|
||||
let signalingManager: SignalingManager
|
||||
let workMomentsManager: WorkMomentsManager
|
||||
let organizationManager: OrganizationManager
|
||||
// let signalingManager: SignalingManager
|
||||
// let workMomentsManager: WorkMomentsManager
|
||||
// let organizationManager: OrganizationManager
|
||||
|
||||
init(channel: FlutterMethodChannel) {
|
||||
self.imManager = IMMananger(channel: channel)
|
||||
@@ -19,9 +19,9 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
self.messageManager = MessageManager(channel: channel)
|
||||
self.groupManager = GroupManager(channel: channel)
|
||||
self.userManger = UserManager(channel: channel)
|
||||
self.signalingManager = SignalingManager(channel: channel)
|
||||
self.workMomentsManager = WorkMomentsManager(channel: channel)
|
||||
self.organizationManager = OrganizationManager(channel: channel)
|
||||
// self.signalingManager = SignalingManager(channel: channel)
|
||||
// self.workMomentsManager = WorkMomentsManager(channel: channel)
|
||||
// self.organizationManager = OrganizationManager(channel: channel)
|
||||
}
|
||||
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
@@ -45,12 +45,12 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
|
||||
groupManager.handleMethod(call: call, result: result)
|
||||
case "userManager":
|
||||
userManger.handleMethod(call: call, result: result)
|
||||
case "signalingManager":
|
||||
signalingManager.handleMethod(call: call, result: result)
|
||||
case "workMomentsManager":
|
||||
workMomentsManager.handleMethod(call: call, result: result)
|
||||
case "organizationManager":
|
||||
organizationManager.handleMethod(call: call, result: result)
|
||||
// case "signalingManager":
|
||||
// signalingManager.handleMethod(call: call, result: result)
|
||||
// case "workMomentsManager":
|
||||
// workMomentsManager.handleMethod(call: call, result: result)
|
||||
// case "organizationManager":
|
||||
// organizationManager.handleMethod(call: call, result: result)
|
||||
default:
|
||||
print("Handle ManagerName Error: \(managerName) not found")
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ A new Flutter project.
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '9.0'
|
||||
s.platform = :ios, '11.0'
|
||||
|
||||
s.dependency 'OpenIMSDKCore','2.3.5-b3'
|
||||
s.dependency 'OpenIMSDKCore','3.3.0'
|
||||
s.static_framework = true
|
||||
# s.vendored_frameworks = 'Framework/*.framework'
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
|
||||
@@ -7,6 +7,7 @@ export 'src/enum/group_type.dart';
|
||||
export 'src/enum/group_verification.dart';
|
||||
export 'src/enum/im_platform.dart';
|
||||
export 'src/enum/listener_type.dart';
|
||||
export 'src/enum/login_status.dart';
|
||||
export 'src/enum/message_status.dart';
|
||||
export 'src/enum/message_type.dart';
|
||||
export 'src/enum/sdk_error_code.dart';
|
||||
@@ -19,29 +20,20 @@ export 'src/listener/group_listener.dart';
|
||||
export 'src/listener/listener_for_service.dart';
|
||||
export 'src/listener/message_kv_info_listener.dart';
|
||||
export 'src/listener/msg_send_progress_listener.dart';
|
||||
export 'src/listener/organization_listener.dart';
|
||||
export 'src/listener/signaling_listener.dart';
|
||||
export 'src/listener/upload_file_listener.dart';
|
||||
export 'src/listener/user_listener.dart';
|
||||
export 'src/listener/workmoments_listener.dart';
|
||||
export 'src/manager/im_conversation_manager.dart';
|
||||
export 'src/manager/im_friendship_manager.dart';
|
||||
export 'src/manager/im_group_manager.dart';
|
||||
export 'src/manager/im_manager.dart';
|
||||
export 'src/manager/im_message_manager.dart';
|
||||
export 'src/manager/im_offline_push_manager.dart';
|
||||
export 'src/manager/im_organization_manager.dart';
|
||||
export 'src/manager/im_signaling_manager.dart';
|
||||
export 'src/manager/im_user_manager.dart';
|
||||
export 'src/manager/im_workmoments_manager.dart';
|
||||
export 'src/models/conversation_info.dart';
|
||||
export 'src/models/group_info.dart';
|
||||
export 'src/models/meeting_info.dart';
|
||||
export 'src/models/message.dart';
|
||||
export 'src/models/notification_info.dart';
|
||||
export 'src/models/organization_info.dart';
|
||||
export 'src/models/search_info.dart';
|
||||
export 'src/models/signaling_info.dart';
|
||||
export 'src/models/user_info.dart';
|
||||
export 'src/models/workmoments_info.dart';
|
||||
export 'src/openim.dart';
|
||||
export 'src/utils.dart';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/// 群成员角色
|
||||
class GroupRoleLevel {
|
||||
/// 普通成员
|
||||
static const member = 1;
|
||||
|
||||
/// 群主
|
||||
static const owner = 2;
|
||||
static const owner = 100;
|
||||
|
||||
/// 管理员
|
||||
static const admin = 3;
|
||||
static const admin = 60;
|
||||
|
||||
/// 普通成员
|
||||
static const member = 20;
|
||||
}
|
||||
|
||||
@@ -14,4 +14,5 @@ class ListenerType {
|
||||
static const customBusinessListener = "customBusinessListener";
|
||||
static const messageKvInfoListener = "messageKvInfoListener";
|
||||
static const listenerForService = "listenerForService";
|
||||
static const uploadFileListener = "uploadFileListener";
|
||||
}
|
||||
|
||||
5
lib/src/enum/login_status.dart
Normal file
5
lib/src/enum/login_status.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
class LoginStatus {
|
||||
static const logout = 1;
|
||||
static const logging = 2;
|
||||
static const logged = 3;
|
||||
}
|
||||
@@ -30,9 +30,6 @@ class MessageType {
|
||||
/// 自定义
|
||||
static const custom = 110;
|
||||
|
||||
/// 撤回
|
||||
static const revoke = 111;
|
||||
|
||||
/// 已读回执
|
||||
static const has_read_receipt = 112;
|
||||
|
||||
@@ -51,9 +48,6 @@ class MessageType {
|
||||
/// 富文本消息
|
||||
static const advancedText = 117;
|
||||
|
||||
/// 高级撤回
|
||||
static const advancedRevoke = 118;
|
||||
|
||||
static const customMsgNotTriggerConversation = 119;
|
||||
|
||||
static const customMsgOnlineOnly = 120;
|
||||
@@ -154,6 +148,12 @@ class MessageType {
|
||||
/// 群成员信息改变
|
||||
static const groupMemberInfoChangedNotification = 1516;
|
||||
|
||||
/// 群公告修改
|
||||
static const groupNoticeChangedNotification = 1519;
|
||||
|
||||
/// 群名字修改
|
||||
static const groupNameChangedNotification = 1520;
|
||||
|
||||
static const signalingNotificationBegin = 1600;
|
||||
|
||||
/// 信令
|
||||
@@ -165,4 +165,7 @@ class MessageType {
|
||||
static const burnAfterReadingNotification = 1701;
|
||||
|
||||
static const notificationEnd = 2000;
|
||||
|
||||
/// 撤回消息
|
||||
static const revokeMessageNotification = 2101;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,172 @@
|
||||
/// 消息发送失败
|
||||
class MessageFailedCode {
|
||||
/// 被对方拉黑
|
||||
static const int blockedByFriend = 600;
|
||||
// /// 消息发送失败
|
||||
// class MessageFailedCode {
|
||||
// /// 被对方拉黑
|
||||
// static const int blockedByFriend = 1302;
|
||||
//
|
||||
// /// 被对方删除
|
||||
// static const int deletedByFriend = 1303;
|
||||
//
|
||||
// /// 已被移除群聊/群已解散
|
||||
// static const int notInGroup = 1204;
|
||||
// }
|
||||
//
|
||||
// /// 添加好友失败
|
||||
// class AddFriendFailedCode {
|
||||
// /// 该用户已设置不可添加
|
||||
// static const int refuseToAddFriends = 10013;
|
||||
// }
|
||||
|
||||
/// 被对方删除
|
||||
static const int deletedByFriend = 601;
|
||||
}
|
||||
class SDKErrorCode {
|
||||
/// 网络请求错误
|
||||
static const int networkRequestError = 10000;
|
||||
|
||||
/// 网络等待超时错误
|
||||
static const int networkWaitTimeoutError = 10001;
|
||||
|
||||
/// 参数错误
|
||||
static const int parameterError = 10002;
|
||||
|
||||
/// 上下文超时错误,通常为用户已经退出
|
||||
static const int contextTimeoutError = 10003;
|
||||
|
||||
/// 资源未加载完毕,通常为未初始化,或者登录接口还未成功返回
|
||||
static const int resourceNotLoaded = 10004;
|
||||
|
||||
/// 未知错误,需要根据 errmsg 确认原因
|
||||
static const int unknownError = 10005;
|
||||
|
||||
/// sdk 内部错误,需要根据 errmsg 确认原因
|
||||
static const int sdkInternalError = 10006;
|
||||
|
||||
/// 添加好友失败
|
||||
class AddFriendFailedCode {
|
||||
/// 该用户已设置不可添加
|
||||
static const int refuseToAddFriends = 10007;
|
||||
static const int refuseToAddFriends = 10013;
|
||||
|
||||
/// 用户不存在或未注册
|
||||
static const int userNotExistOrNotRegistered = 10100;
|
||||
|
||||
/// 用户已经退出登录
|
||||
static const int userHasLoggedOut = 10101;
|
||||
|
||||
/// 用户重复登录,可以通过 getloginstatus 确认登录状态,避免重复登录
|
||||
static const int repeatLogin = 10102;
|
||||
|
||||
/// 需要上传的文件不存在
|
||||
static const int uploadFileNotExist = 10200;
|
||||
|
||||
/// 消息解压失败
|
||||
static const int messageDecompressionFailed = 10201;
|
||||
|
||||
/// 消息解码失败
|
||||
static const int messageDecodingFailed = 10202;
|
||||
|
||||
/// 不支持的长连接二进制协议
|
||||
static const int unsupportedLongConnection = 10203;
|
||||
|
||||
/// 消息重复发送
|
||||
static const int messageRepeated = 10204;
|
||||
|
||||
/// 消息内容类型不支持
|
||||
static const int messageContentTypeNotSupported = 10205;
|
||||
|
||||
/// 不支持的会话操作
|
||||
static const int unsupportedSessionOperation = 10301;
|
||||
|
||||
/// 群 ID 不存在
|
||||
static const int groupIDNotExist = 10400;
|
||||
|
||||
/// 群组类型错误
|
||||
static const int wrongGroupType = 10401;
|
||||
|
||||
/// 服务器内部错误,通常为内部网络错误,需要检查服务器各节点运行是否正常
|
||||
static const int serverInternalError = 500;
|
||||
|
||||
/// 参数错误,需要检查 body 参数以及 header 参数是否正确
|
||||
static const int serverParameterError = 1001;
|
||||
|
||||
/// 权限不足,一般为 header 参数中携带 token 不正确,或者权限越级操作
|
||||
static const int insufficientPermissions = 1002;
|
||||
|
||||
/// 数据库主键重复
|
||||
static const int duplicateDatabasePrimaryKey = 1003;
|
||||
|
||||
/// 数据库记录未找到
|
||||
static const int databaseRecordNotFound = 1004;
|
||||
|
||||
/// 用户 ID 不存在
|
||||
static const int userIDNotExist = 1101;
|
||||
|
||||
/// 用户已经注册
|
||||
static const int userAlreadyRegistered = 1102;
|
||||
|
||||
/// 群不存在
|
||||
static const int groupNotExis = 1201;
|
||||
|
||||
/// 群已存在
|
||||
static const int groupAlreadyExists = 1202;
|
||||
|
||||
/// 用户不在群组中
|
||||
static const int userIsNotInGroup = 1203;
|
||||
|
||||
/// 群组已解散
|
||||
static const int groupDisbanded = 1204;
|
||||
|
||||
/// 群申请已经被处理,不需要重复处理
|
||||
static const int groupApplicationHasBeenProcessed = 1206;
|
||||
|
||||
/// 不能添加自己为好友
|
||||
static const int notAddMyselfAsAFriend = 1301;
|
||||
|
||||
/// 已被对方拉黑
|
||||
static const int hasBeenBlocked = 1302;
|
||||
|
||||
/// 对方不是自己的好友
|
||||
static const int notFriend = 1303;
|
||||
|
||||
/// 已经是好友关系,不需要重复申请
|
||||
static const int alreadyAFriendRelationship = 1304;
|
||||
|
||||
/// 消息已读功能被关闭
|
||||
static const int messageReadFunctionIsTurnedOff = 1401;
|
||||
|
||||
/// 你已被禁言,不能在群里发言
|
||||
static const int youHaveBeenBanned = 1402;
|
||||
|
||||
/// 群已被禁言,不能发言
|
||||
static const int groupHasBeenBanned = 1403;
|
||||
|
||||
/// 该消息已被撤回
|
||||
static const int messageHasBeenRetracted = 1404;
|
||||
|
||||
/// 授权过期
|
||||
static const int licenseExpired = 1405;
|
||||
|
||||
/// token 已经过期
|
||||
static const int tokenHasExpired = 1501;
|
||||
|
||||
/// token 无效
|
||||
static const int tokenInvalid = 1502;
|
||||
|
||||
/// token 格式错误
|
||||
static const int tokenFormatError = 1503;
|
||||
|
||||
/// token 还未生效
|
||||
static const int tokenHasNotYetTakenEffect = 1504;
|
||||
|
||||
/// 未知 token 错误
|
||||
static const int unknownTokenError = 1505;
|
||||
|
||||
/// 被踢出的 token,无效
|
||||
static const int thekickedOutTokenIsInvalid = 1506;
|
||||
|
||||
/// token 不存在
|
||||
static const int tokenNotExist = 1507;
|
||||
|
||||
/// 连接数超过网关最大限制
|
||||
static const int connectionsExceedsMaximumLimit = 1601;
|
||||
|
||||
/// 连接握手参数错误
|
||||
static const int handshakeParameterError = 1602;
|
||||
|
||||
/// 文件上传过期
|
||||
static const int fileUploadExpired = 1701;
|
||||
}
|
||||
|
||||
@@ -2,52 +2,53 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 消息监听
|
||||
class OnAdvancedMsgListener {
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CMessageReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupMessageReadReceipt;
|
||||
Function(String msgId)? onRecvMessageRevoked;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(RevokedInfo info)? onRecvMessageRevokedV2;
|
||||
Function(Message msg)? onMsgDeleted;
|
||||
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
|
||||
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
|
||||
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(Message msg)? onRecvOfflineNewMessage;
|
||||
|
||||
/// Uniquely identifies
|
||||
String id;
|
||||
|
||||
OnAdvancedMsgListener({
|
||||
this.onRecvC2CMessageReadReceipt,
|
||||
this.onRecvGroupMessageReadReceipt,
|
||||
@deprecated this.onRecvMessageRevoked,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvMessageRevokedV2,
|
||||
this.onMsgDeleted,
|
||||
this.onNewRecvMessageRevoked,
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvGroupReadReceipt,
|
||||
this.onRecvMessageExtensionsAdded,
|
||||
this.onRecvMessageExtensionsChanged,
|
||||
this.onRecvMessageExtensionsDeleted,
|
||||
this.onRecvMessageExtensionsAdded,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvOfflineNewMessage,
|
||||
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";
|
||||
|
||||
void msgDeleted(Message msg) {
|
||||
onMsgDeleted?.call(msg);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void newRecvMessageRevoked(RevokedInfo info) {
|
||||
onNewRecvMessageRevoked?.call(info);
|
||||
}
|
||||
|
||||
/// C2C消息已读回执
|
||||
void recvC2CMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CMessageReadReceipt?.call(list);
|
||||
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvC2CReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// 群消息已读回执
|
||||
void recvGroupMessageReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupMessageReadReceipt?.call(list);
|
||||
void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
|
||||
onRecvGroupReadReceipt?.call(list);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void recvMessageRevoked(String msgId) {
|
||||
onRecvMessageRevoked?.call(msgId);
|
||||
}
|
||||
|
||||
/// 收到了一条新消息
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
/// 消息被撤回
|
||||
void recvMessageRevokedV2(RevokedInfo info) {
|
||||
onRecvMessageRevokedV2?.call(info);
|
||||
/// 收到拓展消息kv新增
|
||||
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
|
||||
onRecvMessageExtensionsAdded?.call(msgID, list);
|
||||
}
|
||||
|
||||
/// 收到拓展消息kv改变
|
||||
@@ -61,8 +62,12 @@ class OnAdvancedMsgListener {
|
||||
onRecvMessageExtensionsDeleted?.call(msgID, list);
|
||||
}
|
||||
|
||||
/// 收到拓展消息kv新增
|
||||
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
|
||||
onRecvMessageExtensionsAdded?.call(msgID, list);
|
||||
/// 收到了一条新消息
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
}
|
||||
|
||||
void recvOfflineNewMessage(Message msg) {
|
||||
onRecvOfflineNewMessage?.call(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 好友关系监听
|
||||
class OnFriendshipListener {
|
||||
Function(BlacklistInfo i)? onBlackAdded;
|
||||
Function(BlacklistInfo i)? onBlackDeleted;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
|
||||
Function(FriendApplicationInfo i)? onFriendApplicationRejected;
|
||||
Function(FriendInfo i)? onFriendAdded;
|
||||
Function(FriendInfo i)? onFriendDeleted;
|
||||
Function(FriendInfo i)? onFriendInfoChanged;
|
||||
Function(BlacklistInfo i)? onBlacklistAdded;
|
||||
Function(BlacklistInfo i)? onBlacklistDeleted;
|
||||
|
||||
OnFriendshipListener({
|
||||
this.onBlacklistAdded,
|
||||
this.onBlacklistDeleted,
|
||||
this.onBlackAdded,
|
||||
this.onBlackDeleted,
|
||||
this.onFriendAdded,
|
||||
this.onFriendApplicationAccepted,
|
||||
this.onFriendApplicationAdded,
|
||||
@@ -25,13 +25,13 @@ class OnFriendshipListener {
|
||||
});
|
||||
|
||||
/// 已被加入黑名单
|
||||
void blacklistAdded(BlacklistInfo u) {
|
||||
onBlacklistAdded?.call(u);
|
||||
void blackAdded(BlacklistInfo u) {
|
||||
onBlackAdded?.call(u);
|
||||
}
|
||||
|
||||
/// 已从黑名单移除
|
||||
void blacklistDeleted(BlacklistInfo u) {
|
||||
onBlacklistDeleted?.call(u);
|
||||
void blackDeleted(BlacklistInfo u) {
|
||||
onBlackDeleted?.call(u);
|
||||
}
|
||||
|
||||
/// 好友已添加
|
||||
|
||||
@@ -6,6 +6,7 @@ class OnGroupListener {
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationDeleted;
|
||||
Function(GroupApplicationInfo info)? onGroupApplicationRejected;
|
||||
Function(GroupInfo info)? onGroupDismissed;
|
||||
Function(GroupInfo info)? onGroupInfoChanged;
|
||||
Function(GroupMembersInfo info)? onGroupMemberAdded;
|
||||
Function(GroupMembersInfo info)? onGroupMemberDeleted;
|
||||
@@ -18,6 +19,7 @@ class OnGroupListener {
|
||||
this.onGroupApplicationAdded,
|
||||
this.onGroupApplicationDeleted,
|
||||
this.onGroupApplicationRejected,
|
||||
this.onGroupDismissed,
|
||||
this.onGroupInfoChanged,
|
||||
this.onGroupMemberAdded,
|
||||
this.onGroupMemberDeleted,
|
||||
@@ -46,6 +48,10 @@ class OnGroupListener {
|
||||
onGroupApplicationRejected?.call(info);
|
||||
}
|
||||
|
||||
void groupDismissed(GroupInfo info) {
|
||||
onGroupDismissed?.call(info);
|
||||
}
|
||||
|
||||
/// 群资料发生改变
|
||||
void groupInfoChanged(GroupInfo info) {
|
||||
onGroupInfoChanged?.call(info);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/// 组织架构监听
|
||||
class OnOrganizationListener {
|
||||
Function()? onOrganizationUpdated;
|
||||
|
||||
OnOrganizationListener({this.onOrganizationUpdated});
|
||||
|
||||
/// 组织架构有更新
|
||||
void organizationUpdated() {
|
||||
onOrganizationUpdated?.call();
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// 信令监听
|
||||
class OnSignalingListener {
|
||||
final Function(SignalingInfo info)? onInvitationCancelled;
|
||||
final Function(SignalingInfo info)? onInvitationTimeout;
|
||||
final Function(SignalingInfo info)? onInviteeAccepted;
|
||||
final Function(SignalingInfo info)? onInviteeRejected;
|
||||
final Function(SignalingInfo info)? onReceiveNewInvitation;
|
||||
final Function(SignalingInfo info)? onInviteeRejectedByOtherDevice;
|
||||
final Function(SignalingInfo info)? onInviteeAcceptedByOtherDevice;
|
||||
final Function(SignalingInfo info)? onHangup;
|
||||
final Function(RoomCallingInfo info)? onRoomParticipantConnected;
|
||||
final Function(RoomCallingInfo info)? onRoomParticipantDisconnected;
|
||||
final Function(MeetingStreamEvent event)? onMeetingStreamChanged;
|
||||
final Function(CustomSignaling info)? onReceiveCustomSignal;
|
||||
|
||||
OnSignalingListener({
|
||||
this.onInvitationCancelled,
|
||||
this.onInvitationTimeout,
|
||||
this.onInviteeAccepted,
|
||||
this.onInviteeRejected,
|
||||
this.onReceiveNewInvitation,
|
||||
this.onInviteeAcceptedByOtherDevice,
|
||||
this.onInviteeRejectedByOtherDevice,
|
||||
this.onHangup,
|
||||
this.onRoomParticipantConnected,
|
||||
this.onRoomParticipantDisconnected,
|
||||
this.onMeetingStreamChanged,
|
||||
this.onReceiveCustomSignal,
|
||||
});
|
||||
|
||||
/// 被邀请者收到:邀请者取消音视频通话
|
||||
void invitationCancelled(SignalingInfo info) {
|
||||
onInvitationCancelled?.call(info);
|
||||
}
|
||||
|
||||
/// 邀请者收到:被邀请者超时未接通
|
||||
void invitationTimeout(SignalingInfo info) {
|
||||
onInvitationTimeout?.call(info);
|
||||
}
|
||||
|
||||
/// 邀请者收到:被邀请者同意音视频通话
|
||||
void inviteeAccepted(SignalingInfo info) {
|
||||
onInviteeAccepted?.call(info);
|
||||
}
|
||||
|
||||
/// 邀请者收到:被邀请者拒绝音视频通话
|
||||
void inviteeRejected(SignalingInfo info) {
|
||||
onInviteeRejected?.call(info);
|
||||
}
|
||||
|
||||
/// 被邀请者收到:音视频通话邀请
|
||||
void receiveNewInvitation(SignalingInfo info) {
|
||||
onReceiveNewInvitation?.call(info);
|
||||
}
|
||||
|
||||
/// 被邀请者(其他端)收到:比如被邀请者在手机拒接,在pc上会收到此回调
|
||||
void inviteeAcceptedByOtherDevice(SignalingInfo info) {
|
||||
onInviteeAcceptedByOtherDevice?.call(info);
|
||||
}
|
||||
|
||||
/// 被邀请者(其他端)收到:比如被邀请者在手机拒接,在pc上会收到此回调
|
||||
void inviteeRejectedByOtherDevice(SignalingInfo info) {
|
||||
onInviteeRejectedByOtherDevice?.call(info);
|
||||
}
|
||||
|
||||
/// 被挂断
|
||||
void hangup(SignalingInfo info) {
|
||||
onHangup?.call(info);
|
||||
}
|
||||
|
||||
void roomParticipantConnected(RoomCallingInfo info) {
|
||||
onRoomParticipantConnected?.call(info);
|
||||
}
|
||||
|
||||
void roomParticipantDisconnected(RoomCallingInfo info) {
|
||||
onRoomParticipantDisconnected?.call(info);
|
||||
}
|
||||
|
||||
void streamChangedEvent(MeetingStreamEvent event) {
|
||||
onMeetingStreamChanged?.call(event);
|
||||
}
|
||||
|
||||
void receiveCustomSignal(CustomSignaling info) {
|
||||
onReceiveCustomSignal?.call(info);
|
||||
}
|
||||
}
|
||||
45
lib/src/listener/upload_file_listener.dart
Normal file
45
lib/src/listener/upload_file_listener.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
class OnUploadFileListener {
|
||||
Function(String id, int size, String url, int type)? onComplete;
|
||||
Function(String id, String partHash, String fileHash)? onHashPartComplete;
|
||||
Function(String id, int index, int size, String partHash)? onHashPartProgress;
|
||||
Function(String id, int size)? onOpen;
|
||||
Function(String id, int partSize, int num)? onPartSize;
|
||||
Function(String id, int fileSize, int streamSize, int storageSize)?
|
||||
onUploadProgress;
|
||||
Function(String id, String uploadID)? onUploadID;
|
||||
Function(String id, int index, int partSize, String partHash)?
|
||||
onUploadPartComplete;
|
||||
|
||||
void complete(String id, int size, String url, int type) {
|
||||
onComplete?.call(id, size, url, type);
|
||||
}
|
||||
|
||||
void hashPartComplete(String id, String partHash, String fileHash) {
|
||||
onHashPartComplete?.call(id, partHash, fileHash);
|
||||
}
|
||||
|
||||
void hashPartProgress(String id, int index, int size, String partHash) {
|
||||
onHashPartProgress?.call(id, index, size, partHash);
|
||||
}
|
||||
|
||||
void open(String id, int size) {
|
||||
onOpen?.call(id, size);
|
||||
}
|
||||
|
||||
void partSize(String id, int partSize, int num) {
|
||||
onPartSize?.call(id, partSize, num);
|
||||
}
|
||||
|
||||
void uploadProgress(
|
||||
String id, int fileSize, int streamSize, int storageSize) {
|
||||
onUploadProgress?.call(id, fileSize, streamSize, storageSize);
|
||||
}
|
||||
|
||||
void uploadID(String id, String uploadID) {
|
||||
onUploadID?.call(id, uploadID);
|
||||
}
|
||||
|
||||
void uploadPartComplete(String id, int index, int partSize, String partHash) {
|
||||
onUploadPartComplete?.call(id, index, partSize, partHash);
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,16 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
class OnUserListener {
|
||||
/// The information of the logged-in user has been updated
|
||||
Function(UserInfo info)? onSelfInfoUpdated;
|
||||
Function(UserStatusInfo info)? onUserStatusChanged;
|
||||
|
||||
OnUserListener({this.onSelfInfoUpdated});
|
||||
OnUserListener({this.onSelfInfoUpdated, this.onUserStatusChanged});
|
||||
|
||||
/// 自身信息发送变化回调
|
||||
void selfInfoUpdated(UserInfo info) {
|
||||
onSelfInfoUpdated?.call(info);
|
||||
}
|
||||
|
||||
void userStatusChanged(UserStatusInfo info) {
|
||||
onUserStatusChanged?.call(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/// 朋友圈监听
|
||||
class OnWorkMomentsListener {
|
||||
Function()? onRecvNewNotification;
|
||||
|
||||
OnWorkMomentsListener({this.onRecvNewNotification});
|
||||
|
||||
/// 朋友圈信息发送改变
|
||||
void recvNewNotification() {
|
||||
onRecvNewNotification?.call();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
@@ -79,19 +81,6 @@ class ConversationManager {
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||
|
||||
/// 通过会话id删除指定会话
|
||||
/// [conversationID] 被删除的会话的id
|
||||
Future deleteConversation({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteConversation',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 设置会话草稿
|
||||
/// [conversationID] 会话id
|
||||
/// [draftText] 草稿
|
||||
@@ -124,20 +113,21 @@ class ConversationManager {
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记群聊会话已读
|
||||
/// [groupID] 群id
|
||||
Future<dynamic> markGroupMessageHasRead({
|
||||
required String groupID,
|
||||
/// 置顶会话
|
||||
/// [conversationID] 会话id
|
||||
Future hideConversation({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markGroupMessageHasRead',
|
||||
'hideConversation',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取未读消息总数
|
||||
/// int.tryParse(count) ?? 0;
|
||||
Future<dynamic> getTotalUnreadMsgCount({
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -150,29 +140,29 @@ class ConversationManager {
|
||||
/// 查询会话id
|
||||
/// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID
|
||||
/// [sessionType] 参考[ConversationType]
|
||||
Future<dynamic> getConversationIDBySessionType({
|
||||
required String sourceID,
|
||||
required int sessionType,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'getConversationIDBySessionType',
|
||||
_buildParam({
|
||||
"sourceID": sourceID,
|
||||
"sessionType": sessionType,
|
||||
}));
|
||||
// Future<dynamic> getConversationIDBySessionType({
|
||||
// required String sourceID,
|
||||
// required int sessionType,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'getConversationIDBySessionType',
|
||||
// _buildParam({
|
||||
// "sourceID": sourceID,
|
||||
// "sessionType": sessionType,
|
||||
// }));
|
||||
|
||||
/// 消息免打扰设置
|
||||
/// [conversationIDList] 会话id列表
|
||||
/// [conversationID] 会话id
|
||||
/// [status] 0:正常;1:不接受消息;2:接受在线消息不接受离线消息;
|
||||
Future<dynamic> setConversationRecvMessageOpt({
|
||||
required List<String> conversationIDList,
|
||||
required String conversationID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationRecvMessageOpt',
|
||||
_buildParam({
|
||||
"conversationIDList": conversationIDList,
|
||||
"conversationID": conversationID,
|
||||
"status": status,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -196,13 +186,13 @@ class ConversationManager {
|
||||
/// 阅后即焚
|
||||
/// [conversationID] 会话id
|
||||
/// [isPrivate] true:开启,false:关闭
|
||||
Future<dynamic> setOneConversationPrivateChat({
|
||||
Future<dynamic> setConversationPrivateChat({
|
||||
required String conversationID,
|
||||
required bool isPrivate,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setOneConversationPrivateChat',
|
||||
'setConversationPrivateChat',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isPrivate": isPrivate,
|
||||
@@ -211,12 +201,25 @@ class ConversationManager {
|
||||
|
||||
/// 删除本地以及服务器的会话
|
||||
/// [conversationID] 会话ID
|
||||
Future<dynamic> deleteConversationFromLocalAndSvr({
|
||||
Future<dynamic> deleteConversationAndDeleteAllMsg({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteConversationFromLocalAndSvr',
|
||||
'deleteConversationAndDeleteAllMsg',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 清空会话里的消息
|
||||
/// [conversationID] 会话ID
|
||||
Future<dynamic> clearConversationAndDeleteAllMsg({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearConversationAndDeleteAllMsg',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
@@ -246,8 +249,17 @@ class ConversationManager {
|
||||
}));
|
||||
|
||||
/// 查询@所有人标识
|
||||
Future<dynamic> getAtAllTag() =>
|
||||
_channel.invokeMethod('getAtAllTag', _buildParam({}));
|
||||
Future<dynamic> getAtAllTag({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'getAtAllTag',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 查询@所有人标识
|
||||
String get atAllTag => 'AtAllTag';
|
||||
|
||||
/// 全局免打扰
|
||||
/// [status] 0:正常;1:不接受消息;2:接受在线消息不接受离线消息;
|
||||
@@ -265,19 +277,63 @@ class ConversationManager {
|
||||
/// 设置阅后即焚时长
|
||||
/// [conversationID] 会话id
|
||||
/// [burnDuration] 时长s,默认30s
|
||||
Future<dynamic> setOneConversationBurnDuration({
|
||||
Future<dynamic> setConversationBurnDuration({
|
||||
required String conversationID,
|
||||
int burnDuration = 30,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setOneConversationBurnDuration',
|
||||
'setConversationBurnDuration',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"burnDuration": burnDuration,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记消息已读
|
||||
/// [conversationID] 会话ID
|
||||
/// [messageIDList] 被标记的消息clientMsgID
|
||||
Future markConversationMessageAsRead({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markConversationMessageAsRead',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 开启定期删除
|
||||
/// [isMsgDestruct] true 开启
|
||||
Future<dynamic> setConversationIsMsgDestruct({
|
||||
required String conversationID,
|
||||
bool isMsgDestruct = true,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationIsMsgDestruct',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isMsgDestruct": isMsgDestruct,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 定期删除聊天记录
|
||||
/// [duration] 秒
|
||||
Future<dynamic> setConversationMsgDestructTime({
|
||||
required String conversationID,
|
||||
int duration = 1 * 24 * 60 * 60,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationMsgDestructTime',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"duration": duration,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 会话列表自定义排序规则。
|
||||
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
|
||||
..sort((a, b) {
|
||||
@@ -305,6 +361,7 @@ class ConversationManager {
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "conversationManager";
|
||||
log('param: $param');
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,42 +14,42 @@ class FriendshipManager {
|
||||
}
|
||||
|
||||
/// 查询好友信息
|
||||
/// [uidList] userID集合
|
||||
/// [userIDList] userID集合
|
||||
Future<List<UserInfo>> getFriendsInfo({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getFriendsInfo',
|
||||
_buildParam({
|
||||
"uidList": uidList,
|
||||
"userIDList": userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
|
||||
/// 发送一个好友请求,需要对方调用同意申请才能成为好友。
|
||||
/// [uid] 被邀请的用户ID
|
||||
/// [userID] 被邀请的用户ID
|
||||
/// [reason] 备注说明
|
||||
Future<dynamic> addFriend({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'addFriend',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"reqMsg": reason,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取别人加我为好友的申请
|
||||
Future<List<FriendApplicationInfo>> getRecvFriendApplicationList(
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getRecvFriendApplicationList',
|
||||
'getFriendApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -57,11 +57,11 @@ class FriendshipManager {
|
||||
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
|
||||
/// 获取我发出的好友申请
|
||||
Future<List<FriendApplicationInfo>> getSendFriendApplicationList(
|
||||
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSendFriendApplicationList',
|
||||
'getFriendApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -87,31 +87,31 @@ class FriendshipManager {
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// 设置好友备注
|
||||
/// [uid] 好友的userID
|
||||
/// [userID] 好友的userID
|
||||
/// [remark] 好友的备注
|
||||
Future<dynamic> setFriendRemark({
|
||||
required String uid,
|
||||
required String userID,
|
||||
required String remark,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setFriendRemark',
|
||||
_buildParam({
|
||||
'toUserID': uid,
|
||||
'toUserID': userID,
|
||||
'remark': remark,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 加入黑名单
|
||||
/// [uid] 被加入黑名单的好友ID
|
||||
/// [userID] 被加入黑名单的好友ID
|
||||
Future<dynamic> addBlacklist({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'addBlacklist',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -125,75 +125,75 @@ class FriendshipManager {
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
|
||||
/// 从黑名单移除
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
Future<dynamic> removeBlacklist({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'removeBlacklist',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 检查友好关系
|
||||
/// [uidList] userID列表
|
||||
/// [userIDList] userID列表
|
||||
Future<List<FriendshipInfo>> checkFriend({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'checkFriend',
|
||||
_buildParam({
|
||||
'uidList': uidList,
|
||||
'userIDList': userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (v) => FriendshipInfo.fromJson(v)));
|
||||
|
||||
/// 删除好友
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
Future<dynamic> deleteFriend({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteFriend',
|
||||
_buildParam({
|
||||
"uid": uid,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 接受好友请求
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
/// [handleMsg]备注说明
|
||||
Future<dynamic> acceptFriendApplication({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'acceptFriendApplication',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"handleMsg": handleMsg,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 拒绝好友请求
|
||||
/// [uid] 用户ID
|
||||
/// [userID] 用户ID
|
||||
/// [handleMsg]备注说明
|
||||
Future<dynamic> refuseFriendApplication({
|
||||
required String uid,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'refuseFriendApplication',
|
||||
_buildParam({
|
||||
"toUserID": uid,
|
||||
"toUserID": userID,
|
||||
"handleMsg": handleMsg,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
@@ -14,11 +16,11 @@ class GroupManager {
|
||||
}
|
||||
|
||||
/// 邀请进组,直接进组无需同意。
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<GroupInviteResult>> inviteUserToGroup({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -26,21 +28,21 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'inviteUserToGroup',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
'uidList': uidList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
|
||||
/// 移除组成员
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
/// [reason] 备注说明
|
||||
Future<List<GroupInviteResult>> kickGroupMember({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -48,40 +50,40 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'kickGroupMember',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
'reason': reason,
|
||||
'uidList': uidList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||
|
||||
/// 查询组成员资料
|
||||
/// [groupId] 组ID
|
||||
/// [uidList] 用户ID列表
|
||||
/// [groupID] 组ID
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<GroupMembersInfo>> getGroupMembersInfo({
|
||||
required String groupId,
|
||||
required List<String> uidList,
|
||||
required String groupID,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupMembersInfo',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'uidList': uidList,
|
||||
'groupID': groupID,
|
||||
'userIDList': userIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
/// 分页获取组成员列表
|
||||
/// [groupId] 群ID
|
||||
/// [filter] 过滤成员 0所有,1普通成员, 2群主,3管理员,4管理员+普通成员
|
||||
/// [groupID] 群ID
|
||||
/// [filter] 过滤成员 0所有,1群主 , 2管理员,3普通成员,4管理员+普通成员 5,群主+管理员
|
||||
/// [offset] 开始下标
|
||||
/// [count] 总数
|
||||
Future<List<GroupMembersInfo>> getGroupMemberList({
|
||||
required String groupId,
|
||||
required String groupID,
|
||||
int filter = 0,
|
||||
int offset = 0,
|
||||
int count = 0,
|
||||
@@ -91,7 +93,7 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'getGroupMemberList',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'filter': filter,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
@@ -101,12 +103,12 @@ class GroupManager {
|
||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||
|
||||
/// 分页获取组成员列表
|
||||
/// [groupId] 群ID
|
||||
/// [filter] 过滤成员 0所有,1普通成员, 2群主,3管理员,4管理员+普通成员
|
||||
/// [groupID] 群ID
|
||||
/// [filter] 过滤成员 0所有,1群主 , 2管理员,3普通成员,4管理员+普通成员 5,群主+管理员
|
||||
/// [offset] 开始下标
|
||||
/// [count] 总数
|
||||
Future<List<dynamic>> getGroupMemberListMap({
|
||||
required String groupId,
|
||||
required String groupID,
|
||||
int filter = 0,
|
||||
int offset = 0,
|
||||
int count = 0,
|
||||
@@ -116,7 +118,7 @@ class GroupManager {
|
||||
.invokeMethod(
|
||||
'getGroupMemberList',
|
||||
_buildParam({
|
||||
'gid': groupId,
|
||||
'groupID': groupID,
|
||||
'filter': filter,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
@@ -143,14 +145,19 @@ class GroupManager {
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// 检查是否已加入组
|
||||
/// [gid] 组ID
|
||||
/// [groupID] 组ID
|
||||
Future<bool> isJoinedGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
getJoinedGroupList(
|
||||
operationID: Utils.checkOperationID(operationID),
|
||||
).then((list) => list.where((e) => e.groupID == gid).length > 0);
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'isJoinGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => value == 'true' ? true : false);
|
||||
|
||||
/// 创建一个组
|
||||
/// [groupName] 群名
|
||||
@@ -161,28 +168,20 @@ class GroupManager {
|
||||
/// [ex] 额外信息
|
||||
/// [list] 初创群成员以及其角色列表[GroupMemberRole]
|
||||
Future<GroupInfo> createGroup({
|
||||
String? groupName,
|
||||
String? notification,
|
||||
String? introduction,
|
||||
String? faceUrl,
|
||||
int? groupType,
|
||||
String? ex,
|
||||
required List<GroupMemberRole> list,
|
||||
required GroupInfo groupInfo,
|
||||
List<String> memberUserIDs = const [],
|
||||
List<String> adminUserIDs = const [],
|
||||
String? ownerUserID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'createGroup',
|
||||
_buildParam({
|
||||
'gInfo': {
|
||||
"groupName": groupName,
|
||||
"notification": notification,
|
||||
"introduction": introduction,
|
||||
"faceURL": faceUrl,
|
||||
"groupType": groupType,
|
||||
"ex": ex,
|
||||
},
|
||||
'memberList': list.map((e) => e.toJson()).toList(),
|
||||
'groupInfo': groupInfo.toJson(),
|
||||
'memberUserIDs': memberUserIDs,
|
||||
'adminUserIDs': adminUserIDs,
|
||||
'ownerUserID': ownerUserID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then(
|
||||
@@ -193,43 +192,48 @@ class GroupManager {
|
||||
/// [groupName] 新的群名
|
||||
/// [notification] 新的公告
|
||||
/// [introduction] 新的群介绍
|
||||
/// [faceUrl] 新的群头像
|
||||
/// [faceURL] 新的群头像
|
||||
/// [ex] 新的额外信息
|
||||
Future<dynamic> setGroupInfo({
|
||||
required String groupID,
|
||||
String? groupName,
|
||||
String? notification,
|
||||
String? introduction,
|
||||
String? faceUrl,
|
||||
String? faceURL,
|
||||
String? ex,
|
||||
int? needVerification,
|
||||
int? lookMemberInfo,
|
||||
int? applyMemberFriend,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupInfo',
|
||||
_buildParam({
|
||||
"gid": groupID,
|
||||
'gInfo': {
|
||||
// "groupID": groupID,
|
||||
'groupInfo': {
|
||||
"groupID": groupID,
|
||||
"groupName": groupName,
|
||||
"notification": notification,
|
||||
"introduction": introduction,
|
||||
"faceURL": faceUrl,
|
||||
"faceURL": faceURL,
|
||||
"ex": ex,
|
||||
'needVerification': needVerification,
|
||||
'lookMemberInfo': lookMemberInfo,
|
||||
'applyMemberFriend': applyMemberFriend,
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 查询组信息
|
||||
/// [gidList] 组ID列表
|
||||
/// [groupIDList] 组ID列表
|
||||
Future<List<GroupInfo>> getGroupsInfo({
|
||||
required List<String> gidList,
|
||||
required List<String> groupIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getGroupsInfo',
|
||||
_buildParam({
|
||||
'gidList': gidList,
|
||||
'groupIDList': groupIDList,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then(
|
||||
@@ -238,7 +242,7 @@ class GroupManager {
|
||||
/// 申请加入组,需要通过管理员/群组同意。
|
||||
/// [joinSource] 2:通过邀请 3:通过搜索 4:通过二维码
|
||||
Future<dynamic> joinGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? reason,
|
||||
String? operationID,
|
||||
int joinSource = 3,
|
||||
@@ -246,7 +250,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'groupID': groupID,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
@@ -254,38 +258,38 @@ class GroupManager {
|
||||
|
||||
/// 退出组
|
||||
Future<dynamic> quitGroup({
|
||||
required String gid,
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'quitGroup',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 转移组拥有者权限
|
||||
/// [gid] 组ID
|
||||
/// [uid] 新拥有者ID
|
||||
/// [groupID] 组ID
|
||||
/// [userID] 新拥有者ID
|
||||
Future<dynamic> transferGroupOwner({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'transferGroupOwner',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 作为群主或者管理员,收到的群成员入群申请
|
||||
Future<List<GroupApplicationInfo>> getRecvGroupApplicationList(
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getRecvGroupApplicationList',
|
||||
'getGroupApplicationListAsRecipient',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -293,11 +297,11 @@ class GroupManager {
|
||||
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||
|
||||
/// 获取自己发出的入群申请记录
|
||||
Future<List<GroupApplicationInfo>> getSendGroupApplicationList(
|
||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant(
|
||||
{String? operationID}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSendGroupApplicationList',
|
||||
'getGroupApplicationListAsApplicant',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
@@ -306,39 +310,39 @@ class GroupManager {
|
||||
|
||||
/// 管理员或者群主同意某人进入某群
|
||||
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||
/// [gid] 组id
|
||||
/// [uid] 申请者用户ID
|
||||
/// [groupID] 组id
|
||||
/// [userID] 申请者用户ID
|
||||
Future<dynamic> acceptGroupApplication({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'acceptGroupApplication',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'handleMsg': handleMsg,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 管理员或者群主拒绝某人进入某群
|
||||
/// 注:主动申请入群需要通过管理员/群组处理,被别人拉入群不需要管理员/群组处理
|
||||
/// [gid] 组id
|
||||
/// [uid] 申请者用户ID
|
||||
/// [groupID] 组id
|
||||
/// [userID] 申请者用户ID
|
||||
/// [handleMsg] 说明
|
||||
Future<dynamic> refuseGroupApplication({
|
||||
required String gid,
|
||||
required String uid,
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? handleMsg,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'refuseGroupApplication',
|
||||
_buildParam({
|
||||
'gid': gid,
|
||||
'uid': uid,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'handleMsg': handleMsg,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -352,7 +356,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'dismissGroup',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -367,7 +371,7 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'groupID': groupID,
|
||||
'mute': mute,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -385,8 +389,8 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'changeGroupMemberMute',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'uid': userID,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'seconds': seconds,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -404,8 +408,8 @@ class GroupManager {
|
||||
_channel.invokeMethod(
|
||||
'setGroupMemberNickname',
|
||||
_buildParam({
|
||||
'gid': groupID,
|
||||
'uid': userID,
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'groupNickname': groupNickname ?? '',
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -633,6 +637,7 @@ class GroupManager {
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
log('param: $param');
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
@@ -12,18 +13,13 @@ class IMManager {
|
||||
late GroupManager groupManager;
|
||||
late UserManager userManager;
|
||||
|
||||
// late OfflinePushManager offlinePushManager;
|
||||
late SignalingManager signalingManager;
|
||||
late WorkMomentsManager workMomentsManager;
|
||||
late OrganizationManager organizationManager;
|
||||
|
||||
late OnConnectListener _connectListener;
|
||||
OnListenerForService? _listenerForService;
|
||||
late String uid;
|
||||
late UserInfo uInfo;
|
||||
OnUploadFileListener? _uploadFileListener;
|
||||
late String userID;
|
||||
late UserInfo userInfo;
|
||||
bool isLogined = false;
|
||||
String? token;
|
||||
String? _objectStorage;
|
||||
|
||||
IMManager(this._channel) {
|
||||
conversationManager = ConversationManager(_channel);
|
||||
@@ -31,10 +27,6 @@ class IMManager {
|
||||
messageManager = MessageManager(_channel);
|
||||
groupManager = GroupManager(_channel);
|
||||
userManager = UserManager(_channel);
|
||||
// offlinePushManager = OfflinePushManager(_channel);
|
||||
signalingManager = SignalingManager(_channel);
|
||||
workMomentsManager = WorkMomentsManager(_channel);
|
||||
organizationManager = OrganizationManager(_channel);
|
||||
_addNativeCallback(_channel);
|
||||
}
|
||||
|
||||
@@ -68,8 +60,12 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onSelfInfoUpdated':
|
||||
uInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||
userManager.listener.selfInfoUpdated(uInfo);
|
||||
userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||
userManager.listener.selfInfoUpdated(userInfo);
|
||||
break;
|
||||
case 'onUserStatusChanged':
|
||||
final status = Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
|
||||
userManager.listener.userStatusChanged(status);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.groupListener) {
|
||||
@@ -77,42 +73,39 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onGroupApplicationAccepted':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationAccepted(i);
|
||||
break;
|
||||
case 'onGroupApplicationAdded':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationAdded(i);
|
||||
break;
|
||||
case 'onGroupApplicationDeleted':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationDeleted(i);
|
||||
break;
|
||||
case 'onGroupApplicationRejected':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
groupManager.listener.groupApplicationRejected(i);
|
||||
break;
|
||||
case 'onGroupDismissed':
|
||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||
groupManager.listener.groupDismissed(i);
|
||||
break;
|
||||
case 'onGroupInfoChanged':
|
||||
final i = Utils.toObj(data, (map) => GroupInfo.fromJson(map));
|
||||
groupManager.listener.groupInfoChanged(i);
|
||||
break;
|
||||
case 'onGroupMemberAdded':
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberAdded(i);
|
||||
break;
|
||||
case 'onGroupMemberDeleted':
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberDeleted(i);
|
||||
break;
|
||||
case 'onGroupMemberInfoChanged':
|
||||
final i =
|
||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||
groupManager.listener.groupMemberInfoChanged(i);
|
||||
break;
|
||||
case 'onJoinedGroupAdded':
|
||||
@@ -128,52 +121,54 @@ class IMManager {
|
||||
var type = call.arguments['type'];
|
||||
// var id = call.arguments['data']['id'];
|
||||
switch (type) {
|
||||
case 'onRecvNewMessage':
|
||||
var value = call.arguments['data']['newMessage'];
|
||||
case 'onMsgDeleted':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvNewMessage(msg);
|
||||
break;
|
||||
case 'onRecvMessageRevoked':
|
||||
var msgID = call.arguments['data']['revokedMessage'];
|
||||
messageManager.msgListener.recvMessageRevoked(msgID);
|
||||
break;
|
||||
case 'onRecvC2CReadReceipt':
|
||||
var value = call.arguments['data']['c2cMessageReadReceipt'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CMessageReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvGroupReadReceipt':
|
||||
var value = call.arguments['data']['groupMessageReadReceipt'];
|
||||
var list =
|
||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupMessageReadReceipt(list);
|
||||
messageManager.msgListener.msgDeleted(msg);
|
||||
break;
|
||||
case 'onNewRecvMessageRevoked':
|
||||
var value = call.arguments['data']['revokedMessageV2'];
|
||||
var value = call.arguments['data']['messageRevoked'];
|
||||
var info = Utils.toObj(value, (map) => RevokedInfo.fromJson(map));
|
||||
messageManager.msgListener.recvMessageRevokedV2(info);
|
||||
messageManager.msgListener.newRecvMessageRevoked(info);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsChanged':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsChanged(msgID, list);
|
||||
case 'onRecvC2CReadReceipt':
|
||||
var value = call.arguments['data']['msgReceiptList'];
|
||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsDeleted':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var list = Utils.toList(value, (map) => '$map');
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsDeleted(msgID, list);
|
||||
case 'onRecvGroupReadReceipt':
|
||||
var value = call.arguments['data']['groupMsgReceiptList'];
|
||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvGroupReadReceipt(list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsAdded':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['list'];
|
||||
var value = call.arguments['data']['reactionExtensionList'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener
|
||||
.recvMessageExtensionsAdded(msgID, list);
|
||||
messageManager.msgListener.recvMessageExtensionsAdded(msgID, list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsChanged':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['reactionExtensionList'];
|
||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||
messageManager.msgListener.recvMessageExtensionsChanged(msgID, list);
|
||||
break;
|
||||
case 'onRecvMessageExtensionsDeleted':
|
||||
var msgID = call.arguments['data']['msgID'];
|
||||
var value = call.arguments['data']['reactionExtensionKeyList'];
|
||||
var list = Utils.toList(value, (map) => '$map');
|
||||
messageManager.msgListener.recvMessageExtensionsDeleted(msgID, list);
|
||||
break;
|
||||
|
||||
case 'onRecvNewMessage':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvNewMessage(msg);
|
||||
break;
|
||||
case 'onRecvOfflineNewMessage':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
messageManager.msgListener.recvOfflineNewMessage(msg);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.msgSendProgressListener) {
|
||||
@@ -204,18 +199,15 @@ class IMManager {
|
||||
conversationManager.listener.syncServerFailed();
|
||||
break;
|
||||
case 'onNewConversation':
|
||||
var list =
|
||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
conversationManager.listener.newConversation(list);
|
||||
break;
|
||||
case 'onConversationChanged':
|
||||
var list =
|
||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
conversationManager.listener.conversationChanged(list);
|
||||
break;
|
||||
case 'onTotalUnreadMessageCountChanged':
|
||||
conversationManager.listener
|
||||
.totalUnreadMessageCountChanged(data ?? 0);
|
||||
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.friendListener) {
|
||||
@@ -223,117 +215,41 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
|
||||
switch (type) {
|
||||
case 'onBlacklistAdded':
|
||||
case 'onBlackAdded':
|
||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||
friendshipManager.listener.blacklistAdded(u);
|
||||
friendshipManager.listener.blackAdded(u);
|
||||
break;
|
||||
case 'onBlacklistDeleted':
|
||||
case 'onBlackDeleted':
|
||||
final u = Utils.toObj(data, (map) => BlacklistInfo.fromJson(map));
|
||||
friendshipManager.listener.blacklistDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAccepted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAdded':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationDeleted':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationRejected':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationRejected(u);
|
||||
break;
|
||||
case 'onFriendInfoChanged':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendInfoChanged(u);
|
||||
friendshipManager.listener.blackDeleted(u);
|
||||
break;
|
||||
case 'onFriendAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAccepted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAdded':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationAdded(u);
|
||||
break;
|
||||
case 'onFriendApplicationDeleted':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationDeleted(u);
|
||||
break;
|
||||
case 'onFriendApplicationRejected':
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
friendshipManager.listener.friendApplicationRejected(u);
|
||||
break;
|
||||
case 'onFriendDeleted':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendDeleted(u);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.signalingListener) {
|
||||
String type = call.arguments['type'];
|
||||
dynamic data = call.arguments['data'];
|
||||
dynamic info;
|
||||
switch (type) {
|
||||
case 'onRoomParticipantConnected':
|
||||
case 'onRoomParticipantDisconnected':
|
||||
info = Utils.toObj(data, (map) => RoomCallingInfo.fromJson(map));
|
||||
break;
|
||||
case 'onStreamChange':
|
||||
info =
|
||||
Utils.toObj(data, (map) => MeetingStreamEvent.fromJson(map));
|
||||
break;
|
||||
case 'onReceiveCustomSignal':
|
||||
info = Utils.toObj(data, (map) => CustomSignaling.fromJson(map));
|
||||
break;
|
||||
default:
|
||||
info = Utils.toObj(data, (map) => SignalingInfo.fromJson(map));
|
||||
break;
|
||||
}
|
||||
switch (type) {
|
||||
case 'onInvitationCancelled':
|
||||
signalingManager.listener.invitationCancelled(info);
|
||||
break;
|
||||
case 'onInvitationTimeout':
|
||||
signalingManager.listener.invitationTimeout(info);
|
||||
break;
|
||||
case 'onInviteeAccepted':
|
||||
signalingManager.listener.inviteeAccepted(info);
|
||||
break;
|
||||
case 'onInviteeRejected':
|
||||
signalingManager.listener.inviteeRejected(info);
|
||||
break;
|
||||
case 'onReceiveNewInvitation':
|
||||
signalingManager.listener.receiveNewInvitation(info);
|
||||
break;
|
||||
case 'onInviteeAcceptedByOtherDevice':
|
||||
signalingManager.listener.inviteeAcceptedByOtherDevice(info);
|
||||
break;
|
||||
case 'onInviteeRejectedByOtherDevice':
|
||||
signalingManager.listener.inviteeRejectedByOtherDevice(info);
|
||||
break;
|
||||
case 'onHangUp':
|
||||
signalingManager.listener.hangup(info);
|
||||
break;
|
||||
case 'onRoomParticipantConnected':
|
||||
signalingManager.listener.roomParticipantConnected(info);
|
||||
break;
|
||||
case 'onRoomParticipantDisconnected':
|
||||
signalingManager.listener.roomParticipantDisconnected(info);
|
||||
break;
|
||||
case 'onStreamChange':
|
||||
signalingManager.listener.streamChangedEvent(info);
|
||||
break;
|
||||
case 'onReceiveCustomSignal':
|
||||
signalingManager.listener.receiveCustomSignal(info);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.workMomentsListener) {
|
||||
String type = call.arguments['type'];
|
||||
switch (type) {
|
||||
case 'OnRecvNewNotification':
|
||||
workMomentsManager.listener.recvNewNotification();
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.organizationListener) {
|
||||
String type = call.arguments['type'];
|
||||
switch (type) {
|
||||
case 'onOrganizationUpdated':
|
||||
organizationManager.listener.organizationUpdated();
|
||||
case 'onFriendInfoChanged':
|
||||
final u = Utils.toObj(data, (map) => FriendInfo.fromJson(map));
|
||||
friendshipManager.listener.friendInfoChanged(u);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.customBusinessListener) {
|
||||
@@ -341,8 +257,7 @@ class IMManager {
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onRecvCustomBusinessMessage':
|
||||
messageManager.customBusinessListener
|
||||
?.recvCustomBusinessMessage(data);
|
||||
messageManager.customBusinessListener?.recvCustomBusinessMessage(data);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.messageKvInfoListener) {
|
||||
@@ -350,8 +265,7 @@ class IMManager {
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onMessageKvInfoChanged':
|
||||
final list =
|
||||
Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
|
||||
final list = Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
|
||||
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
|
||||
break;
|
||||
}
|
||||
@@ -360,23 +274,19 @@ class IMManager {
|
||||
String data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onFriendApplicationAccepted':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
_listenerForService?.friendApplicationAccepted(u);
|
||||
break;
|
||||
case 'onFriendApplicationAdded':
|
||||
final u = Utils.toObj(
|
||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||
_listenerForService?.friendApplicationAdded(u);
|
||||
break;
|
||||
case 'onGroupApplicationAccepted':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
_listenerForService?.groupApplicationAccepted(i);
|
||||
break;
|
||||
case 'onGroupApplicationAdded':
|
||||
final i = Utils.toObj(
|
||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||
_listenerForService?.groupApplicationAdded(i);
|
||||
break;
|
||||
case 'onRecvNewMessage':
|
||||
@@ -384,10 +294,64 @@ class IMManager {
|
||||
_listenerForService?.recvNewMessage(msg);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.uploadFileListener) {
|
||||
String type = call.arguments['type'];
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'complete':
|
||||
String id = data['id'];
|
||||
int size = data['size'];
|
||||
String url = data['url'];
|
||||
int type = data['type'];
|
||||
_uploadFileListener?.complete(id, size, url, type);
|
||||
break;
|
||||
case 'hashPartComplete':
|
||||
String id = data['id'];
|
||||
String partHash = data['partHash'];
|
||||
String fileHash = data['fileHash'];
|
||||
_uploadFileListener?.hashPartComplete(id, partHash, fileHash);
|
||||
break;
|
||||
case 'hashPartProgress':
|
||||
String id = data['id'];
|
||||
int index = data['index'];
|
||||
int size = data['size'];
|
||||
String partHash = data['partHash'];
|
||||
_uploadFileListener?.hashPartProgress(id, index, size, partHash);
|
||||
break;
|
||||
case 'open':
|
||||
String id = data['id'];
|
||||
int size = data['size'];
|
||||
_uploadFileListener?.open(id, size);
|
||||
break;
|
||||
case 'partSize':
|
||||
String id = data['id'];
|
||||
int partSize = data['partSize'];
|
||||
int num = data['num'];
|
||||
_uploadFileListener?.partSize(id, partSize, num);
|
||||
break;
|
||||
case 'uploadProgress':
|
||||
String id = data['id'];
|
||||
int fileSize = data['fileSize'];
|
||||
int streamSize = data['streamSize'];
|
||||
int storageSize = data['storageSize'];
|
||||
_uploadFileListener?.uploadProgress(id, fileSize, streamSize, storageSize);
|
||||
break;
|
||||
case 'uploadID':
|
||||
String id = data['id'];
|
||||
String uploadID = data['uploadID'];
|
||||
_uploadFileListener?.uploadID(id, uploadID);
|
||||
break;
|
||||
case 'uploadPartComplete':
|
||||
String id = data['id'];
|
||||
int index = data['index'];
|
||||
int partSize = data['partSize'];
|
||||
String partHash = data['partHash'];
|
||||
_uploadFileListener?.uploadPartComplete(id, index, partSize, partHash);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (error, stackTrace) {
|
||||
Logger.print(
|
||||
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
||||
Logger.print("回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
||||
}
|
||||
return Future.value(null);
|
||||
});
|
||||
@@ -403,35 +367,38 @@ class IMManager {
|
||||
/// [enabledEncryption] true:加密
|
||||
/// [enabledCompression] true:压缩
|
||||
Future<dynamic> initSDK({
|
||||
required int platform,
|
||||
required int platformID,
|
||||
required String apiAddr,
|
||||
required String wsAddr,
|
||||
required String dataDir,
|
||||
required OnConnectListener listener,
|
||||
int logLevel = 6,
|
||||
String objectStorage = 'cos',
|
||||
String? encryptionKey,
|
||||
bool enabledEncryption = false,
|
||||
bool enabledCompression = false,
|
||||
bool isExternalExtensions = false,
|
||||
// String? encryptionKey,
|
||||
// bool isNeedEncryption = false,
|
||||
// bool isCompression = false,
|
||||
// bool isExternalExtensions = false,
|
||||
bool isLogStandardOutput = true,
|
||||
String? logFilePath,
|
||||
String? operationID,
|
||||
}) {
|
||||
this._connectListener = listener;
|
||||
this._objectStorage = objectStorage;
|
||||
return _channel.invokeMethod(
|
||||
'initSDK',
|
||||
_buildParam(
|
||||
{
|
||||
"platform": platform,
|
||||
"api_addr": apiAddr,
|
||||
"ws_addr": wsAddr,
|
||||
"data_dir": dataDir,
|
||||
"log_level": logLevel,
|
||||
"object_storage": objectStorage,
|
||||
"encryption_key": encryptionKey,
|
||||
"is_need_encryption": enabledEncryption,
|
||||
"is_compression ": enabledCompression,
|
||||
"is_external_extensions": isExternalExtensions,
|
||||
"platformID": platformID,
|
||||
"apiAddr": apiAddr,
|
||||
"wsAddr": wsAddr,
|
||||
"dataDir": dataDir,
|
||||
"logLevel": logLevel,
|
||||
"objectStorage": objectStorage,
|
||||
// "encryptionKey": encryptionKey,
|
||||
// "isNeedEncryption": isNeedEncryption,
|
||||
// "isCompression": isCompression,
|
||||
// "isExternalExtensions": isExternalExtensions,
|
||||
"isLogStandardOutput": isLogStandardOutput,
|
||||
"logFilePath": logFilePath,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
},
|
||||
));
|
||||
@@ -443,32 +410,40 @@ class IMManager {
|
||||
}
|
||||
|
||||
/// 登录
|
||||
/// [uid] 用户id
|
||||
/// [userID] 用户id
|
||||
/// [token] 登录token,从业务服务器上获取
|
||||
/// [defaultValue] 获取失败后使用的默认值
|
||||
Future<UserInfo> login({
|
||||
required String uid,
|
||||
required String userID,
|
||||
required String token,
|
||||
String? operationID,
|
||||
Future<UserInfo> Function()? defaultValue,
|
||||
bool checkLoginStatus = true,
|
||||
}) async {
|
||||
await _channel.invokeMethod(
|
||||
'login',
|
||||
_buildParam({
|
||||
'uid': uid,
|
||||
'token': token,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
int? status;
|
||||
if (checkLoginStatus) {
|
||||
// 1: logout 2: logging 3:logged
|
||||
status = await getLoginStatus();
|
||||
}
|
||||
if (status != LoginStatus.logging && status != LoginStatus.logged) {
|
||||
await _channel.invokeMethod(
|
||||
'login',
|
||||
_buildParam({
|
||||
'userID': userID,
|
||||
'token': token,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}),
|
||||
);
|
||||
}
|
||||
this.isLogined = true;
|
||||
this.uid = uid;
|
||||
this.userID = userID;
|
||||
this.token = token;
|
||||
try {
|
||||
return this.uInfo = await userManager.getSelfUserInfo();
|
||||
return this.userInfo = await userManager.getSelfUserInfo();
|
||||
} catch (error, stackTrace) {
|
||||
log('login e: $error s: $stackTrace');
|
||||
if (null != defaultValue) {
|
||||
return this.uInfo = await (defaultValue.call());
|
||||
return this.userInfo = await (defaultValue.call());
|
||||
}
|
||||
return Future.error(error, stackTrace);
|
||||
}
|
||||
@@ -488,38 +463,39 @@ class IMManager {
|
||||
}
|
||||
|
||||
/// 获取登录状态
|
||||
Future<int?> getLoginStatus() =>
|
||||
_channel.invokeMethod<int>('getLoginStatus', _buildParam({}));
|
||||
/// 1: logout 2: logging 3:logged
|
||||
Future<int?> getLoginStatus({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod<int>(
|
||||
'getLoginStatus',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取当前登录用户id
|
||||
Future<String> getLoginUserID() async => uid;
|
||||
Future<String> getLoginUserID() async => userID;
|
||||
|
||||
/// 获取当前登录用户信息
|
||||
Future<UserInfo> getLoginUserInfo() async => uInfo;
|
||||
Future<UserInfo> getLoginUserInfo() async => userInfo;
|
||||
|
||||
/// 从后台回到前台立刻唤醒
|
||||
Future wakeUp({String? operationID}) => _channel.invokeMethod(
|
||||
'wakeUp',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 上传图片到服务器
|
||||
/// [path] 图片路径
|
||||
/// [token] im token
|
||||
/// [objectStorage] 存储对象 cos/minio
|
||||
Future uploadImage({
|
||||
required String path,
|
||||
String? token,
|
||||
String? objectStorage,
|
||||
///[id] 跟 [OnUploadFileListener] id一致,区分是哪个文件的回调
|
||||
Future uploadFile({
|
||||
required String id,
|
||||
required String filePath,
|
||||
required String fileName,
|
||||
String? contentType,
|
||||
String? cause,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'uploadImage',
|
||||
'uploadFile',
|
||||
_buildParam({
|
||||
'path': path,
|
||||
'token': token ?? this.token,
|
||||
'obj': objectStorage ?? this._objectStorage,
|
||||
'id': id,
|
||||
'filePath': filePath,
|
||||
'name': fileName,
|
||||
'contentType': contentType,
|
||||
'cause': cause,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
@@ -537,30 +513,39 @@ class IMManager {
|
||||
}));
|
||||
|
||||
/// 标记app处于后台
|
||||
Future setAppBackgroundStatus({
|
||||
required bool isBackground,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setAppBackgroundStatus',
|
||||
_buildParam({
|
||||
'isBackground': isBackground,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
// Future setAppBackgroundStatus({
|
||||
// required bool isBackground,
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'setAppBackgroundStatus',
|
||||
// _buildParam({
|
||||
// 'isBackground': isBackground,
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }));
|
||||
|
||||
/// 网络改变
|
||||
Future networkChanged({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'networkChanged',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
// Future networkStatusChanged({
|
||||
// String? operationID,
|
||||
// }) =>
|
||||
// _channel.invokeMethod(
|
||||
// 'networkStatusChanged',
|
||||
// _buildParam({
|
||||
// 'operationID': Utils.checkOperationID(operationID),
|
||||
// }));
|
||||
|
||||
void setUploadFileListener(OnUploadFileListener listener) {
|
||||
_uploadFileListener = listener;
|
||||
}
|
||||
|
||||
///
|
||||
Future setListenerForService(OnListenerForService listener) {
|
||||
this._listenerForService = listener;
|
||||
return _channel.invokeMethod('setListenerForService', _buildParam({}));
|
||||
if (Platform.isAndroid) {
|
||||
this._listenerForService = listener;
|
||||
return _channel.invokeMethod('setListenerForService', _buildParam({}));
|
||||
} else {
|
||||
throw UnsupportedError("only supprot android platform");
|
||||
}
|
||||
}
|
||||
|
||||
MethodChannel get channel => _channel;
|
||||
|
||||
@@ -52,59 +52,56 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||
/// [count] 一次拉取的总数
|
||||
Future<List<Message>> getHistoryMessageList({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getHistoryMessageList',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 10,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息[revokeMessageV2]
|
||||
/// [message] 被撤回的消息体
|
||||
@deprecated
|
||||
Future revokeMessage({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'revokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 删除本地消息
|
||||
/// [message] 被删除的消息体
|
||||
Future deleteMessageFromLocalStorage({
|
||||
required Message message,
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalStorage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"clientMsgID": clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// core-sdk: DeleteMessage
|
||||
/// 删除本地跟服务器的指定的消息
|
||||
/// [message] 被删除的消息
|
||||
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"clientMsgID": clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocal({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocal',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 插入单聊消息到本地
|
||||
/// [receiverID] 接收者id
|
||||
@@ -148,38 +145,6 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 标记c2c单条消息已读
|
||||
/// [userID] 消息来源的userID
|
||||
/// [messageIDList] 消息clientMsgID集合
|
||||
Future markC2CMessageAsRead({
|
||||
required String userID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markC2CMessageAsRead',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记群聊消息已读
|
||||
/// [groupID] 群id
|
||||
/// [messageIDList] 消息clientMsgID集合
|
||||
Future markGroupMessageAsRead({
|
||||
required String groupID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markGroupMessageAsRead',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"groupID": groupID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 正在输入提示
|
||||
/// [msgTip] 自定义内容
|
||||
Future typingStatusUpdate({
|
||||
@@ -489,14 +454,22 @@ class MessageManager {
|
||||
/// 创建卡片消息
|
||||
/// [data] 自定义数据
|
||||
Future<Message> createCardMessage({
|
||||
required Map<String, dynamic> data,
|
||||
required String userID,
|
||||
required String nickname,
|
||||
String? faceURL,
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'createCardMessage',
|
||||
_buildParam({
|
||||
'cardMessage': data,
|
||||
'cardMessage': {
|
||||
'userID': userID,
|
||||
'nickname': nickname,
|
||||
'faceURL': faceURL,
|
||||
'ex': ex,
|
||||
},
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
@@ -519,32 +492,6 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 清空单聊消息记录
|
||||
/// [uid] 单聊对象id
|
||||
Future<dynamic> clearC2CHistoryMessage({
|
||||
required String uid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearC2CHistoryMessage',
|
||||
_buildParam({
|
||||
"userID": uid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 清空组消息记录
|
||||
/// [gid] 组id
|
||||
Future<dynamic> clearGroupHistoryMessage({
|
||||
required String gid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearGroupHistoryMessage',
|
||||
_buildParam({
|
||||
"groupID": gid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 搜索消息
|
||||
/// [conversationID] 根据会话查询,如果是全局搜索传null
|
||||
/// [keywordList] 搜索关键词列表,目前仅支持一个关键词搜索
|
||||
@@ -584,137 +531,48 @@ class MessageManager {
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
|
||||
/// 删除本地跟服务器的指定的消息
|
||||
/// [message] 被删除的消息
|
||||
Future<dynamic> deleteMessageFromLocalAndSvr({
|
||||
required Message message,
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessage({
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteMessageFromLocalAndSvr',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 删除本地所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocal({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocal',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器所有聊天记录
|
||||
Future<dynamic> deleteAllMsgFromLocalAndSvr({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'deleteAllMsgFromLocalAndSvr',
|
||||
'revokeMessage',
|
||||
_buildParam({
|
||||
'conversationID': conversationID,
|
||||
'clientMsgID': clientMsgID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 标记消息已读
|
||||
/// [conversationID] 会话ID
|
||||
/// [messageIDList] 被标记的消息clientMsgID
|
||||
Future markMessageAsReadByConID({
|
||||
Future markMessagesAsReadByMsgID({
|
||||
required String conversationID,
|
||||
required List<String> messageIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'markMessageAsReadByConID',
|
||||
'markMessagesAsReadByMsgID',
|
||||
_buildParam({
|
||||
"messageIDList": messageIDList,
|
||||
"conversationID": conversationID,
|
||||
"messageIDList": messageIDList,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器的单聊聊天记录
|
||||
/// [uid] 聊天对象的userID
|
||||
Future<dynamic> clearC2CHistoryMessageFromLocalAndSvr({
|
||||
required String uid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearC2CHistoryMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"userID": uid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 删除本地跟服务器的群聊天记录
|
||||
/// [gid] 组id
|
||||
Future<dynamic> clearGroupHistoryMessageFromLocalAndSvr({
|
||||
required String gid,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearGroupHistoryMessageFromLocalAndSvr',
|
||||
_buildParam({
|
||||
"groupID": gid,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||
/// [count] 一次拉取的总数
|
||||
Future<List<Message>> getHistoryMessageListReverse({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getHistoryMessageListReverse',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 10,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 撤回消息
|
||||
/// [message] 被撤回的消息体
|
||||
Future revokeMessageV2({
|
||||
required Message message,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'newRevokeMessage',
|
||||
_buildParam(message.toJson()
|
||||
..addAll({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
})));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,以前的聊天记录)
|
||||
/// [userID] 接收消息的用户id
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [groupID] 接收消息的组id
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.first
|
||||
/// [count] 一次拉取的总数
|
||||
/// [lastMinSeq] 第一页消息不用传,获取第二页开始必传 跟[startMsg]一样
|
||||
Future<AdvancedMessage> getAdvancedHistoryMessageList({
|
||||
String? userID,
|
||||
String? groupID,
|
||||
String? conversationID,
|
||||
int? lastMinSeq,
|
||||
Message? startMsg,
|
||||
int? lastMinSeq,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -722,16 +580,36 @@ class MessageManager {
|
||||
.invokeMethod(
|
||||
'getAdvancedHistoryMessageList',
|
||||
_buildParam({
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 40,
|
||||
'lastMinSeq': lastMinSeq ?? 0,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
|
||||
/// 获取聊天记录(以startMsg为节点,新收到的聊天记录),用在全局搜索定位某一条消息,然后此条消息后新增的消息
|
||||
/// [conversationID] 会话id,查询通知时可用
|
||||
/// [startMsg] 从这条消息开始查询[count]条,获取的列表index==length-1为最新消息,所以获取下一页历史记录startMsg=list.last
|
||||
/// [count] 一次拉取的总数
|
||||
Future<AdvancedMessage> getAdvancedHistoryMessageListReverse({
|
||||
String? conversationID,
|
||||
Message? startMsg,
|
||||
int? lastMinSeq,
|
||||
int? count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getAdvancedHistoryMessageListReverse',
|
||||
_buildParam({
|
||||
'conversationID': conversationID ?? '',
|
||||
'startClientMsgID': startMsg?.clientMsgID ?? '',
|
||||
'count': count ?? 40,
|
||||
'lastMinSeq': lastMinSeq ?? 0,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
|
||||
/// 查找消息详细
|
||||
/// [conversationID] 会话id
|
||||
@@ -747,8 +625,7 @@ class MessageManager {
|
||||
'searchParams': searchParams.map((e) => e.toJson()).toList(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
|
||||
/// 富文本消息
|
||||
/// [text] 输入内容
|
||||
@@ -876,12 +753,28 @@ class MessageManager {
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
|
||||
/// 用户资料改变监听
|
||||
///
|
||||
Future setCustomBusinessListener(OnCustomBusinessListener listener) {
|
||||
this.customBusinessListener = listener;
|
||||
return _channel.invokeMethod('setCustomBusinessListener', _buildParam({}));
|
||||
}
|
||||
|
||||
Future setMessageLocalEx({
|
||||
required String conversationID,
|
||||
required String clientMsgID,
|
||||
required String localEx,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel.invokeMethod(
|
||||
'setMessageLocalEx',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"clientMsgID": clientMsgID,
|
||||
"localEx": localEx,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}
|
||||
|
||||
///
|
||||
Future setMessageKvInfoListener(OnMessageKvInfoListener listener) {
|
||||
this.messageKvInfoListener = listener;
|
||||
@@ -901,8 +794,7 @@ class MessageManager {
|
||||
'list': list.map((e) => e.toJson()).toList(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
|
||||
Future<List<TypeKeySetResult>> deleteMessageReactionExtensions({
|
||||
required Message message,
|
||||
@@ -917,8 +809,7 @@ class MessageManager {
|
||||
'list': list,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
|
||||
Future<List<MessageTypeKeyMapping>> getMessageListReactionExtensions({
|
||||
List<Message> messageList = const [],
|
||||
@@ -931,8 +822,7 @@ class MessageManager {
|
||||
'messageList': messageList.map((e) => e.toJson()).toList(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(
|
||||
value, (map) => MessageTypeKeyMapping.fromJson(map)));
|
||||
.then((value) => Utils.toList(value, (map) => MessageTypeKeyMapping.fromJson(map)));
|
||||
|
||||
Future<List<TypeKeySetResult>> addMessageReactionExtensions({
|
||||
required Message message,
|
||||
@@ -947,8 +837,7 @@ class MessageManager {
|
||||
'list': list.map((e) => e.toJson()).toList(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
|
||||
|
||||
Future<List<MessageTypeKeyMapping>> getMessageListSomeReactionExtensions({
|
||||
List<Message> messageList = const [],
|
||||
@@ -963,8 +852,7 @@ class MessageManager {
|
||||
'list': kvList.map((e) => e.toJson()).toList(),
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(
|
||||
value, (map) => MessageTypeKeyMapping.fromJson(map)));
|
||||
.then((value) => Utils.toList(value, (map) => MessageTypeKeyMapping.fromJson(map)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "messageManager";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// import 'package:flutter/services.dart';
|
||||
//
|
||||
// class OfflinePushManager{
|
||||
// MethodChannel _channel;
|
||||
//
|
||||
// OfflinePushManager(this._channel);
|
||||
// }
|
||||
@@ -1,162 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OrganizationManager {
|
||||
MethodChannel _channel;
|
||||
late OnOrganizationListener listener;
|
||||
|
||||
OrganizationManager(this._channel);
|
||||
|
||||
/// 组织架构发生变化回调
|
||||
Future setOrganizationListener(OnOrganizationListener listener) {
|
||||
this.listener = listener;
|
||||
return _channel.invokeMethod('setOrganizationListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 获取子部门列表,返回当前部门下的一级子部门
|
||||
/// [departmentID] 当前部门id
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<DeptInfo>> getSubDept({
|
||||
required String departmentID,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getSubDepartment',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => DeptInfo.fromJson(v)));
|
||||
|
||||
/// 获取部门下的成员列表,返回当前部门下的一级成员
|
||||
/// [departmentID] 当前部门id
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<DeptMemberInfo>> getDeptMember({
|
||||
required String departmentID,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentMember',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (v) => DeptMemberInfo.fromJson(v)));
|
||||
|
||||
/// 获取成员所在的部门
|
||||
/// [userID] 成员ID
|
||||
Future<List<UserInDept>> getUserInDept({
|
||||
required String userID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getUserInDepartment',
|
||||
_buildParam({
|
||||
'userID': userID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInDept.fromJson(v)));
|
||||
|
||||
/// 获取部门下的子部门跟员工
|
||||
/// [departmentID] 当前部门id
|
||||
Future<DeptMemberAndSubDept> getDeptMemberAndSubDept({
|
||||
required String departmentID,
|
||||
// int departmentOffset = 0,
|
||||
// int departmentCount = 40,
|
||||
// int memberOffset = 0,
|
||||
// int memberCount = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentMemberAndSubDepartment',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
// 'departmentOffset': departmentOffset,
|
||||
// 'departmentCount': departmentCount,
|
||||
// 'memberOffset': memberOffset,
|
||||
// 'memberCount': memberCount,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v)));
|
||||
|
||||
/// 查询部门信息
|
||||
/// [departmentID] 部门ID
|
||||
Future<DeptInfo> getDeptInfo({
|
||||
required String departmentID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getDepartmentInfo',
|
||||
_buildParam({
|
||||
'departmentID': departmentID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (v) => DeptInfo.fromJson(v)));
|
||||
|
||||
/// 搜索组织人员
|
||||
/// [keyWord] 关键字
|
||||
/// [isSearchUserName] 是否匹配用户名
|
||||
/// [isSearchEnglishName] 是否匹配英文名
|
||||
/// [isSearchPosition] 是否匹配职位
|
||||
/// [isSearchUserID] 是否匹配用户ID
|
||||
/// [isSearchMobile] 是否匹配手机号
|
||||
/// [isSearchEmail] 是否匹配邮箱号
|
||||
/// [isSearchTelephone] 是否匹配电话号码
|
||||
/// [offset] 开始下标
|
||||
/// [count] 分页大小
|
||||
Future<OrganizationSearchResult> searchOrganization({
|
||||
required String keyWord,
|
||||
bool isSearchUserName = false,
|
||||
bool isSearchEnglishName = false,
|
||||
bool isSearchPosition = false,
|
||||
bool isSearchUserID = false,
|
||||
bool isSearchMobile = false,
|
||||
bool isSearchEmail = false,
|
||||
bool isSearchTelephone = false,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'searchOrganization',
|
||||
_buildParam({
|
||||
'searchParam': {
|
||||
'keyWord': keyWord,
|
||||
'isSearchUserName': isSearchUserName,
|
||||
'isSearchEnglishName': isSearchEnglishName,
|
||||
'isSearchPosition': isSearchPosition,
|
||||
'isSearchUserID': isSearchUserID,
|
||||
'isSearchMobile': isSearchMobile,
|
||||
'isSearchEmail': isSearchEmail,
|
||||
'isSearchTelephone': isSearchTelephone,
|
||||
},
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (v) => OrganizationSearchResult.fromJson(v)));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "organizationManager";
|
||||
return param;
|
||||
}
|
||||
}
|
||||
@@ -1,307 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../../flutter_openim_sdk.dart';
|
||||
|
||||
class SignalingManager {
|
||||
MethodChannel _channel;
|
||||
late OnSignalingListener listener;
|
||||
|
||||
SignalingManager(this._channel);
|
||||
|
||||
/// 信令监听
|
||||
Future setSignalingListener(OnSignalingListener listener) {
|
||||
this.listener = listener;
|
||||
return _channel.invokeMethod('setSignalingListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 邀请个人加入音视频
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<SignalingCertificate> signalingInvite({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingInvite',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||
|
||||
/// 邀请群里某些人加入音视频
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<SignalingCertificate> signalingInviteInGroup({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingInviteInGroup',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||
|
||||
/// 同意某人音视频邀请
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<SignalingCertificate> signalingAccept({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingAccept',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||
|
||||
/// 拒绝某人音视频邀请
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<dynamic> signalingReject({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingReject',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 邀请者取消音视频通话
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<dynamic> signalingCancel({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingCancel',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 挂断
|
||||
/// [info] 信令对象[SignalingInfo]
|
||||
Future<dynamic> signalingHungUp({
|
||||
required SignalingInfo info,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingHungUp',
|
||||
_buildParam({
|
||||
'signalingInfo': info.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取当前群通话信息
|
||||
/// [groupID] 当前群ID
|
||||
Future<RoomCallingInfo> signalingGetRoomByGroupID({
|
||||
required String groupID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingGetRoomByGroupID',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => RoomCallingInfo.fromJson(map)));
|
||||
|
||||
/// 获取进入房间的信息
|
||||
/// [roomID] 当前房间ID
|
||||
Future<SignalingCertificate> signalingGetTokenByRoomID({
|
||||
required String roomID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingGetTokenByRoomID',
|
||||
_buildParam({
|
||||
'roomID': roomID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(
|
||||
value,
|
||||
(map) => SignalingCertificate.fromJson(
|
||||
map..addAll({'roomID': roomID}))));
|
||||
|
||||
/// 会议设置
|
||||
/// required String roomID,
|
||||
/// String? meetingName,
|
||||
/// String? ex,
|
||||
/// int startTime = 0,
|
||||
/// int endTime = 0,
|
||||
/// bool participantCanUnmuteSelf = true,
|
||||
/// bool participantCanEnableVideo = true,
|
||||
/// bool onlyHostInviteUser = true,
|
||||
/// bool onlyHostShareScreen = true,
|
||||
/// bool joinDisableMicrophone = true,
|
||||
/// bool joinDisableVideo = true,
|
||||
/// bool isMuteAllVideo = true,
|
||||
/// bool isMuteAllMicrophone = true,
|
||||
/// List<String> addCanScreenUserIDList = const [],
|
||||
/// List<String> reduceCanScreenUserIDList = const [],
|
||||
/// List<String> addDisableMicrophoneUserIDList = const [],
|
||||
/// List<String> reduceDisableMicrophoneUserIDList = const [],
|
||||
/// List<String> addDisableVideoUserIDList = const [],
|
||||
/// List<String> reduceDisableVideoUserIDList = const [],
|
||||
/// List<String> addPinedUserIDList = const [],
|
||||
/// List<String> reducePinedUserIDList = const [],
|
||||
/// List<String> addBeWatchedUserIDList = const [],
|
||||
/// List<String> reduceBeWatchedUserIDList = const [],
|
||||
Future<dynamic> signalingUpdateMeetingInfo({
|
||||
required Map info,
|
||||
String? operationID,
|
||||
}) {
|
||||
if (info['meetingID'] != null) {
|
||||
info['roomID'] = info['meetingID'];
|
||||
}
|
||||
assert(info['roomID'] != null);
|
||||
return _channel.invokeMethod(
|
||||
'signalingUpdateMeetingInfo',
|
||||
_buildParam({
|
||||
'info': info,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}
|
||||
|
||||
/// 创建会议室
|
||||
/// [meetingName] 会议主题
|
||||
/// [meetingHostUserID] 会议主持人ID
|
||||
/// [startTime] 开始时间s
|
||||
/// [meetingDuration] 会议时长s
|
||||
/// [inviteeUserIDList] 被邀请人ID列表
|
||||
/// [ex] 其他
|
||||
Future<SignalingCertificate> signalingCreateMeeting({
|
||||
required String meetingName,
|
||||
String? meetingHostUserID,
|
||||
int? startTime,
|
||||
int? meetingDuration,
|
||||
List<String> inviteeUserIDList = const [],
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingCreateMeeting',
|
||||
_buildParam({
|
||||
'info': {
|
||||
'meetingName': meetingName,
|
||||
'meetingHostUserID': meetingHostUserID,
|
||||
'startTime': startTime,
|
||||
'meetingDuration': meetingDuration,
|
||||
'inviteeUserIDList': inviteeUserIDList,
|
||||
'ex': ex,
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||
|
||||
/// 加入会议室
|
||||
/// [meetingID] 会议ID
|
||||
/// [meetingName] 会议主题
|
||||
/// [participantNickname] 加入房间显示的名称
|
||||
Future<SignalingCertificate> signalingJoinMeeting({
|
||||
required String meetingID,
|
||||
String? meetingName,
|
||||
String? participantNickname,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingJoinMeeting',
|
||||
_buildParam({
|
||||
'info': {
|
||||
'meetingID': meetingID,
|
||||
'meetingName': meetingName,
|
||||
'participantNickname': participantNickname,
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SignalingCertificate.fromJson(map)));
|
||||
|
||||
/// 会议室 管理员对指定的某一个入会人员设置禁言
|
||||
/// [roomID] 会议ID
|
||||
/// [streamType] video/audio
|
||||
/// [userID] 被禁言的用户ID
|
||||
/// [mute] true:禁言
|
||||
/// [muteAll] true:video/audio 一起设置
|
||||
Future<dynamic> signalingOperateStream({
|
||||
required String roomID,
|
||||
String? streamType,
|
||||
required String userID,
|
||||
bool mute = false,
|
||||
bool muteAll = false,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingOperateStream',
|
||||
_buildParam({
|
||||
'roomID': roomID,
|
||||
'streamType': streamType,
|
||||
'userID': userID,
|
||||
'mute': mute,
|
||||
'muteAll': muteAll,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 获取所有的未完成会议
|
||||
/// [roomID] 会议ID
|
||||
Future<MeetingInfoList> signalingGetMeetings({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'signalingGetMeetings',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => MeetingInfoList.fromJson(map)));
|
||||
|
||||
/// 结束会议
|
||||
/// [roomID] 会议ID
|
||||
Future<dynamic> signalingCloseRoom({
|
||||
required String roomID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingCloseRoom',
|
||||
_buildParam({
|
||||
'roomID': roomID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 自定义信令
|
||||
/// [roomID] 会议ID
|
||||
/// [customInfo] 自定义信令
|
||||
Future<dynamic> signalingSendCustomSignal({
|
||||
required String roomID,
|
||||
required String customInfo,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'signalingSendCustomSignal',
|
||||
_buildParam({
|
||||
'roomID': roomID,
|
||||
'customInfo': customInfo,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "signalingManager";
|
||||
return param;
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,16 @@ class UserManager {
|
||||
}
|
||||
|
||||
/// 获取用户资料
|
||||
/// [uidList] 用户ID列表
|
||||
/// [userIDList] 用户ID列表
|
||||
Future<List<UserInfo>> getUsersInfo({
|
||||
required List<String> uidList,
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getUsersInfo',
|
||||
_buildParam({
|
||||
'uidList': uidList,
|
||||
'userIDList': userIDList,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
|
||||
@@ -75,6 +75,76 @@ class UserManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
Future<List<UserStatusInfo>> subscribeUsersStatus(
|
||||
List<String> userIDs, {
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'subscribeUsersStatus',
|
||||
_buildParam({
|
||||
'userIDs': userIDs,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<UserStatusInfo>> unsubscribeUsersStatus(
|
||||
List<String> userIDs, {
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'unsubscribeUsersStatus',
|
||||
_buildParam({
|
||||
'userIDs': userIDs,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<UserStatusInfo>> getSubscribeUsersStatus({
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getSubscribeUsersStatus',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<UserStatusInfo>> getUserStatus(
|
||||
List<String> userIDs, {
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getUserStatus',
|
||||
_buildParam({
|
||||
'userIDs': userIDs,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<UserInfo>> getUsersInfoStranger(
|
||||
List<String> userIDs, {
|
||||
String? groupID,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getUsersInfoStranger',
|
||||
_buildParam({
|
||||
'userIDs': userIDs,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => UserInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "userManager";
|
||||
return param;
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class WorkMomentsManager {
|
||||
MethodChannel _channel;
|
||||
late OnWorkMomentsListener listener;
|
||||
|
||||
WorkMomentsManager(this._channel);
|
||||
|
||||
/// 朋友圈信息发送变化通知
|
||||
Future setWorkMomentsListener(OnWorkMomentsListener listener) {
|
||||
this.listener = listener;
|
||||
return _channel.invokeMethod('setWorkMomentsListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// 获取朋友圈未读消息总数
|
||||
Future<int> getWorkMomentsUnReadCount({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getWorkMomentsUnReadCount',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => map['unreadCount']));
|
||||
|
||||
/// 获取通知列表
|
||||
/// [offset] 开始下标
|
||||
/// [count] 每页大小
|
||||
Future<List<WorkMomentsInfo>> getWorkMomentsNotification({
|
||||
required int offset,
|
||||
required int count,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getWorkMomentsNotification',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toList(value, (map) => WorkMomentsInfo.fromJson(map)));
|
||||
|
||||
/// 清除通知列表
|
||||
Future clearWorkMomentsNotification({
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'clearWorkMomentsNotification',
|
||||
_buildParam({
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
param["ManagerName"] = "workMomentsManager";
|
||||
return param;
|
||||
}
|
||||
}
|
||||
@@ -51,8 +51,11 @@ class ConversationInfo {
|
||||
/// 可阅读期限 s
|
||||
int? burnDuration;
|
||||
|
||||
/// 附加内容
|
||||
String? ext;
|
||||
/// 是否开启定期销毁
|
||||
bool? isMsgDestruct;
|
||||
|
||||
/// 定期销毁时间 s
|
||||
int? msgDestructTime;
|
||||
|
||||
/// 附加内容
|
||||
String? ex;
|
||||
@@ -78,7 +81,9 @@ class ConversationInfo {
|
||||
this.isPinned,
|
||||
this.isNotInGroup,
|
||||
this.ex,
|
||||
this.ext,
|
||||
this.groupAtType,
|
||||
this.isMsgDestruct,
|
||||
this.msgDestructTime,
|
||||
});
|
||||
|
||||
ConversationInfo.fromJson(Map<String, dynamic> json)
|
||||
@@ -106,7 +111,8 @@ class ConversationInfo {
|
||||
isNotInGroup = json['isNotInGroup'];
|
||||
groupAtType = json['groupAtType'];
|
||||
ex = json['ex'];
|
||||
ext = json['ext'];
|
||||
isMsgDestruct = json['isMsgDestruct'];
|
||||
msgDestructTime = json['msgDestructTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -129,7 +135,8 @@ class ConversationInfo {
|
||||
data['isNotInGroup'] = this.isNotInGroup;
|
||||
data['groupAtType'] = this.groupAtType;
|
||||
data['ex'] = this.ex;
|
||||
data['ext'] = this.ext;
|
||||
data['isMsgDestruct'] = this.isMsgDestruct;
|
||||
data['msgDestructTime'] = this.msgDestructTime;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,82 +23,131 @@ class MeetingInfoList {
|
||||
}
|
||||
|
||||
class MeetingInfo {
|
||||
String? meetingID;
|
||||
String? roomID;
|
||||
String? meetingName;
|
||||
String? ex;
|
||||
String? hostUserID;
|
||||
List<String>? inviteeUserIDList; //邀请列表
|
||||
int? createTime;
|
||||
int? startTime;
|
||||
int? endTime;
|
||||
bool? participantCanEnableVideo;
|
||||
bool? onlyHostInviteUser;
|
||||
bool? joinDisableVideo;
|
||||
bool? participantCanUnmuteSelf;
|
||||
bool? isMuteAllMicrophone;
|
||||
List<String>? inviteeUserIDList;
|
||||
bool? participantCanUnmuteSelf; //成员是否能自己解除禁言
|
||||
bool? participantCanEnableVideo; //成员是否能开启视频
|
||||
bool? onlyHostInviteUser; //仅主持人可邀请用户
|
||||
bool? onlyHostShareScreen; //仅主持人可共享屏幕
|
||||
bool? joinDisableMicrophone; //加入是否默认关麦克风
|
||||
bool? joinDisableVideo; //加入是否默认关视频
|
||||
bool? isMuteAllVideo; // 是否全员禁用视频
|
||||
bool? isMuteAllMicrophone; // 是否全员禁用麦克风
|
||||
List<String>? canScreenUserIDList; // 可共享屏幕的ID列表
|
||||
List<String>? disableMicrophoneUserIDList; // 当前被禁言麦克风的id列表
|
||||
List<String>? disableVideoUserIDList; // 当前禁用视频流的ID列表
|
||||
List<String>? pinedUserIDList; // 置顶ID列表
|
||||
List<String>? beWatchedUserIDList; // 正在被观看用户列表
|
||||
|
||||
MeetingInfo(
|
||||
{this.meetingID,
|
||||
this.meetingName,
|
||||
this.hostUserID,
|
||||
this.createTime,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.participantCanEnableVideo,
|
||||
this.onlyHostInviteUser,
|
||||
this.joinDisableVideo,
|
||||
this.participantCanUnmuteSelf,
|
||||
this.isMuteAllMicrophone,
|
||||
this.inviteeUserIDList});
|
||||
MeetingInfo({
|
||||
this.roomID,
|
||||
this.meetingName,
|
||||
this.ex,
|
||||
this.hostUserID,
|
||||
this.inviteeUserIDList,
|
||||
this.createTime,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.participantCanUnmuteSelf,
|
||||
this.participantCanEnableVideo,
|
||||
this.onlyHostInviteUser,
|
||||
this.onlyHostShareScreen,
|
||||
this.joinDisableMicrophone,
|
||||
this.joinDisableVideo,
|
||||
this.isMuteAllVideo,
|
||||
this.isMuteAllMicrophone,
|
||||
this.canScreenUserIDList,
|
||||
this.disableMicrophoneUserIDList,
|
||||
this.disableVideoUserIDList,
|
||||
this.pinedUserIDList,
|
||||
this.beWatchedUserIDList,
|
||||
});
|
||||
|
||||
MeetingInfo.fromJson(Map<String, dynamic> json) {
|
||||
meetingID = json['meetingID'];
|
||||
roomID = json['roomID'];
|
||||
meetingName = json['meetingName'];
|
||||
ex = json['ex'];
|
||||
hostUserID = json['hostUserID'];
|
||||
inviteeUserIDList = json['inviteeUserIDList'] == null
|
||||
? null
|
||||
: (json['inviteeUserIDList'] as List).cast<String>();
|
||||
createTime = json['createTime'];
|
||||
startTime = json['startTime'];
|
||||
endTime = json['endTime'];
|
||||
participantCanUnmuteSelf = json['participantCanUnmuteSelf'];
|
||||
participantCanEnableVideo = json['participantCanEnableVideo'];
|
||||
onlyHostInviteUser = json['onlyHostInviteUser'];
|
||||
onlyHostShareScreen = json['onlyHostShareScreen'];
|
||||
joinDisableMicrophone = json['joinDisableMicrophone'];
|
||||
joinDisableVideo = json['joinDisableVideo'];
|
||||
participantCanUnmuteSelf = json['participantCanUnmuteSelf'];
|
||||
isMuteAllVideo = json['isMuteAllVideo'];
|
||||
isMuteAllMicrophone = json['isMuteAllMicrophone'];
|
||||
inviteeUserIDList = json['inviteeUserIDList']?.cast<String>();
|
||||
canScreenUserIDList = json['canScreenUserIDList'] == null
|
||||
? null
|
||||
: (json['canScreenUserIDList'] as List).cast<String>();
|
||||
disableMicrophoneUserIDList = json['disableMicrophoneUserIDList'] == null
|
||||
? null
|
||||
: (json['disableMicrophoneUserIDList'] as List).cast<String>();
|
||||
disableVideoUserIDList = json['disableVideoUserIDList'] == null
|
||||
? null
|
||||
: (json['disableVideoUserIDList'] as List).cast<String>();
|
||||
pinedUserIDList = json['pinedUserIDList'] == null
|
||||
? null
|
||||
: (json['pinedUserIDList'] as List).cast<String>();
|
||||
beWatchedUserIDList = json['beWatchedUserIDList'] == null
|
||||
? null
|
||||
: (json['beWatchedUserIDList'] as List).cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['meetingID'] = this.meetingID;
|
||||
data['meetingName'] = this.meetingName;
|
||||
data['hostUserID'] = this.hostUserID;
|
||||
data['createTime'] = this.createTime;
|
||||
data['startTime'] = this.startTime;
|
||||
data['endTime'] = this.endTime;
|
||||
data['participantCanEnableVideo'] = this.participantCanEnableVideo;
|
||||
data['onlyHostInviteUser'] = this.onlyHostInviteUser;
|
||||
data['joinDisableVideo'] = this.joinDisableVideo;
|
||||
data['participantCanUnmuteSelf'] = this.participantCanUnmuteSelf;
|
||||
data['isMuteAllMicrophone'] = this.isMuteAllMicrophone;
|
||||
data['inviteeUserIDList'] = this.inviteeUserIDList;
|
||||
final data = <String, dynamic>{};
|
||||
data['roomID'] = roomID;
|
||||
data['meetingName'] = meetingName;
|
||||
data['ex'] = ex;
|
||||
data['hostUserID'] = hostUserID;
|
||||
data['inviteeUserIDList'] = inviteeUserIDList;
|
||||
data['createTime'] = createTime;
|
||||
data['startTime'] = startTime;
|
||||
data['endTime'] = endTime;
|
||||
data['participantCanUnmuteSelf'] = participantCanUnmuteSelf;
|
||||
data['participantCanEnableVideo'] = participantCanEnableVideo;
|
||||
data['onlyHostInviteUser'] = onlyHostInviteUser;
|
||||
data['onlyHostShareScreen'] = onlyHostShareScreen;
|
||||
data['joinDisableMicrophone'] = joinDisableMicrophone;
|
||||
data['joinDisableVideo'] = joinDisableVideo;
|
||||
data['isMuteAllVideo'] = isMuteAllVideo;
|
||||
data['isMuteAllMicrophone'] = isMuteAllMicrophone;
|
||||
data['canScreenUserIDList'] = canScreenUserIDList;
|
||||
data['disableMicrophoneUserIDList'] = disableMicrophoneUserIDList;
|
||||
data['disableVideoUserIDList'] = disableVideoUserIDList;
|
||||
data['pinedUserIDList'] = pinedUserIDList;
|
||||
data['beWatchedUserIDList'] = beWatchedUserIDList;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MeetingStreamEvent {
|
||||
String? meetingID;
|
||||
String? roomID;
|
||||
String? streamType;
|
||||
bool? mute;
|
||||
|
||||
MeetingStreamEvent({this.meetingID, this.streamType, this.mute});
|
||||
MeetingStreamEvent({this.roomID, this.streamType, this.mute});
|
||||
|
||||
MeetingStreamEvent.fromJson(Map<String, dynamic> json) {
|
||||
meetingID = json['meetingID'];
|
||||
roomID = json['roomID'];
|
||||
streamType = json['streamType'];
|
||||
mute = json['mute'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['meetingID'] = this.meetingID;
|
||||
data['roomID'] = this.roomID;
|
||||
data['streamType'] = this.streamType;
|
||||
data['mute'] = this.mute;
|
||||
return data;
|
||||
|
||||
@@ -31,7 +31,7 @@ class Message {
|
||||
int? contentType;
|
||||
|
||||
/// 平台[Platform]
|
||||
int? platformID;
|
||||
int? senderPlatformID;
|
||||
|
||||
/// 发送者昵称
|
||||
String? senderNickname;
|
||||
@@ -43,7 +43,7 @@ class Message {
|
||||
String? groupID;
|
||||
|
||||
/// 消息内容
|
||||
String? content;
|
||||
// String? content;
|
||||
|
||||
/// 消息的seq
|
||||
int? seq;
|
||||
@@ -57,6 +57,10 @@ class Message {
|
||||
/// 消息发送状态[MessageStatus]
|
||||
int? status;
|
||||
|
||||
bool? isReact;
|
||||
|
||||
bool? isExternalExtensions;
|
||||
|
||||
/// 离线显示内容
|
||||
OfflinePushInfo? offlinePush;
|
||||
|
||||
@@ -67,7 +71,7 @@ class Message {
|
||||
String? ex;
|
||||
|
||||
/// 自定义扩展信息,目前用于客服端处理消息时间分段
|
||||
dynamic ext;
|
||||
Map<String, dynamic> exMap = {};
|
||||
|
||||
/// 图片
|
||||
PictureElem? pictureElem;
|
||||
@@ -82,7 +86,7 @@ class Message {
|
||||
FileElem? fileElem;
|
||||
|
||||
/// @信息
|
||||
AtElem? atElem;
|
||||
AtTextElem? atTextElem;
|
||||
|
||||
/// 位置
|
||||
LocationElem? locationElem;
|
||||
@@ -105,9 +109,17 @@ class Message {
|
||||
/// 附加信息
|
||||
AttachedInfoElem? attachedInfoElem;
|
||||
|
||||
bool? isReact;
|
||||
/// 文本内容
|
||||
TextElem? textElem;
|
||||
|
||||
bool? isExternal;
|
||||
/// 个人名片
|
||||
CardElem? cardElem;
|
||||
|
||||
///
|
||||
AdvancedTextElem? advancedTextElem;
|
||||
|
||||
///
|
||||
TypingElem? typingElem;
|
||||
|
||||
Message({
|
||||
this.clientMsgID,
|
||||
@@ -119,11 +131,11 @@ class Message {
|
||||
this.recvID,
|
||||
this.msgFrom,
|
||||
this.contentType,
|
||||
this.platformID,
|
||||
this.senderPlatformID,
|
||||
this.senderNickname,
|
||||
this.senderFaceUrl,
|
||||
this.groupID,
|
||||
this.content,
|
||||
// this.content,
|
||||
this.seq,
|
||||
this.isRead,
|
||||
this.hasReadTime,
|
||||
@@ -131,12 +143,12 @@ class Message {
|
||||
this.offlinePush,
|
||||
this.attachedInfo,
|
||||
this.ex,
|
||||
this.ext,
|
||||
this.exMap = const <String, dynamic>{},
|
||||
this.pictureElem,
|
||||
this.soundElem,
|
||||
this.videoElem,
|
||||
this.fileElem,
|
||||
this.atElem,
|
||||
this.atTextElem,
|
||||
this.locationElem,
|
||||
this.customElem,
|
||||
this.quoteElem,
|
||||
@@ -144,8 +156,12 @@ class Message {
|
||||
this.notificationElem,
|
||||
this.faceElem,
|
||||
this.attachedInfoElem,
|
||||
this.isExternal,
|
||||
this.isExternalExtensions,
|
||||
this.isReact,
|
||||
this.textElem,
|
||||
this.cardElem,
|
||||
this.advancedTextElem,
|
||||
this.typingElem,
|
||||
});
|
||||
|
||||
Message.fromJson(Map<String, dynamic> json) {
|
||||
@@ -157,11 +173,11 @@ class Message {
|
||||
recvID = json['recvID'];
|
||||
msgFrom = json['msgFrom'];
|
||||
contentType = json['contentType'];
|
||||
platformID = json['platformID'];
|
||||
senderPlatformID = json['senderPlatformID'];
|
||||
senderNickname = json['senderNickname'];
|
||||
senderFaceUrl = json['senderFaceUrl'];
|
||||
groupID = json['groupID'];
|
||||
content = json['content'];
|
||||
// content = json['content'];
|
||||
seq = json['seq'];
|
||||
isRead = json['isRead'];
|
||||
status = json['status'];
|
||||
@@ -170,7 +186,7 @@ class Message {
|
||||
: null;
|
||||
attachedInfo = json['attachedInfo'];
|
||||
ex = json['ex'];
|
||||
ext = json['ext'];
|
||||
exMap = json['exMap'] ?? {};
|
||||
sessionType = json['sessionType'];
|
||||
pictureElem = json['pictureElem'] != null
|
||||
? PictureElem.fromJson(json['pictureElem'])
|
||||
@@ -183,7 +199,9 @@ class Message {
|
||||
: null;
|
||||
fileElem =
|
||||
json['fileElem'] != null ? FileElem.fromJson(json['fileElem']) : null;
|
||||
atElem = json['atElem'] != null ? AtElem.fromJson(json['atElem']) : null;
|
||||
atTextElem = json['atTextElem'] != null
|
||||
? AtTextElem.fromJson(json['atTextElem'])
|
||||
: null;
|
||||
locationElem = json['locationElem'] != null
|
||||
? LocationElem.fromJson(json['locationElem'])
|
||||
: null;
|
||||
@@ -206,8 +224,18 @@ class Message {
|
||||
? AttachedInfoElem.fromJson(json['attachedInfoElem'])
|
||||
: null;
|
||||
hasReadTime = json['hasReadTime'] ?? attachedInfoElem?.hasReadTime;
|
||||
isExternal = json['isExternal'];
|
||||
isExternalExtensions = json['isExternalExtensions'];
|
||||
isReact = json['isReact'];
|
||||
textElem =
|
||||
json['textElem'] != null ? TextElem.fromJson(json['textElem']) : null;
|
||||
cardElem =
|
||||
json['cardElem'] != null ? CardElem.fromJson(json['cardElem']) : null;
|
||||
advancedTextElem = json['advancedTextElem'] != null
|
||||
? AdvancedTextElem.fromJson(json['advancedTextElem'])
|
||||
: null;
|
||||
typingElem = json['typingElem'] != null
|
||||
? TypingElem.fromJson(json['typingElem'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -220,11 +248,11 @@ class Message {
|
||||
data['recvID'] = this.recvID;
|
||||
data['msgFrom'] = this.msgFrom;
|
||||
data['contentType'] = this.contentType;
|
||||
data['platformID'] = this.platformID;
|
||||
data['senderPlatformID'] = this.senderPlatformID;
|
||||
data['senderNickname'] = this.senderNickname;
|
||||
data['senderFaceUrl'] = this.senderFaceUrl;
|
||||
data['groupID'] = this.groupID;
|
||||
data['content'] = this.content;
|
||||
// data['content'] = this.content;
|
||||
data['seq'] = this.seq;
|
||||
data['isRead'] = this.isRead;
|
||||
data['hasReadTime'] = this.hasReadTime;
|
||||
@@ -232,13 +260,13 @@ class Message {
|
||||
data['offlinePush'] = this.offlinePush?.toJson();
|
||||
data['attachedInfo'] = this.attachedInfo;
|
||||
data['ex'] = this.ex;
|
||||
data['ext'] = this.ext;
|
||||
data['exMap'] = this.exMap;
|
||||
data['sessionType'] = this.sessionType;
|
||||
data['pictureElem'] = this.pictureElem?.toJson();
|
||||
data['soundElem'] = this.soundElem?.toJson();
|
||||
data['videoElem'] = this.videoElem?.toJson();
|
||||
data['fileElem'] = this.fileElem?.toJson();
|
||||
data['atElem'] = this.atElem?.toJson();
|
||||
data['atTextElem'] = this.atTextElem?.toJson();
|
||||
data['locationElem'] = this.locationElem?.toJson();
|
||||
data['customElem'] = this.customElem?.toJson();
|
||||
data['quoteElem'] = this.quoteElem?.toJson();
|
||||
@@ -246,8 +274,12 @@ class Message {
|
||||
data['notificationElem'] = this.notificationElem?.toJson();
|
||||
data['faceElem'] = this.faceElem?.toJson();
|
||||
data['attachedInfoElem'] = this.attachedInfoElem?.toJson();
|
||||
data['isExternal'] = this.isExternal;
|
||||
data['isExternalExtensions'] = this.isExternalExtensions;
|
||||
data['isReact'] = this.isReact;
|
||||
data['textElem'] = this.textElem?.toJson();
|
||||
data['cardElem'] = this.cardElem?.toJson();
|
||||
data['advancedTextElem'] = this.advancedTextElem?.toJson();
|
||||
data['typingElem'] = this.typingElem?.toJson();
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -270,11 +302,11 @@ class Message {
|
||||
recvID = message.recvID;
|
||||
msgFrom = message.msgFrom;
|
||||
contentType = message.contentType;
|
||||
platformID = message.platformID;
|
||||
senderPlatformID = message.senderPlatformID;
|
||||
senderNickname = message.senderNickname;
|
||||
senderFaceUrl = message.senderFaceUrl;
|
||||
groupID = message.groupID;
|
||||
content = message.content;
|
||||
// content = message.content;
|
||||
seq = message.seq;
|
||||
isRead = message.isRead;
|
||||
hasReadTime = message.hasReadTime;
|
||||
@@ -282,13 +314,13 @@ class Message {
|
||||
offlinePush = message.offlinePush;
|
||||
attachedInfo = message.attachedInfo;
|
||||
ex = message.ex;
|
||||
ext = message.ext;
|
||||
exMap = message.exMap;
|
||||
sessionType = message.sessionType;
|
||||
pictureElem = message.pictureElem;
|
||||
soundElem = message.soundElem;
|
||||
videoElem = message.videoElem;
|
||||
fileElem = message.fileElem;
|
||||
atElem = message.atElem;
|
||||
atTextElem = message.atTextElem;
|
||||
locationElem = message.locationElem;
|
||||
customElem = message.customElem;
|
||||
quoteElem = message.quoteElem;
|
||||
@@ -296,6 +328,10 @@ class Message {
|
||||
notificationElem = message.notificationElem;
|
||||
faceElem = message.faceElem;
|
||||
attachedInfoElem = message.attachedInfoElem;
|
||||
textElem = message.textElem;
|
||||
cardElem = message.cardElem;
|
||||
advancedTextElem = message.advancedTextElem;
|
||||
typingElem = message.typingElem;
|
||||
}
|
||||
|
||||
/// 单聊消息
|
||||
@@ -568,7 +604,7 @@ class FileElem {
|
||||
}
|
||||
|
||||
/// @消息内容
|
||||
class AtElem {
|
||||
class AtTextElem {
|
||||
/// 消息内容
|
||||
String? text;
|
||||
|
||||
@@ -584,7 +620,7 @@ class AtElem {
|
||||
/// 被回复的消息体,回复别人并@了人
|
||||
Message? quoteMessage;
|
||||
|
||||
AtElem({
|
||||
AtTextElem({
|
||||
this.text,
|
||||
this.atUserList,
|
||||
this.isAtSelf,
|
||||
@@ -592,7 +628,7 @@ class AtElem {
|
||||
this.quoteMessage,
|
||||
});
|
||||
|
||||
AtElem.fromJson(Map<String, dynamic> json) {
|
||||
AtTextElem.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'];
|
||||
if (json['atUserList'] is List) {
|
||||
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
|
||||
@@ -836,6 +872,115 @@ class AttachedInfoElem {
|
||||
}
|
||||
}
|
||||
|
||||
class TextElem {
|
||||
String? content;
|
||||
|
||||
TextElem({this.content});
|
||||
|
||||
TextElem.fromJson(Map<String, dynamic> json) {
|
||||
content = json['content'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['content'] = content;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CardElem {
|
||||
String? userID;
|
||||
String? nickname;
|
||||
String? faceURL;
|
||||
String? ex;
|
||||
|
||||
CardElem({this.userID, this.nickname, this.faceURL, this.ex});
|
||||
|
||||
CardElem.fromJson(Map<String, dynamic> json) {
|
||||
userID = json['userID'];
|
||||
nickname = json['nickname'];
|
||||
faceURL = json['faceURL'];
|
||||
ex = json['ex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['userID'] = userID;
|
||||
data['nickname'] = nickname;
|
||||
data['faceURL'] = faceURL;
|
||||
data['ex'] = ex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TypingElem {
|
||||
String? msgTips;
|
||||
|
||||
TypingElem({this.msgTips});
|
||||
|
||||
TypingElem.fromJson(Map<String, dynamic> json) {
|
||||
msgTips = json['msgTips'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['msgTips'] = msgTips;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class AdvancedTextElem {
|
||||
String? text;
|
||||
List<MessageEntity>? messageEntityList;
|
||||
|
||||
AdvancedTextElem({this.text, this.messageEntityList});
|
||||
|
||||
AdvancedTextElem.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'];
|
||||
messageEntityList = json['messageEntityList'] == null
|
||||
? null
|
||||
: (json['messageEntityList'] as List)
|
||||
.map((e) => MessageEntity.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['text'] = text;
|
||||
data['messageEntityList'] =
|
||||
messageEntityList?.map((e) => e.toJson()).toList();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class MessageEntity {
|
||||
String? type;
|
||||
int? offset;
|
||||
int? length;
|
||||
String? url;
|
||||
String? ex;
|
||||
|
||||
MessageEntity({this.type, this.offset, this.length, this.url, this.ex});
|
||||
|
||||
MessageEntity.fromJson(Map<String, dynamic> json) {
|
||||
type = json['type'];
|
||||
offset = json['offset'];
|
||||
length = json['length'];
|
||||
url = json['url'];
|
||||
ex = json['ex'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['type'] = type;
|
||||
data['offset'] = offset;
|
||||
data['length'] = length;
|
||||
data['url'] = url;
|
||||
data['ex'] = ex;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 群消息已读信息
|
||||
class GroupHasReadInfo {
|
||||
/// 已读的用户id列表
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
/// 部门信息
|
||||
class DeptInfo {
|
||||
/// 部门id
|
||||
String? departmentID;
|
||||
|
||||
/// 头像
|
||||
String? faceURL;
|
||||
|
||||
/// 显示名
|
||||
String? name;
|
||||
|
||||
/// 上一级部门id
|
||||
String? parentID;
|
||||
|
||||
/// 排序方式
|
||||
int? order;
|
||||
|
||||
/// 部门类型
|
||||
int? departmentType;
|
||||
|
||||
/// 创建时间
|
||||
int? createTime;
|
||||
|
||||
/// 子部门数量
|
||||
int? subDepartmentNum;
|
||||
|
||||
/// 成员数量
|
||||
int? memberNum;
|
||||
|
||||
/// 扩展字段
|
||||
String? ex;
|
||||
|
||||
/// 附加信息
|
||||
String? attachedInfo;
|
||||
|
||||
String? relatedGroupID;
|
||||
|
||||
DeptInfo(
|
||||
{this.departmentID,
|
||||
this.faceURL,
|
||||
this.name,
|
||||
this.parentID,
|
||||
this.order,
|
||||
this.departmentType,
|
||||
this.createTime,
|
||||
this.subDepartmentNum,
|
||||
this.memberNum,
|
||||
this.ex,
|
||||
this.attachedInfo,
|
||||
this.relatedGroupID});
|
||||
|
||||
DeptInfo.fromJson(Map<String, dynamic> json) {
|
||||
departmentID = json['departmentID'];
|
||||
faceURL = json['faceURL'];
|
||||
name = json['name'];
|
||||
parentID = json['parentID'];
|
||||
order = json['order'];
|
||||
departmentType = json['departmentType'];
|
||||
createTime = json['createTime'];
|
||||
subDepartmentNum = json['subDepartmentNum'];
|
||||
memberNum = json['memberNum'];
|
||||
ex = json['ex'];
|
||||
attachedInfo = json['attachedInfo'];
|
||||
relatedGroupID = json['relatedGroupID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['departmentID'] = this.departmentID;
|
||||
data['faceURL'] = this.faceURL;
|
||||
data['name'] = this.name;
|
||||
data['parentID'] = this.parentID;
|
||||
data['order'] = this.order;
|
||||
data['departmentType'] = this.departmentType;
|
||||
data['createTime'] = this.createTime;
|
||||
data['subDepartmentNum'] = this.subDepartmentNum;
|
||||
data['memberNum'] = this.memberNum;
|
||||
data['ex'] = this.ex;
|
||||
data['attachedInfo'] = this.attachedInfo;
|
||||
data['relatedGroupID'] = this.relatedGroupID;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is DeptInfo &&
|
||||
runtimeType == other.runtimeType &&
|
||||
departmentID == other.departmentID;
|
||||
|
||||
@override
|
||||
int get hashCode => departmentID.hashCode;
|
||||
}
|
||||
|
||||
/// 部门成员信息
|
||||
class DeptMemberInfo {
|
||||
/// 用户id
|
||||
String? userID;
|
||||
|
||||
/// 用户昵称
|
||||
String? nickname;
|
||||
|
||||
/// 英文名
|
||||
String? englishName;
|
||||
|
||||
/// 头像
|
||||
String? faceURL;
|
||||
|
||||
/// 性别
|
||||
int? gender;
|
||||
|
||||
/// 手机号
|
||||
String? mobile;
|
||||
|
||||
/// 座机
|
||||
String? telephone;
|
||||
|
||||
/// 出生时间
|
||||
int? birth;
|
||||
|
||||
/// 邮箱
|
||||
String? email;
|
||||
|
||||
/// 所在部门的id
|
||||
String? departmentID;
|
||||
|
||||
/// 排序方式
|
||||
int? order;
|
||||
|
||||
/// 职位
|
||||
String? position;
|
||||
|
||||
/// 是否是领导
|
||||
int? leader;
|
||||
|
||||
/// 状态
|
||||
int? status;
|
||||
|
||||
/// 创建时间
|
||||
int? createTime;
|
||||
|
||||
/// 入职时间
|
||||
int? entryTime;
|
||||
|
||||
/// 离职时间
|
||||
int? terminationTime;
|
||||
|
||||
/// 扩展字段
|
||||
String? ex;
|
||||
|
||||
/// 附加信息
|
||||
String? attachedInfo;
|
||||
|
||||
/// 搜索时使用
|
||||
String? departmentName;
|
||||
|
||||
/// 所在部门的所有上级部门
|
||||
List<DeptInfo>? parentDepartmentList;
|
||||
|
||||
/// 当前部门信息
|
||||
DeptInfo? department;
|
||||
|
||||
DeptMemberInfo({
|
||||
this.userID,
|
||||
this.nickname,
|
||||
this.englishName,
|
||||
this.faceURL,
|
||||
this.gender,
|
||||
this.mobile,
|
||||
this.telephone,
|
||||
this.birth,
|
||||
this.email,
|
||||
this.departmentID,
|
||||
this.order,
|
||||
this.position,
|
||||
this.leader,
|
||||
this.status,
|
||||
this.createTime,
|
||||
this.ex,
|
||||
this.attachedInfo,
|
||||
this.departmentName,
|
||||
this.parentDepartmentList,
|
||||
this.department,
|
||||
});
|
||||
|
||||
DeptMemberInfo.fromJson(Map<String, dynamic> json) {
|
||||
userID = json['userID'];
|
||||
nickname = json['nickname'];
|
||||
englishName = json['englishName'];
|
||||
faceURL = json['faceURL'];
|
||||
gender = json['gender'];
|
||||
mobile = json['mobile'];
|
||||
telephone = json['telephone'];
|
||||
birth = json['birth'];
|
||||
email = json['email'];
|
||||
departmentID = json['departmentID'];
|
||||
order = json['order'];
|
||||
position = json['position'];
|
||||
leader = json['leader'];
|
||||
status = json['status'];
|
||||
createTime = json['createTime'];
|
||||
ex = json['ex'];
|
||||
attachedInfo = json['attachedInfo'];
|
||||
departmentName = json['departmentName'];
|
||||
if (json['parentDepartmentList'] != null) {
|
||||
parentDepartmentList = <DeptInfo>[];
|
||||
json['parentDepartmentList'].forEach((v) {
|
||||
parentDepartmentList!.add(DeptInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
department = json['department'] == null
|
||||
? null
|
||||
: DeptInfo.fromJson(json['department']);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['userID'] = this.userID;
|
||||
data['nickname'] = this.nickname;
|
||||
data['englishName'] = this.englishName;
|
||||
data['faceURL'] = this.faceURL;
|
||||
data['gender'] = this.gender;
|
||||
data['mobile'] = this.mobile;
|
||||
data['telephone'] = this.telephone;
|
||||
data['birth'] = this.birth;
|
||||
data['email'] = this.email;
|
||||
data['departmentID'] = this.departmentID;
|
||||
data['order'] = this.order;
|
||||
data['position'] = this.position;
|
||||
data['leader'] = this.leader;
|
||||
data['status'] = this.status;
|
||||
data['createTime'] = this.createTime;
|
||||
data['ex'] = this.ex;
|
||||
data['attachedInfo'] = this.attachedInfo;
|
||||
data['departmentName'] = this.departmentName;
|
||||
if (this.parentDepartmentList != null) {
|
||||
data['parentDepartmentList'] =
|
||||
this.parentDepartmentList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['department'] = this.department?.toJson();
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is DeptMemberInfo &&
|
||||
runtimeType == other.runtimeType &&
|
||||
userID == other.userID;
|
||||
|
||||
@override
|
||||
int get hashCode => userID.hashCode;
|
||||
}
|
||||
|
||||
/// 用户所在的部门
|
||||
class UserInDept {
|
||||
/// 部门信息
|
||||
DeptInfo? department;
|
||||
|
||||
/// 所在部门自己的信息
|
||||
DeptMemberInfo? member;
|
||||
|
||||
UserInDept({this.department, this.member});
|
||||
|
||||
UserInDept.fromJson(Map<String, dynamic> json) {
|
||||
department = json['department'] != null
|
||||
? DeptInfo.fromJson(json['department'])
|
||||
: null;
|
||||
member =
|
||||
json['member'] != null ? DeptMemberInfo.fromJson(json['member']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.department != null) {
|
||||
data['department'] = this.department!.toJson();
|
||||
}
|
||||
if (this.member != null) {
|
||||
data['member'] = this.member!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 部门下的一级子部门跟员工
|
||||
class DeptMemberAndSubDept {
|
||||
/// 一级子部门
|
||||
List<DeptInfo>? departmentList;
|
||||
|
||||
/// 一级成员
|
||||
List<DeptMemberInfo>? departmentMemberList;
|
||||
|
||||
/// 当前部门的所有上一级部门
|
||||
List<DeptInfo>? parentDepartmentList;
|
||||
|
||||
DeptMemberAndSubDept({
|
||||
this.departmentList,
|
||||
this.departmentMemberList,
|
||||
this.parentDepartmentList,
|
||||
});
|
||||
|
||||
DeptMemberAndSubDept.fromJson(Map<String, dynamic> json) {
|
||||
if (json['departmentList'] != null) {
|
||||
departmentList = <DeptInfo>[];
|
||||
json['departmentList'].forEach((v) {
|
||||
departmentList!.add(DeptInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['departmentMemberList'] != null) {
|
||||
departmentMemberList = <DeptMemberInfo>[];
|
||||
json['departmentMemberList'].forEach((v) {
|
||||
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['parentDepartmentList'] != null) {
|
||||
parentDepartmentList = <DeptInfo>[];
|
||||
json['parentDepartmentList'].forEach((v) {
|
||||
parentDepartmentList!.add(DeptInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.departmentList != null) {
|
||||
data['departmentList'] =
|
||||
this.departmentList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.departmentMemberList != null) {
|
||||
data['departmentMemberList'] =
|
||||
this.departmentMemberList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.parentDepartmentList != null) {
|
||||
data['parentDepartmentList'] =
|
||||
this.parentDepartmentList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 搜索结果
|
||||
class OrganizationSearchResult {
|
||||
/// 部门列表
|
||||
List<DeptInfo>? departmentList;
|
||||
|
||||
/// 部门成员列表
|
||||
List<DeptMemberInfo>? departmentMemberList;
|
||||
|
||||
OrganizationSearchResult({
|
||||
this.departmentList,
|
||||
this.departmentMemberList,
|
||||
});
|
||||
|
||||
OrganizationSearchResult.fromJson(Map<String, dynamic> json) {
|
||||
if (json['departmentList'] != null) {
|
||||
departmentList = <DeptInfo>[];
|
||||
json['departmentList'].forEach((v) {
|
||||
departmentList!.add(DeptInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['departmentMemberList'] != null) {
|
||||
departmentMemberList = <DeptMemberInfo>[];
|
||||
json['departmentMemberList'].forEach((v) {
|
||||
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.departmentList != null) {
|
||||
data['departmentList'] =
|
||||
this.departmentList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.departmentMemberList != null) {
|
||||
data['departmentMemberList'] =
|
||||
this.departmentMemberList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class SignalingInfo {
|
||||
/// 操作者
|
||||
String? opUserID;
|
||||
|
||||
/// 邀请信息
|
||||
InvitationInfo? invitation;
|
||||
|
||||
/// 离线显示内容
|
||||
OfflinePushInfo? offlinePushInfo;
|
||||
|
||||
SignalingInfo({
|
||||
this.opUserID,
|
||||
this.invitation,
|
||||
this.offlinePushInfo,
|
||||
});
|
||||
|
||||
SignalingInfo.fromJson(Map<String, dynamic> json) {
|
||||
opUserID = json['opUserID'];
|
||||
invitation = json['invitation'] == null
|
||||
? null
|
||||
: InvitationInfo.fromJson(json['invitation']);
|
||||
offlinePushInfo = json['offlinePushInfo'] == null
|
||||
? null
|
||||
: OfflinePushInfo.fromJson(json['offlinePushInfo']);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['opUserID'] = this.opUserID;
|
||||
data['invitation'] = this.invitation?.toJson();
|
||||
data['offlinePushInfo'] = this.offlinePushInfo?.toJson();
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class InvitationInfo {
|
||||
/// 邀请者UserID
|
||||
String? inviterUserID;
|
||||
|
||||
/// 被邀请者UserID列表,如果是单聊只有一个元素
|
||||
List<String>? inviteeUserIDList;
|
||||
|
||||
/// 如果是单聊,为""
|
||||
String? groupID;
|
||||
|
||||
/// 房间ID,必须唯一,可以不设置。
|
||||
String? roomID;
|
||||
|
||||
/// 邀请超时时间(秒)
|
||||
int? timeout;
|
||||
|
||||
/// 发起时间
|
||||
int? initiateTime;
|
||||
|
||||
/// video 或者 audio
|
||||
String? mediaType;
|
||||
|
||||
/// [ConversationType]1为单聊,2为群聊
|
||||
int? sessionType;
|
||||
|
||||
/// 平台[Platform]
|
||||
int? platformID;
|
||||
|
||||
InvitationInfo(
|
||||
{this.inviterUserID,
|
||||
this.inviteeUserIDList,
|
||||
this.groupID,
|
||||
this.roomID,
|
||||
this.timeout,
|
||||
this.initiateTime,
|
||||
this.mediaType,
|
||||
this.sessionType,
|
||||
this.platformID});
|
||||
|
||||
InvitationInfo.fromJson(Map<String, dynamic> json) {
|
||||
inviterUserID = json['inviterUserID'];
|
||||
inviteeUserIDList = json['inviteeUserIDList'].cast<String>();
|
||||
groupID = json['groupID'];
|
||||
roomID = json['roomID'];
|
||||
timeout = json['timeout'];
|
||||
initiateTime = json['initiateTime'];
|
||||
mediaType = json['mediaType'];
|
||||
sessionType = json['sessionType'];
|
||||
platformID = json['platformID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['inviterUserID'] = this.inviterUserID;
|
||||
data['inviteeUserIDList'] = this.inviteeUserIDList;
|
||||
data['groupID'] = this.groupID;
|
||||
data['roomID'] = this.roomID;
|
||||
data['timeout'] = this.timeout;
|
||||
data['initiateTime'] = this.initiateTime;
|
||||
data['mediaType'] = this.mediaType;
|
||||
data['sessionType'] = this.sessionType;
|
||||
data['platformID'] = this.platformID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// 信令凭证
|
||||
class SignalingCertificate {
|
||||
/// 登录token
|
||||
String? token;
|
||||
|
||||
/// 房间id
|
||||
String? roomID;
|
||||
|
||||
/// 服务器地址
|
||||
String? liveURL;
|
||||
|
||||
/// 占线列表
|
||||
List<String>? busyLineUserIDList;
|
||||
|
||||
SignalingCertificate({
|
||||
this.token,
|
||||
this.roomID,
|
||||
this.liveURL,
|
||||
this.busyLineUserIDList,
|
||||
});
|
||||
|
||||
SignalingCertificate.fromJson(Map<String, dynamic> json) {
|
||||
token = json['token'];
|
||||
roomID = json['roomID'];
|
||||
liveURL = json['liveURL'];
|
||||
busyLineUserIDList = null == json['busyLineUserIDList']
|
||||
? null
|
||||
: json['busyLineUserIDList'].cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['token'] = this.token;
|
||||
data['roomID'] = this.roomID;
|
||||
data['liveURL'] = this.liveURL;
|
||||
data['busyLineUserIDList'] = this.busyLineUserIDList;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class RoomCallingInfo {
|
||||
InvitationInfo? invitation;
|
||||
List<Participant>? participant;
|
||||
String? roomID;
|
||||
String? token;
|
||||
String? liveURL;
|
||||
String? groupID;
|
||||
|
||||
RoomCallingInfo({
|
||||
this.invitation,
|
||||
this.participant,
|
||||
this.roomID,
|
||||
this.token,
|
||||
this.liveURL,
|
||||
this.groupID,
|
||||
});
|
||||
|
||||
RoomCallingInfo.fromJson(Map<String, dynamic> json) {
|
||||
invitation = json['invitation'] != null
|
||||
? InvitationInfo.fromJson(json['invitation'])
|
||||
: null;
|
||||
if (json['participant'] != null) {
|
||||
participant = <Participant>[];
|
||||
json['participant'].forEach((v) {
|
||||
participant!.add(Participant.fromJson(v));
|
||||
});
|
||||
}
|
||||
roomID = json['roomID'] ?? invitation?.roomID;
|
||||
token = json['token'];
|
||||
liveURL = json['liveURL'];
|
||||
groupID = json['groupID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.invitation != null) {
|
||||
data['invitation'] = this.invitation!.toJson();
|
||||
}
|
||||
if (this.participant != null) {
|
||||
data['participant'] = this.participant!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['roomID'] = this.roomID;
|
||||
data['token'] = this.token;
|
||||
data['liveURL'] = this.liveURL;
|
||||
data['groupID'] = this.groupID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Participant {
|
||||
GroupInfo? groupInfo;
|
||||
GroupMembersInfo? groupMemberInfo;
|
||||
UserInfo? userInfo;
|
||||
|
||||
Participant({this.groupInfo, this.groupMemberInfo, this.userInfo});
|
||||
|
||||
Participant.fromJson(Map<String, dynamic> json) {
|
||||
groupInfo = json['groupInfo'] != null
|
||||
? GroupInfo.fromJson(json['groupInfo'])
|
||||
: null;
|
||||
groupMemberInfo = json['groupMemberInfo'] != null
|
||||
? GroupMembersInfo.fromJson(json['groupMemberInfo'])
|
||||
: null;
|
||||
userInfo =
|
||||
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
if (this.groupInfo != null) {
|
||||
data['groupInfo'] = this.groupInfo!.toJson();
|
||||
}
|
||||
if (this.groupMemberInfo != null) {
|
||||
data['groupMemberInfo'] = this.groupMemberInfo!.toJson();
|
||||
}
|
||||
if (this.userInfo != null) {
|
||||
data['userInfo'] = this.userInfo!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class CustomSignaling {
|
||||
String? roomID;
|
||||
String? customInfo;
|
||||
|
||||
CustomSignaling({this.roomID, this.customInfo});
|
||||
|
||||
CustomSignaling.fromJson(Map<String, dynamic> json) {
|
||||
roomID = json['roomID'];
|
||||
customInfo = json['customInfo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['roomID'] = roomID;
|
||||
data['customInfo'] = customInfo;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,8 @@ class UserInfo {
|
||||
/// 手机号
|
||||
String? phoneNumber;
|
||||
|
||||
/// 使用[birthTime]
|
||||
int? birth;
|
||||
|
||||
/// 出生时间
|
||||
String? birthTime;
|
||||
int? birth;
|
||||
|
||||
/// 邮箱
|
||||
String? email;
|
||||
@@ -38,21 +35,6 @@ class UserInfo {
|
||||
/// 备注
|
||||
String? remark;
|
||||
|
||||
/// 用户公开的资料
|
||||
PublicUserInfo? publicInfo;
|
||||
|
||||
/// 好友才能查看的资料
|
||||
FriendInfo? friendInfo;
|
||||
|
||||
/// 黑名单资料
|
||||
BlacklistInfo? blackInfo;
|
||||
|
||||
/// 是否好友关系
|
||||
bool? isFriendship;
|
||||
|
||||
/// 是否黑名单
|
||||
bool? isBlacklist;
|
||||
|
||||
/// 全局免打扰 0:正常;1:不接受消息;2:接受在线消息不接受离线消息;
|
||||
int? globalRecvMsgOpt;
|
||||
|
||||
@@ -68,6 +50,21 @@ class UserInfo {
|
||||
/// 禁止登录
|
||||
int? forbidden;
|
||||
|
||||
/// 用户公开的资料
|
||||
PublicUserInfo? publicInfo;
|
||||
|
||||
/// 好友才能查看的资料
|
||||
FriendInfo? friendInfo;
|
||||
|
||||
/// 黑名单资料
|
||||
BlacklistInfo? blackInfo;
|
||||
|
||||
/// 是否好友关系
|
||||
bool? isFriendship;
|
||||
|
||||
/// 是否黑名单
|
||||
bool? isBlacklist;
|
||||
|
||||
UserInfo({
|
||||
this.publicInfo,
|
||||
this.friendInfo,
|
||||
@@ -80,7 +77,6 @@ class UserInfo {
|
||||
this.faceURL,
|
||||
this.phoneNumber,
|
||||
this.birth,
|
||||
this.birthTime,
|
||||
this.gender,
|
||||
this.email,
|
||||
this.ex,
|
||||
@@ -106,15 +102,9 @@ class UserInfo {
|
||||
// }
|
||||
|
||||
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;
|
||||
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;
|
||||
@@ -125,7 +115,6 @@ class UserInfo {
|
||||
gender = json['gender'] ?? _gender;
|
||||
phoneNumber = json['phoneNumber'] ?? _phoneNumber;
|
||||
birth = json['birth'] ?? _birth;
|
||||
birthTime = json['birthTime'] ?? _birthTime;
|
||||
email = json['email'] ?? _email;
|
||||
remark = json['remark'] ?? _remark;
|
||||
ex = json['ex'] ?? _ex;
|
||||
@@ -151,7 +140,6 @@ class UserInfo {
|
||||
data['gender'] = this.gender;
|
||||
data['phoneNumber'] = this.phoneNumber;
|
||||
data['birth'] = this.birth;
|
||||
data['birthTime'] = this.birthTime;
|
||||
data['email'] = this.email;
|
||||
data['ex'] = this.ex;
|
||||
data['createTime'] = this.createTime;
|
||||
@@ -170,32 +158,22 @@ class UserInfo {
|
||||
|
||||
bool get isMale => gender == 1;
|
||||
|
||||
String get _userID => isFriendship!
|
||||
? friendInfo!.userID!
|
||||
: (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
|
||||
String get _userID => isFriendship! ? friendInfo!.userID! : (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
|
||||
|
||||
String? get _nickname => isFriendship!
|
||||
? friendInfo?.nickname
|
||||
: (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
|
||||
String? get _nickname =>
|
||||
isFriendship! ? friendInfo?.nickname : (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
|
||||
|
||||
String? get _faceUrl => isFriendship!
|
||||
? friendInfo?.faceURL
|
||||
: (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
|
||||
String? get _faceUrl =>
|
||||
isFriendship! ? friendInfo?.faceURL : (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
|
||||
|
||||
int? get _gender => isFriendship!
|
||||
? friendInfo?.gender
|
||||
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
||||
int? get _gender => isFriendship! ? friendInfo?.gender : (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
||||
|
||||
String? get _ex => isFriendship!
|
||||
? friendInfo?.ex
|
||||
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
|
||||
String? get _ex => isFriendship! ? friendInfo?.ex : (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
|
||||
|
||||
String? get _phoneNumber => friendInfo?.phoneNumber;
|
||||
|
||||
int? get _birth => friendInfo?.birth;
|
||||
|
||||
String? get _birthTime => friendInfo?.birthTime;
|
||||
|
||||
String? get _email => friendInfo?.email;
|
||||
|
||||
String? get _remark => friendInfo?.remark;
|
||||
@@ -209,10 +187,7 @@ class UserInfo {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is UserInfo &&
|
||||
runtimeType == other.runtimeType &&
|
||||
userID == other.userID;
|
||||
identical(this, other) || other is UserInfo && runtimeType == other.runtimeType && userID == other.userID;
|
||||
|
||||
@override
|
||||
int get hashCode => userID.hashCode;
|
||||
@@ -286,9 +261,6 @@ class FriendInfo {
|
||||
String? phoneNumber;
|
||||
|
||||
/// 出生日期
|
||||
String? birthTime;
|
||||
|
||||
/// 使用[birthTime]
|
||||
int? birth;
|
||||
|
||||
/// 邮箱
|
||||
@@ -316,7 +288,6 @@ class FriendInfo {
|
||||
this.gender,
|
||||
this.phoneNumber,
|
||||
this.birth,
|
||||
this.birthTime,
|
||||
this.email,
|
||||
this.remark,
|
||||
this.ex,
|
||||
@@ -337,7 +308,6 @@ class FriendInfo {
|
||||
gender = json['gender'];
|
||||
phoneNumber = json['phoneNumber'];
|
||||
birth = json['birth'];
|
||||
birthTime = json['birthTime'];
|
||||
email = json['email'];
|
||||
ex = json['ex'];
|
||||
}
|
||||
@@ -355,7 +325,6 @@ class FriendInfo {
|
||||
data['gender'] = this.gender;
|
||||
data['phoneNumber'] = this.phoneNumber;
|
||||
data['birth'] = this.birth;
|
||||
data['birthTime'] = this.birthTime;
|
||||
data['email'] = this.email;
|
||||
data['ex'] = this.ex;
|
||||
return data;
|
||||
@@ -565,3 +534,34 @@ class FriendApplicationInfo {
|
||||
/// 已拒绝
|
||||
bool get isRejected => handleResult == -1;
|
||||
}
|
||||
|
||||
class UserStatusInfo {
|
||||
/// 用户id
|
||||
String? userID;
|
||||
|
||||
/// 状态
|
||||
int? status;
|
||||
|
||||
/// 平台ID
|
||||
List<int>? platformIDs;
|
||||
|
||||
UserStatusInfo({
|
||||
this.userID,
|
||||
this.status,
|
||||
this.platformIDs,
|
||||
});
|
||||
|
||||
UserStatusInfo.fromJson(Map<String, dynamic> json) {
|
||||
userID = json['userID'];
|
||||
status = json['status'];
|
||||
platformIDs = json["platformIDs"] == null ? [] : List<int>.from(json["platformIDs"].map((x) => x));
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = Map<String, dynamic>();
|
||||
data['userID'] = this.userID;
|
||||
data['status'] = this.status;
|
||||
data['platformIDs'] = List<dynamic>.from(platformIDs!.map((x) => x));
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
class WorkMomentsInfo {
|
||||
int? notificationMsgType;
|
||||
String? replyUserName;
|
||||
String? replyUserID;
|
||||
String? content;
|
||||
String? contentID;
|
||||
String? workMomentID;
|
||||
String? userID;
|
||||
String? userName;
|
||||
String? faceURL;
|
||||
String? workMomentContent;
|
||||
int? createTime;
|
||||
|
||||
WorkMomentsInfo(
|
||||
{this.notificationMsgType,
|
||||
this.replyUserName,
|
||||
this.replyUserID,
|
||||
this.content,
|
||||
this.contentID,
|
||||
this.workMomentID,
|
||||
this.userID,
|
||||
this.userName,
|
||||
this.faceURL,
|
||||
this.workMomentContent,
|
||||
this.createTime});
|
||||
|
||||
WorkMomentsInfo.fromJson(Map<String, dynamic> json) {
|
||||
notificationMsgType = json['notificationMsgType'];
|
||||
replyUserName = json['replyUserName'];
|
||||
replyUserID = json['replyUserID'];
|
||||
content = json['content'];
|
||||
contentID = json['contentID'];
|
||||
workMomentID = json['workMomentID'];
|
||||
userID = json['userID'];
|
||||
userName = json['userName'];
|
||||
faceURL = json['faceURL'];
|
||||
workMomentContent = json['workMomentContent'];
|
||||
createTime = json['createTime'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['notificationMsgType'] = this.notificationMsgType;
|
||||
data['replyUserName'] = this.replyUserName;
|
||||
data['replyUserID'] = this.replyUserID;
|
||||
data['content'] = this.content;
|
||||
data['contentID'] = this.contentID;
|
||||
data['workMomentID'] = this.workMomentID;
|
||||
data['userID'] = this.userID;
|
||||
data['userName'] = this.userName;
|
||||
data['faceURL'] = this.faceURL;
|
||||
data['workMomentContent'] = this.workMomentContent;
|
||||
data['createTime'] = this.createTime;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OpenIM {
|
||||
static const version = '2.3.5+3';
|
||||
static const version = '3.3.0';
|
||||
|
||||
static const _channel = const MethodChannel('flutter_openim_sdk');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: flutter_openim_sdk
|
||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||
version: 2.3.5+3
|
||||
version: 3.3.0
|
||||
homepage: https://www.rentsoft.cn
|
||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user