Skip to content

Commit 056581f

Browse files
committed
3.0
1 parent af0ca09 commit 056581f

File tree

6 files changed

+80
-61
lines changed

6 files changed

+80
-61
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ dependencies {
5353
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
5454
// implementation 'io.openim:core-sdk:0.0.1@aar'
5555
// api 'io.openim:core-sdk:2.3.5-t44@aar'
56-
implementation 'io.openim:core-sdk:3.0.0-beta11@aar'
56+
implementation 'io.openim:core-sdk:3.0.0-beta13@aar'
5757
}

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PODS:
33
- flutter_openim_sdk (0.0.1):
44
- Flutter
55
- OpenIMSDKCore (= 3.0.0)
6-
- OpenIMSDKCore (3.0.0)
6+
- "OpenIMSDKCore (3.0.0+1)"
77

88
DEPENDENCIES:
99
- Flutter (from `Flutter`)
@@ -22,7 +22,7 @@ EXTERNAL SOURCES:
2222
SPEC CHECKSUMS:
2323
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
2424
flutter_openim_sdk: 12daf3769f8bf40001970304445b6155c146b7eb
25-
OpenIMSDKCore: cf4fa9f9599cc6741f7acc5ef260647f34541e87
25+
OpenIMSDKCore: 2e38a5b9be23e588b5049ebd378161cf277e41a0
2626

2727
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
2828

ios/Classes/Module/ConversationManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class ConversationManager: BaseServiceManager {
111111
}
112112

113113
func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
114-
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "burnDuration"])
114+
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
115115
}
116116
}
117117

ios/Classes/Module/IMManager.swift

Lines changed: 57 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class IMMananger: BaseServiceManager {
1111
self["login"] = login
1212
self["logout"] = logout
1313
self["getLoginStatus"] = getLoginStatus
14-
self["putFile"] = putFile
14+
self["uploadFile"] = uploadFile
1515
self["updateFcmToken"] = updateFcmToken
1616
self["setAppBackgroundStatus"] = setAppBackgroundStatus
1717
self["networkStatusChanged"] = networkStatusChanged
@@ -22,7 +22,7 @@ public class IMMananger: BaseServiceManager {
2222
selector: #selector(applicationWillEnterForeground),
2323
name: UIApplication.willEnterForegroundNotification,
2424
object: nil)
25-
25+
2626
NotificationCenter.default.addObserver(self,
2727
selector: #selector(applicationDidEnterBackground),
2828
name: UIApplication.didEnterBackgroundNotification,
@@ -51,7 +51,7 @@ public class IMMananger: BaseServiceManager {
5151
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
5252
}), UUID().uuidString, true)
5353
}
54-
54+
5555
@objc
5656
fileprivate func applicationWillEnterForeground() {
5757
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
@@ -75,8 +75,8 @@ public class IMMananger: BaseServiceManager {
7575
callBack(result, Open_im_sdkGetLoginStatus(methodCall[string: "operationID"]))
7676
}
7777

78-
func putFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
79-
Open_im_sdkPutFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(),PutFileListener(channel: self.channel,putID: methodCall[string: "putID"]))
78+
func uploadFile(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
79+
Open_im_sdkUploadFile(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString(), UploadFileListener(channel: self.channel,id: methodCall[string: "id"]))
8080
}
8181

8282
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@@ -102,7 +102,7 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
102102
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
103103
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
104104
}
105-
105+
106106
public func onConnectSuccess() {
107107
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
108108
}
@@ -120,60 +120,79 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
120120
}
121121
}
122122

123-
public class PutFileListener: NSObject, Open_im_sdk_callbackPutFileCallbackProtocol {
123+
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
124+
124125
private let channel:FlutterMethodChannel
125-
private let putID: String
126+
private let id: String
126127

127-
init(channel:FlutterMethodChannel, putID: String) {
128+
init(channel:FlutterMethodChannel, id: String) {
128129
self.channel = channel
129-
self.putID = putID
130+
self.id = id
131+
}
132+
133+
public func complete(_ size: Int64, url: String?, typ: Int32) {
134+
var values: [String: Any] = [:]
135+
values["id"] = id
136+
values["size"] = size
137+
values["url"] = url
138+
values["type"] = typ
139+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "complete", errCode: nil, errMsg: nil, data: values)
130140
}
131141

132-
public func hashComplete(_ hash: String?, total: Int64) {
142+
public func hashPartComplete(_ partsHash: String?, fileHash: String?) {
133143
var values: [String: Any] = [:]
134-
values["putID"] = putID
135-
values["hash"] = hash
136-
values["total"] = total
137-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "hashComplete", errCode: nil, errMsg: nil, data: values)
144+
values["id"] = id
145+
values["partHash"] = partsHash
146+
values["fileHash"] = fileHash
147+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values);<#code#>
138148
}
139149

