trace call timestamp from NSE

This commit is contained in:
ryanzhao 2021-11-09 16:07:34 +11:00
parent ff79c58f44
commit a1aa45ae10
2 changed files with 4 additions and 3 deletions

View File

@ -240,8 +240,9 @@ public enum PushRegistrationError: Error {
owsAssertDebug(CurrentAppContext().isMainApp)
owsAssertDebug(type == .voIP)
let payload = payload.dictionaryPayload
if let uuid = payload["uuid"] as? String, let caller = payload["caller"] as? String {
if let uuid = payload["uuid"] as? String, let caller = payload["caller"] as? String, let timestamp = payload["timestamp"] as? UInt64 {
let call = SessionCall(for: caller, uuid: uuid, mode: .answer)
call.callMessageTimestamp = timestamp
call.reportIncomingCallIfNeeded { error in
if let error = error {
SNLog("[Calls] Failed to report incoming call to CallKit due to error: \(error)")

View File

@ -218,8 +218,8 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
private func handleSuccessForIncomingCall(for content: UNMutableNotificationContent, callMessage: CallMessage) {
if #available(iOSApplicationExtension 14.5, *) {
if let uuid = callMessage.uuid, let caller = callMessage.sender {
let payload = ["uuid": uuid, "caller": caller]
if let uuid = callMessage.uuid, let caller = callMessage.sender, let timestamp = callMessage.sentTimestamp {
let payload = ["uuid": uuid, "caller": caller, "timestamp": timestamp]
CXProvider.reportNewIncomingVoIPPushPayload(payload) { error in
if let error = error {
self.contentHandler!(content)