feat(android, ios): remove files field from files response

This commit is contained in:
ksenia312
2024-02-05 12:28:49 +01:00
parent d6840a4313
commit 1741ee3458
9 changed files with 203 additions and 134 deletions
+6 -4
View File
@@ -9,18 +9,21 @@ import Foundation
import Flutter
extension NearbyServicePlugin {
@objc func onMessageReceived(notification: Notification) {
DispatchQueue.main.async {
if let userInfo = NearbyUserInfo.fromDictionary(userInfo: notification.userInfo) {
if let message = NearbyMessage.fromUserInfo(userInfo: userInfo) {
if message.content is NearbyMessageFilesResponse {
let response = message.content as! NearbyMessageFilesResponse
if (response.response) {
let cachedRequest = NearbyRequestsStore.instance.find(for: response.id)
if (response.response && cachedRequest != nil) {
self.manager.sendFiles(
id: response.id,
paths: response.files,
id: cachedRequest!.id,
paths: cachedRequest!.files,
with: message.senderPeerID.displayName
)
NearbyRequestsStore.instance.remove(for: cachedRequest!.id)
}
}
self.channel.invokeMethod(DART_COMMAND_MESSAGE_RECEIVED, arguments: message.toDartFormat())
@@ -33,7 +36,6 @@ extension NearbyServicePlugin {
}
@objc func onResourceReceived(notification: Notification) {
DispatchQueue.main.async {
if let userInfo = NearbyUserInfo.fromDictionary(userInfo: notification.userInfo) {