fix: Bug fixes and performance enhancements.

main 3.8.0-rc.16
Brett 9 months ago
parent 43d3f05d4d
commit ff25636516
  1. 6
      CHANGELOG.md
  2. 2
      android/build.gradle
  3. 5
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConnListener.java
  4. 20
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConversationListener.java
  5. 15
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnUserListener.java
  6. 9
      android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java
  7. 17
      android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java
  8. 16
      example/android/build.gradle
  9. 2
      example/android/gradle/wrapper/gradle-wrapper.properties
  10. 8
      example/lib/main.dart
  11. 58
      example/pubspec.lock
  12. 31
      ios/Classes/Module/ConversationManager.swift
  13. 5
      ios/Classes/Module/FriendshipManager.swift
  14. 11
      ios/Classes/Module/GroupManager.swift
  15. 4
      ios/Classes/Module/IMManager.swift
  16. 20
      ios/Classes/Module/UserManager.swift
  17. 4
      ios/flutter_openim_sdk.podspec
  18. 10
      lib/src/manager/im_friendship_manager.dart
  19. 24
      lib/src/manager/im_group_manager.dart
  20. 2
      lib/src/openim.dart
  21. 4
      pubspec.yaml

@ -1,7 +1,11 @@
## 3.8.0-rc.16
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0-rc.16)
-
## 3.5.1 ## 3.5.1
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1) - [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1)
## 3.5.1-alpha.7 ## 3.5.1-alpha.7
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.7) - [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.7)

@ -52,5 +52,5 @@ android {
dependencies { dependencies {
// aar复制到libs/io/openim/core-sdk/0.0.1/ core-sdk-0.0.1.aar // aar复制到libs/io/openim/core-sdk/0.0.1/ core-sdk-0.0.1.aar
// implementation 'io.openim:core-sdk:0.0.1@aar' // implementation 'io.openim:core-sdk:0.0.1@aar'
implementation 'io.openim:core-sdk:3.5.1@aar' implementation 'io.openim:core-sdk:3.8.0-rc.16@aar'
} }

@ -31,4 +31,9 @@ public class OnConnListener implements open_im_sdk_callback.OnConnListener {
public void onUserTokenExpired() { public void onUserTokenExpired() {
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null); CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
} }
@Override
public void onUserTokenInvalid(String s) {
CommonUtil.emitEvent("connectListener", "onUserTokenInvalid", s);
}
} }

@ -2,7 +2,6 @@ package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil; import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener { public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
@Override @Override
@ -21,22 +20,27 @@ public class OnConversationListener implements open_im_sdk_callback.OnConversati
} }
@Override @Override
public void onSyncServerFailed() { public void onSyncServerFailed(boolean reinstalled) {
CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", null); CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", reinstalled);
}
@Override
public void onSyncServerFinish(boolean reinstalled) {
CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", reinstalled);
} }
@Override @Override
public void onSyncServerFinish() { public void onSyncServerStart(boolean reinstalled) {
CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", null); CommonUtil.emitEvent("conversationListener", "onSyncServerStart", reinstalled);
} }
@Override @Override
public void onSyncServerStart() { public void onSyncServerProgress(long progress) {
CommonUtil.emitEvent("conversationListener", "onSyncServerStart", null); CommonUtil.emitEvent("conversationListener", "onSyncServerProgress", progress);
} }
@Override @Override
public void onTotalUnreadMessageCountChanged(int i) { public void onTotalUnreadMessageCountChanged(int i) {
CommonUtil.emitEvent("conversationListener", "onTotalUnreadMessageCountChanged", i); CommonUtil.emitEvent("conversationListener", "onTotalUnreadMessageCountChanged", i);
} }
} }

@ -13,4 +13,19 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
public void onUserStatusChanged(String s) { public void onUserStatusChanged(String s) {
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s); CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
} }
@Override
public void onUserCommandAdd(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandAdd", s);
}
@Override
public void onUserCommandDelete(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandDelete", s);
}
@Override
public void onUserCommandUpdate(String s) {
CommonUtil.emitEvent("userListener", "onUserCommandUpdate", s);
}
} }

