Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett committed Jan 8, 2024
1 parent da148f7 commit 9822775
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.5.1-alpha.2

- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.2)

## 3.5.0-rc.1

- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.0-rc.1)
Expand Down
4 changes: 4 additions & 0 deletions ios/Classes/Module/ConversationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationL
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
}

public func onConversationUserInputStatusChanged(_ change: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationUserInputStatusChanged", errCode: nil, errMsg: nil, data: change)
}
}


8 changes: 7 additions & 1 deletion ios/Classes/Module/MessageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,13 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
values["message"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
}


public func onRecvOnlineOnlyMessage(_ message: String?) {
var values: [String: Any] = [:]
values["id"] = id
values["message"] = message
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
}
}

public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
Expand Down
2 changes: 1 addition & 1 deletion ios/flutter_openim_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A new Flutter project.
s.dependency 'Flutter'
s.platform = :ios, '11.0'

s.dependency 'OpenIMSDKCore','3.5.0-rc1'
s.dependency 'OpenIMSDKCore','3.5.1-alpha.2'
s.static_framework = true
# s.vendored_frameworks = 'Framework/*.framework'
# Flutter.framework does not contain a i386 slice.
Expand Down
6 changes: 6 additions & 0 deletions lib/src/listener/advanced_msg_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class OnAdvancedMsgListener {
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(Message msg)? onRecvNewMessage;
Function(Message msg)? onRecvOfflineNewMessage;
Function(Message msg)? onRecvOnlineOnlyMessage;

/// Uniquely identifies
String id;
Expand All @@ -21,6 +22,7 @@ class OnAdvancedMsgListener {
this.onRecvMessageExtensionsDeleted,
this.onRecvNewMessage,
this.onRecvOfflineNewMessage,
this.onRecvOnlineOnlyMessage,
}) : id = "id_${DateTime.now().microsecondsSinceEpoch}";

void msgDeleted(Message msg) {
Expand Down Expand Up @@ -56,4 +58,8 @@ class OnAdvancedMsgListener {
void recvOfflineNewMessage(Message msg) {
onRecvOfflineNewMessage?.call(msg);
}

void recvOnlineOnlyMessage(Message msg) {
onRecvOnlineOnlyMessage?.call(msg);
}
}
15 changes: 9 additions & 6 deletions lib/src/manager/im_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ class IMManager {
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOfflineNewMessage(msg);
break;
case 'onRecvOnlineOnlyMessage':
var value = call.arguments['data']['message'];
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
messageManager.msgListener.recvOnlineOnlyMessage(msg);
break;
}
} else if (call.method == ListenerType.msgSendProgressListener) {
String type = call.arguments['type'];
Expand Down Expand Up @@ -279,10 +284,10 @@ class IMManager {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
switch (type) {
case 'onProgress':
int size = data['size'];
int current = data['current'];
_uploadLogsListener?.onProgress(current, size);
case 'onProgress':
int size = data['size'];
int current = data['current'];
_uploadLogsListener?.onProgress(current, size);
}
} else if (call.method == ListenerType.uploadFileListener) {
String type = call.arguments['type'];
Expand Down Expand Up @@ -383,7 +388,6 @@ class IMManager {
required String dataDir,
required OnConnectListener listener,
int logLevel = 6,
String objectStorage = 'minio',
bool isCompression = false,
bool isLogStandardOutput = true,
String? logFilePath,
Expand All @@ -399,7 +403,6 @@ class IMManager {
"wsAddr": wsAddr,
"dataDir": dataDir,
"logLevel": logLevel,
"objectStorage": objectStorage,
"isCompression": isCompression,
"isLogStandardOutput": isLogStandardOutput,
"logFilePath": logFilePath,
Expand Down
4 changes: 0 additions & 4 deletions lib/src/models/init_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class InitConfig {
String apiAddr;
String wsAddr;
String dataDir;
String objectStorage;
int logLevel;
bool isLogStandardOutput;
String? logFilePath;
Expand All @@ -13,7 +12,6 @@ class InitConfig {
required this.apiAddr,
required this.wsAddr,
required this.dataDir,
required this.objectStorage,
this.logLevel = 6,
this.isLogStandardOutput = true,
this.logFilePath,
Expand All @@ -25,7 +23,6 @@ class InitConfig {
apiAddr: json['apiAddr'],
wsAddr: json['wsAddr'],
dataDir: json['dataDir'],
objectStorage: json['objectStorage'],
logLevel: json['logLevel'],
isLogStandardOutput: json['isLogStandardOutput'],
logFilePath: json['logFilePath'],
Expand All @@ -38,7 +35,6 @@ class InitConfig {
'apiAddr': apiAddr,
'wsAddr': wsAddr,
'dataDir': dataDir,
'objectStorage': objectStorage,
'logLevel': logLevel,
'isLogStandardOutput': isLogStandardOutput,
'logFilePath': logFilePath,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/openim.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';

class OpenIM {
static const version = '3.5.0-rc.1';
static const version = '3.5.1-alpha.2';

static const _channel = const MethodChannel('flutter_openim_sdk');

Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: flutter_openim_sdk
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
version: 3.5.0-rc.1+1
version: 3.5.1-alpha.2
homepage: https://www.openim.io
repository: https://github.com/openimsdk/open-im-sdk-flutter

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0 <4.0.0"
flutter: ">=1.20.0"

dependencies:
Expand Down

0 comments on commit 9822775

Please sign in to comment.