[Fix] Adjust the monitoring function parameters for uploading files.
This commit is contained in:
parent
cfc94c06da
commit
2da3a5e557
@ -19,7 +19,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void complete(long size, String url, int type) {
|
public void complete(long size, String url, long type) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@ -42,7 +42,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hashPartProgress(int index, long size, String partHash) {
|
public void hashPartProgress(long index, long size, String partHash) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@ -64,7 +64,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void partSize(long partSize, int num) {
|
public void partSize(long partSize, long num) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@ -97,7 +97,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadPartComplete(int index, long partSize, String partHash) {
|
public void uploadPartComplete(long index, long partSize, String partHash) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
|
@ -22,7 +22,7 @@ public class IMMananger: BaseServiceManager {
|
|||||||
selector: #selector(applicationWillEnterForeground),
|
selector: #selector(applicationWillEnterForeground),
|
||||||
name: UIApplication.willEnterForegroundNotification,
|
name: UIApplication.willEnterForegroundNotification,
|
||||||
object: nil)
|
object: nil)
|
||||||
|
|
||||||
NotificationCenter.default.addObserver(self,
|
NotificationCenter.default.addObserver(self,
|
||||||
selector: #selector(applicationDidEnterBackground),
|
selector: #selector(applicationDidEnterBackground),
|
||||||
name: UIApplication.didEnterBackgroundNotification,
|
name: UIApplication.didEnterBackgroundNotification,
|
||||||
@ -51,7 +51,7 @@ public class IMMananger: BaseServiceManager {
|
|||||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||||
}), UUID().uuidString, true)
|
}), UUID().uuidString, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc
|
@objc
|
||||||
fileprivate func applicationWillEnterForeground() {
|
fileprivate func applicationWillEnterForeground() {
|
||||||
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
Open_im_sdkSetAppBackgroundStatus(BaseCallback(result: { _ in
|
||||||
@ -102,7 +102,7 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
|||||||
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
|
public func onConnectFailed(_ errCode: Int32, errMsg: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onConnectSuccess() {
|
public func onConnectSuccess() {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil)
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
|
public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbackProtocol {
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
private let channel:FlutterMethodChannel
|
||||||
private let id: String
|
private let id: String
|
||||||
|
|
||||||
@ -129,8 +129,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
self.channel = channel
|
self.channel = channel
|
||||||
self.id = id
|
self.id = id
|
||||||
}
|
}
|
||||||
|
public func complete(_ size: Int64, url: String?, typ: Int) {
|
||||||
public func complete(_ size: Int64, url: String?, typ: Int32) {
|
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["size"] = size
|
values["size"] = size
|
||||||
@ -147,7 +146,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hashPartProgress(_ index: Int32, size: Int64, partHash: String?) {
|
public func hashPartProgress(_ index: Int, size: Int64, partHash: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["index"] = index
|
values["index"] = index
|
||||||
@ -163,7 +162,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func partSize(_ partSize: Int64, num: Int32) {
|
public func partSize(_ partSize: Int64, num: Int) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["partSize"] = partSize
|
values["partSize"] = partSize
|
||||||
@ -186,8 +185,8 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
values["uploadID"] = uploadID
|
values["uploadID"] = uploadID
|
||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func uploadPartComplete(_ index: Int32, partSize: Int64, partHash: String?) {
|
public func uploadPartComplete(_ index: Int, partSize: Int64, partHash: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["index"] = index
|
values["index"] = index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user