forked from eatvio/eatvio_app
feat(video_calls): app delegate fix
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user