mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
Show ElementCalls in the system Recents list and allow deep linking back into a call from there
This commit is contained in:
committed by
Stefan Ceriu
parent
16fc7caa62
commit
f6c476eeca
@@ -91,7 +91,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
|
||||
|
||||
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
|
||||
guard let roomID = payload.dictionaryPayload[ElementCallServiceNotificationKey.roomID.rawValue] as? String else {
|
||||
MXLog.error("Somethnig went wrong, missing room identifier for incoming voip call: \(payload)")
|
||||
MXLog.error("Something went wrong, missing room identifier for incoming voip call: \(payload)")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -102,20 +102,18 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
|
||||
|
||||
let configuration = CXProviderConfiguration()
|
||||
configuration.supportsVideo = true
|
||||
configuration.includesCallsInRecents = false
|
||||
configuration.includesCallsInRecents = true
|
||||
|
||||
// https://stackoverflow.com/a/46077628/730924
|
||||
configuration.supportedHandleTypes = [.generic]
|
||||
|
||||
let update = CXCallUpdate()
|
||||
update.hasVideo = true
|
||||
|
||||
update.localizedCallerName = payload.dictionaryPayload[ElementCallServiceNotificationKey.roomDisplayName.rawValue] as? String
|
||||
|
||||
if let senderDisplayName = payload.dictionaryPayload[ElementCallServiceNotificationKey.senderDisplayName.rawValue] as? String {
|
||||
update.remoteHandle = .init(type: .generic, value: senderDisplayName)
|
||||
} else if let senderID = payload.dictionaryPayload[ElementCallServiceNotificationKey.senderID.rawValue] as? String {
|
||||
update.remoteHandle = .init(type: .generic, value: senderID)
|
||||
} else {
|
||||
MXLog.error("Something went wrong, both the user display name and ID are nil")
|
||||
}
|
||||
// https://stackoverflow.com/a/41230020/730924
|
||||
update.remoteHandle = .init(type: .generic, value: roomID)
|
||||
|
||||
let callProvider = CXProvider(configuration: configuration)
|
||||
callProvider.setDelegate(self, queue: nil)
|
||||
|
||||
@@ -24,8 +24,6 @@ enum ElementCallServiceAction {
|
||||
enum ElementCallServiceNotificationKey: String {
|
||||
case roomID
|
||||
case roomDisplayName
|
||||
case senderID
|
||||
case senderDisplayName
|
||||
}
|
||||
|
||||
let ElementCallServiceNotificationDiscardDelta = 10.0
|
||||
|
||||
Reference in New Issue
Block a user