@ -52,6 +52,15 @@ public class FriendshipManager extends BaseManager {
); );
} }
public void getFriendListPage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendListPage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "offset"),
value(methodCall, "count")
);
}
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) { public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendRemark( Open_im_sdk.setFriendRemark(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),

@ -62,6 +62,15 @@ public class GroupManager extends BaseManager {
); );
} }
public void getJoinedGroupListPage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getJoinedGroupListPage(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "offset"),
value(methodCall, "count")
);
}
public void createGroup(MethodCall methodCall, MethodChannel.Result result) { public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.createGroup( Open_im_sdk.createGroup(
new OnBaseListener(result, methodCall), new OnBaseListener(result, methodCall),
@ -265,4 +274,12 @@ public class GroupManager extends BaseManager {
value(methodCall, "groupID") value(methodCall, "groupID")
); );
} }
public void getUsersInGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInGroup(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
jsonValue(methodCall, "userIDs")
);
}
} }

@ -1,9 +1,9 @@
buildscript { buildscript {
repositories { repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
google() google()
mavenCentral() mavenCentral()
} }
@ -15,10 +15,10 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
google() google()
mavenCentral() mavenCentral()
} }

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

@ -14,13 +14,7 @@ class _MyAppState extends State<MyApp> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
OpenIM.iMManager.initSDK( OpenIM.iMManager.initSDK(platformID: 1, apiAddr: '', wsAddr: '', dataDir: '/', listener: OnConnectListener());
platformID: 1,
apiAddr: '',
wsAddr: '',
dataDir: '/',
objectStorage: 'minio',
listener: OnConnectListener());
} }
@override @override

@ -68,44 +68,68 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "3.5.0-rc.1+1" version: "3.8.0-rc.15"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.12.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -155,10 +179,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.1" version: "0.7.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -167,14 +191,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
web: vm_service:
dependency: transitive dependency: transitive
description: description:
name: web name: vm_service
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "14.2.1"
sdks: sdks:
dart: ">=3.2.0-194.0.dev <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=1.20.0" flutter: ">=3.18.0-18.0.pre.54"

@ -131,31 +131,36 @@ public class ConversationManager: BaseServiceManager {
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol { public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
public func onSyncServerProgress(_ progress: Int) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerProgress", errCode: nil, errMsg: nil, data: progress)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
self.channel = channel self.channel = channel
} }
public func onConversationChanged(_ conversationList: String?) { public func onConversationChanged(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
} }
public func onNewConversation(_ conversationList: String?) { public func onNewConversation(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
} }
public func onSyncServerFailed() { public func onSyncServerFailed(_ reinstalled: Bool) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: reinstalled)
} }
public func onSyncServerFinish() { public func onSyncServerFinish(_ reinstalled: Bool) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: reinstalled)
} }
public func onSyncServerStart() { public func onSyncServerStart(_ reinstalled: Bool) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: nil) CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: reinstalled)
} }
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) { public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {

@ -11,6 +11,7 @@ public class FriendshipManager: BaseServiceManager {
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
self["getFriendList"] = getFriendList self["getFriendList"] = getFriendList
self["getFriendListPage"] = getFriendListPage
self["setFriendRemark"] = setFriendRemark self["setFriendRemark"] = setFriendRemark
self["addBlacklist"] = addBlacklist self["addBlacklist"] = addBlacklist
self["getBlacklist"] = getBlacklist self["getBlacklist"] = getBlacklist
@ -47,6 +48,10 @@ public class FriendshipManager: BaseServiceManager {
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"]) Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getFriendListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
}
func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())

@ -11,6 +11,7 @@ public class GroupManager: BaseServiceManager {
self["getGroupMembersInfo"] = getGroupMembersInfo self["getGroupMembersInfo"] = getGroupMembersInfo
self["getGroupMemberList"] = getGroupMemberList self["getGroupMemberList"] = getGroupMemberList
self["getJoinedGroupList"] = getJoinedGroupList self["getJoinedGroupList"] = getJoinedGroupList
self["getJoinedGroupListPage"] = getJoinedGroupListPage
self["createGroup"] = createGroup self["createGroup"] = createGroup
self["setGroupInfo"] = setGroupInfo self["setGroupInfo"] = setGroupInfo
self["getGroupsInfo"] = getGroupsInfo self["getGroupsInfo"] = getGroupsInfo
@ -35,6 +36,7 @@ public class GroupManager: BaseServiceManager {
self["searchGroupMembers"] = searchGroupMembers self["searchGroupMembers"] = searchGroupMembers
self["setGroupMemberInfo"] = setGroupMemberInfo self["setGroupMemberInfo"] = setGroupMemberInfo
self["isJoinGroup"] = isJoinGroup self["isJoinGroup"] = isJoinGroup
self["getUsersInGroup"] = getUsersInGroup
} }
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -64,6 +66,10 @@ public class GroupManager: BaseServiceManager {
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"]) Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
} }
func getJoinedGroupListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
}
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
@ -161,6 +167,11 @@ public class GroupManager: BaseServiceManager {
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"]) Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
} }
func getUsersInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetUsersInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"],
methodCall[jsonString: "userIDs"])
}
} }
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol { public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {

@ -105,6 +105,10 @@ public class IMMananger: BaseServiceManager {
} }
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol { public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
public func onUserTokenInvalid(_ errMsg: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenInvalid", errCode: nil, errMsg: errMsg, data: nil)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {

@ -64,19 +64,31 @@ public class UserManager: BaseServiceManager {
} }
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol { public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
public func onUserCommandAdd(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandAdd", errCode: nil, errMsg: nil, data: userCommand)
}
public func onUserCommandDelete(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandDelete", errCode: nil, errMsg: nil, data: userCommand)
}
public func onUserCommandUpdate(_ userCommand: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandUpdate", errCode: nil, errMsg: nil, data: userCommand)
}
private let channel:FlutterMethodChannel private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) { init(channel:FlutterMethodChannel) {
self.channel = channel self.channel = channel
} }
public func onSelfInfoUpdated(_ userInfo: String?) { public func onSelfInfoUpdated(_ userInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo) CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
} }
public func onUserStatusChanged(_ statusInfo: String?) { public func onUserStatusChanged(_ statusInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo) CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
} }
} }

