forked from eatvio/eatvio_app
feat(video_calls): ios call declining notification for other devices fix
This commit is contained in:
@@ -322,6 +322,21 @@ import flutter_foreground_task
|
||||
return nil
|
||||
}
|
||||
|
||||
private func extraMarksEndedPush(_ extra: [String: Any]) -> Bool {
|
||||
let value = extra["endedPush"]
|
||||
if let bool = value as? Bool {
|
||||
return bool
|
||||
}
|
||||
if let number = value as? NSNumber {
|
||||
return number.intValue != 0
|
||||
}
|
||||
if let text = value as? String {
|
||||
let normalized = text.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
||||
return normalized == "true" || normalized == "1"
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private func voipBool(_ value: Any?) -> Bool? {
|
||||
if let bool = value as? Bool {
|
||||
return bool
|
||||
@@ -1106,6 +1121,22 @@ import flutter_foreground_task
|
||||
resumeAudioAfterCallKitEnds = false
|
||||
audioRestartGeneration += 1
|
||||
callKitOwnsAudioSession = false
|
||||
// Accept reports the CallKit payload on this channel, and that is what
|
||||
// stops ringing on the other devices. The plugin decline event does not.
|
||||
let extra = call.data.extra as? [String: Any] ?? [:]
|
||||
if !extraMarksEndedPush(extra) {
|
||||
recordVoipDiagnostic(
|
||||
"callkit_decline_native",
|
||||
data: [
|
||||
"callKitId": call.data.uuid,
|
||||
"conversationUuid": conversationUuid(fromCall: call) ?? "",
|
||||
]
|
||||
)
|
||||
voipDiagnosticsChannel?.invokeMethod(
|
||||
"declinedVoipCall",
|
||||
arguments: call.data.toJSON()
|
||||
)
|
||||
}
|
||||
action.fulfill()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user