mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
trace call timestamp from NSE
This commit is contained in:
parent
ff79c58f44
commit
a1aa45ae10
|
@ -240,8 +240,9 @@ public enum PushRegistrationError: Error {
|
||||||
owsAssertDebug(CurrentAppContext().isMainApp)
|
owsAssertDebug(CurrentAppContext().isMainApp)
|
||||||
owsAssertDebug(type == .voIP)
|
owsAssertDebug(type == .voIP)
|
||||||
let payload = payload.dictionaryPayload
|
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)
|
let call = SessionCall(for: caller, uuid: uuid, mode: .answer)
|
||||||
|
call.callMessageTimestamp = timestamp
|
||||||
call.reportIncomingCallIfNeeded { error in
|
call.reportIncomingCallIfNeeded { error in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
SNLog("[Calls] Failed to report incoming call to CallKit due to error: \(error)")
|
SNLog("[Calls] Failed to report incoming call to CallKit due to error: \(error)")
|
||||||
|
|
|
@ -218,8 +218,8 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
|
||||||
|
|
||||||
private func handleSuccessForIncomingCall(for content: UNMutableNotificationContent, callMessage: CallMessage) {
|
private func handleSuccessForIncomingCall(for content: UNMutableNotificationContent, callMessage: CallMessage) {
|
||||||
if #available(iOSApplicationExtension 14.5, *) {
|
if #available(iOSApplicationExtension 14.5, *) {
|
||||||
if let uuid = callMessage.uuid, let caller = callMessage.sender {
|
if let uuid = callMessage.uuid, let caller = callMessage.sender, let timestamp = callMessage.sentTimestamp {
|
||||||
let payload = ["uuid": uuid, "caller": caller]
|
let payload = ["uuid": uuid, "caller": caller, "timestamp": timestamp]
|
||||||
CXProvider.reportNewIncomingVoIPPushPayload(payload) { error in
|
CXProvider.reportNewIncomingVoIPPushPayload(payload) { error in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
self.contentHandler!(content)
|
self.contentHandler!(content)
|
||||||
|
|
Loading…
Reference in a new issue