@ -17,11 +17,11 @@ A new Flutter project.
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '11.0' s.platform = :ios, '11.0'
s.dependency 'OpenIMSDKCore','3.5.1' s.dependency 'OpenIMSDKCore','3.8.0-rc.16'
s.static_framework = true s.static_framework = true
s.library = 'resolv' s.library = 'resolv'
# s.vendored_frameworks = 'Framework/*.framework' # s.vendored_frameworks = 'Framework/*.xcframework'
# Flutter.framework does not contain a i386 slice. # Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' } s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
s.swift_version = '5.0' s.swift_version = '5.0'

@ -71,6 +71,16 @@ class FriendshipManager {
})) }))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v))); .then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
Future<List<FullUserInfo>> getFriendListPage({String? operationID, int offset = 0, int count = 40}) => _channel
.invokeMethod(
'getFriendListPage',
_buildParam({
'offset': offset,
'count': count,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
/// Get Friend List, including friends who have been put into the blacklist (returns a map) /// Get Friend List, including friends who have been put into the blacklist (returns a map)
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
.invokeMethod( .invokeMethod(

@ -127,6 +127,16 @@ class GroupManager {
})) }))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); .then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel
.invokeMethod(
'getJoinedGroupListPage',
_buildParam({
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Query the list of joined groups /// Query the list of joined groups
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
.invokeMethod( .invokeMethod(
@ -566,6 +576,20 @@ class GroupManager {
'info': groupMembersInfo.toJson(), 'info': groupMembersInfo.toJson(),
'operationID': Utils.checkOperationID(operationID), 'operationID': Utils.checkOperationID(operationID),
})); }));
Future<dynamic> getUsersInGroup(
String groupID,
List<String> userIDs, {
String? operationID,
}) =>
_channel.invokeMethod(
'getUsersInGroup',
_buildParam({
'groupID': groupID,
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "groupManager"; param["ManagerName"] = "groupManager";
log('param: $param'); log('param: $param');

@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OpenIM { class OpenIM {
static const version = '3.5.1'; static const version = '3.8.0-rc.16';
static const _channel = const MethodChannel('flutter_openim_sdk'); static const _channel = const MethodChannel('flutter_openim_sdk');

@ -1,11 +1,11 @@
name: flutter_openim_sdk name: flutter_openim_sdk
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source. description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
version: 3.5.1 version: 3.8.0-rc.16
homepage: https://www.openim.io homepage: https://www.openim.io
repository: https://github.com/openimsdk/open-im-sdk-flutter repository: https://github.com/openimsdk/open-im-sdk-flutter
environment: environment:
sdk: ">=2.12.0 <4.0.0" sdk: ">=3.0.0 <4.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"
dependencies: dependencies:

Loading…
Cancel
Save