140-
public func hashProgress(_ current: Int64, total: Int64) {
150+
public func hashPartProgress(_ index: Int32, size: Int64, partHash: String?) {
141151
var values: [String: Any] = [:]
142-
values["putID"] = putID
143-
values["current"] = current
144-
values["total"] = total
145-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "hashProgress", errCode: nil, errMsg: nil, data: values)
152+
values["id"] = id
153+
values["index"] = index
154+
values["size"] = size
155+
values["partHash"] = partHash
156+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartProgress", errCode: nil, errMsg: nil, data: values)
146157
}
147158

148159
public func open(_ size: Int64) {
149160
var values: [String: Any] = [:]
150-
values["putID"] = putID
161+
values["id"] = id
151162
values["size"] = size
152-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
163+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
164+
}
165+
166+
public func partSize(_ partSize: Int64, num: Int32) {
167+
var values: [String: Any] = [:]
168+
values["id"] = id
169+
values["partSize"] = partSize
170+
values["num"] = num
171+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "partSize", errCode: nil, errMsg: nil, data: values)
153172
}
154173

155-
public func putComplete(_ total: Int64, putType: Int) {
174+
public func uploadComplete(_ fileSize: Int64, streamSize: Int64, storageSize: Int64) {
156175
var values: [String: Any] = [:]
157-
values["putID"] = putID
158-
values["putType"] = putType
159-
values["total"] = total
160-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "putComplete", errCode: nil, errMsg: nil, data: values)
176+
values["id"] = id
177+
values["fileSize"] = fileSize
178+
values["streamSize"] = streamSize
179+
values["storageSize"] = storageSize
180+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadProgress", errCode: nil, errMsg: nil, data: values)
161181
}
162182

163-
public func putProgress(_ save: Int64, current: Int64, total: Int64) {
183+
public func uploadID(_ uploadID: String?) {
164184
var values: [String: Any] = [:]
165-
values["putID"] = putID
166-
values["save"] = save
167-
values["current"] = current
168-
values["total"] = total
169-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "putProgress", errCode: nil, errMsg: nil, data: values)
185+
values["id"] = id
186+
values["uploadID"] = uploadID
187+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
170188
}
171189

172-
public func putStart(_ current: Int64, total: Int64) {
190+
public func uploadPartComplete(_ index: Int32, partSize: Int64, partHash: String?) {
173191
var values: [String: Any] = [:]
174-
values["putID"] = putID
175-
values["current"] = current
176-
values["total"] = total
177-
CommonUtil.emitEvent(channel: channel, method: "putFileListener", type: "putStart", errCode: nil, errMsg: nil, data: values)
192+
values["id"] = id
193+
values["index"] = index
194+
values["partSize"] = partSize
195+
values["partHash"] = partHash
196+
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadPartComplete", errCode: nil, errMsg: nil, data: values);<#code#>
178197
}
179198
}

lib/src/manager/im_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ class IMManager {
500500
/// 获取当前登录用户信息
501501
Future<UserInfo> getLoginUserInfo() async => userInfo;
502502

503-
///
503+
///[id][OnUploadFileListener] id一致,区分是哪个文件的回调
504504
Future uploadFile({
505505
required String id,
506506
required String filePath,

pubspec.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,47 @@ packages:
66
description:
77
name: async
88
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
9-
url: "https://pub.dev"
9+
url: "https://pub.flutter-io.cn"
1010
source: hosted
1111
version: "2.10.0"
1212
boolean_selector:
1313
dependency: transitive
1414
description:
1515
name: boolean_selector
1616
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17-
url: "https://pub.dev"
17+
url: "https://pub.flutter-io.cn"
1818
source: hosted
1919
version: "2.1.1"
2020
characters:
2121
dependency: transitive
2222
description:
2323
name: characters
2424
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
25-
url: "https://pub.dev"
25+
url: "https://pub.flutter-io.cn"
2626
source: hosted
2727
version: "1.2.1"
2828
clock:
2929
dependency: transitive
3030
description:
3131
name: clock
3232
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33-
url: "https://pub.dev"
33+
url: "https://pub.flutter-io.cn"
3434
source: hosted
3535
version: "1.1.1"
3636
collection:
3737
dependency: transitive
3838
description:
3939
name: collection
4040
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
41-
url: "https://pub.dev"
41+
url: "https://pub.flutter-io.cn"
4242
source: hosted
4343
version: "1.17.0"
4444
fake_async:
4545
dependency: transitive
4646
description:
4747
name: fake_async
4848
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
49-
url: "https://pub.dev"
49+
url: "https://pub.flutter-io.cn"
5050
source: hosted
5151
version: "1.3.1"
5252
flutter:
@@ -64,39 +64,39 @@ packages:
6464
description:
6565
name: js
6666
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
67-
url: "https://pub.dev"
67+
url: "https://pub.flutter-io.cn"
6868
source: hosted
6969
version: "0.6.5"
7070
matcher:
7171
dependency: transitive
7272
description:
7373
name: matcher
7474
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
75-
url: "https://pub.dev"
75+
url: "https://pub.flutter-io.cn"
7676
source: hosted
7777
version: "0.12.13"
7878
material_color_utilities:
7979
dependency: transitive
8080
description:
8181
name: material_color_utilities
8282
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
83-
url: "https://pub.dev"
83+
url: "https://pub.flutter-io.cn"
8484
source: hosted
8585
version: "0.2.0"
8686
meta:
8787
dependency: transitive
8888
description:
8989
name: meta
9090
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
91-
url: "https://pub.dev"
91+
url: "https://pub.flutter-io.cn"
9292
source: hosted
9393
version: "1.8.0"
9494
path:
9595
dependency: transitive
9696
description:
9797
name: path
9898
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
99-
url: "https://pub.dev"
99+
url: "https://pub.flutter-io.cn"
100100
source: hosted
101101
version: "1.8.2"
102102
sky_engine:
@@ -109,55 +109,55 @@ packages:
109109
description:
110110
name: source_span
111111
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
112-
url: "https://pub.dev"
112+
url: "https://pub.flutter-io.cn"
113113
source: hosted
114114
version: "1.9.1"
115115
stack_trace:
116116
dependency: transitive
117117
description:
118118
name: stack_trace
119119
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
120-
url: "https://pub.dev"
120+
url: "https://pub.flutter-io.cn"
121121
source: hosted
122122
version: "1.11.0"
123123
stream_channel:
124124
dependency: transitive
125125
description:
126126
name: stream_channel
127127
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
128-
url: "https://pub.dev"
128+
url: "https://pub.flutter-io.cn"
129129
source: hosted
130130
version: "2.1.1"
131131
string_scanner:
132132
dependency: transitive
133133
description:
134134
name: string_scanner
135135
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
136-
url: "https://pub.dev"
136+
url: "https://pub.flutter-io.cn"
137137
source: hosted
138138
version: "1.2.0"
139139
term_glyph:
140140
dependency: transitive
141141
description:
142142
name: term_glyph
143143
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
144-
url: "https://pub.dev"
144+
url: "https://pub.flutter-io.cn"
145145
source: hosted
146146
version: "1.2.1"
147147
test_api:
148148
dependency: transitive
149149
description:
150150
name: test_api
151151
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
152-
url: "https://pub.dev"
152+
url: "https://pub.flutter-io.cn"
153153
source: hosted
154154
version: "0.4.16"
155155
vector_math:
156156
dependency: transitive
157157
description:
158158
name: vector_math
159159
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
160-
url: "https://pub.dev"
160+
url: "https://pub.flutter-io.cn"
161161
source: hosted
162162
version: "2.1.4"
163163
sdks:

0 commit comments

Comments
 (0)