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
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate, CallkitIncomingAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate, CallkitIncomingAppDelegate {
|
||||||
|
private var voipRegistry: PKPushRegistry?
|
||||||
|
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
@@ -20,9 +22,9 @@ import flutter_foreground_task
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mainQueue = DispatchQueue.main
|
let mainQueue = DispatchQueue.main
|
||||||
let voipRegistry = PKPushRegistry(queue: mainQueue)
|
voipRegistry = PKPushRegistry(queue: mainQueue)
|
||||||
voipRegistry.delegate = self
|
voipRegistry?.delegate = self
|
||||||
voipRegistry.desiredPushTypes = [PKPushType.voIP]
|
voipRegistry?.desiredPushTypes = [PKPushType.voIP]
|
||||||
|
|
||||||
if #available(iOS 10.0, *) {
|
if #available(iOS 10.0, *) {
|
||||||
UNUserNotificationCenter.current().delegate = self
|
UNUserNotificationCenter.current().delegate = self
|
||||||
@@ -84,10 +86,6 @@ import flutter_foreground_task
|
|||||||
}
|
}
|
||||||
|
|
||||||
let dict = payload.dictionaryPayload
|
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)
|
let nameCaller = (dict["nameCaller"] as? String)
|
||||||
?? (dict["caller_name"] as? String)
|
?? (dict["caller_name"] as? String)
|
||||||
?? (dict["callerName"] as? String)
|
?? (dict["callerName"] as? String)
|
||||||
@@ -96,6 +94,15 @@ import flutter_foreground_task
|
|||||||
?? (dict["conversationUuid"] as? String)
|
?? (dict["conversationUuid"] as? String)
|
||||||
?? (dict["handle"] 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)
|
let isVideo = (dict["isVideo"] as? Bool)
|
||||||
?? (dict["is_video"] as? Bool)
|
?? (dict["is_video"] as? Bool)
|
||||||
?? true
|
?? true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: eatvio_app
|
name: eatvio_app
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
version: 1.3.25+106
|
version: 1.3.26+107
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user