From b9cb4eeb84a6781b676ff71a18734f429ac4a7a1 Mon Sep 17 00:00:00 2001 From: misha Date: Mon, 15 Jun 2026 16:27:24 +0300 Subject: [PATCH] feat(video_calls): app delegate fix --- ios/Runner/AppDelegate.swift | 21 ++++++++++++++------- pubspec.yaml | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index dcfc1df5..a1632593 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -10,6 +10,8 @@ import flutter_foreground_task @main @objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate, CallkitIncomingAppDelegate { + private var voipRegistry: PKPushRegistry? + override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? @@ -20,9 +22,9 @@ import flutter_foreground_task } let mainQueue = DispatchQueue.main - let voipRegistry = PKPushRegistry(queue: mainQueue) - voipRegistry.delegate = self - voipRegistry.desiredPushTypes = [PKPushType.voIP] + voipRegistry = PKPushRegistry(queue: mainQueue) + voipRegistry?.delegate = self + voipRegistry?.desiredPushTypes = [PKPushType.voIP] if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self @@ -84,10 +86,6 @@ import flutter_foreground_task } let dict = payload.dictionaryPayload - let id = (dict["id"] as? String) - ?? (dict["call_id"] as? String) - ?? (dict["message_id"] as? String) - ?? UUID().uuidString let nameCaller = (dict["nameCaller"] as? String) ?? (dict["caller_name"] as? String) ?? (dict["callerName"] as? String) @@ -96,6 +94,15 @@ import flutter_foreground_task ?? (dict["conversationUuid"] as? String) ?? (dict["handle"] as? String) ?? "" + let id = [ + dict["id"] as? String, + dict["call_id"] as? String, + conversationUuid, + dict["message_id"] as? String, + ] + .compactMap { $0?.trimmingCharacters(in: .whitespacesAndNewlines) } + .first { !$0.isEmpty && UUID(uuidString: $0) != nil } + ?? UUID().uuidString let isVideo = (dict["isVideo"] as? Bool) ?? (dict["is_video"] as? Bool) ?? true diff --git a/pubspec.yaml b/pubspec.yaml index 2cf34b05..cfd60cd9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: eatvio_app description: A new Flutter project. -version: 1.3.25+106 +version: 1.3.26+107 publish_to: 'none' environment: