Delegate the sending of call notifications to Element Call (#4370)

* Stop sending call notifications manually

The Element Call widget can now assume responsibility for sending them when you start a call.

* Bump Element Call embedded package to v0.14.0

* Delegate the sending of call notifications to Element Call

* Update the SDK.

* Use 'is' prefix for boolean

---------

Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
Robin
2025-08-01 18:47:48 +02:00
committed by GitHub
parent 731d60b6e9
commit 514c7808e2
13 changed files with 208 additions and 245 deletions
+2 -2
View File
@@ -9052,7 +9052,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 25.07.29;
version = 25.08.01;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
@@ -9068,7 +9068,7 @@
repositoryURL = "https://github.com/element-hq/element-call-swift";
requirement = {
kind = exactVersion;
version = 0.13.1;
version = 0.14.0;
};
};
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
@@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/element-call-swift",
"state" : {
"revision" : "dc273bd1fbb08c41ab517574b39c23ef667718c9",
"version" : "0.13.1"
"revision" : "5cfbd1b1d7fb5c3333dd9a8a43130e875a8ec56b",
"version" : "0.14.0"
}
},
{
@@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "98e28f3ad2b54525f6abb17ab8e2ad49e6bf3614",
"version" : "25.7.29"
"revision" : "7e51369bc9407e15295bfa94b96703063c7b7156",
"version" : "25.8.1"
}
},
{
@@ -186,7 +186,7 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
case .userProfile(let userID):
stateMachine.processEvent(.showUserProfileScreen(userID: userID), userInfo: .init(animated: animated))
case .call(let roomID):
Task { await presentCallScreen(roomID: roomID, notifyOtherParticipants: false) }
Task { await presentCallScreen(roomID: roomID) }
case .genericCallLink(let url):
presentCallScreen(genericCallLink: url)
case .settings, .chatBackupSettings:
@@ -531,8 +531,7 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
switch action {
case .presentCallScreen(let roomProxy):
// Here we assume that the app is running and the call state is already up to date
presentCallScreen(roomProxy: roomProxy, notifyOtherParticipants: !roomProxy.infoPublisher.value.hasRoomCall)
presentCallScreen(roomProxy: roomProxy)
case .verifyUser(let userID):
actionsSubject.send(.sessionVerification(.userInitiator(userID: userID)))
case .finished:
@@ -614,23 +613,22 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
presentCallScreen(configuration: .init(genericCallLink: url))
}
private func presentCallScreen(roomID: String, notifyOtherParticipants: Bool) async {
private func presentCallScreen(roomID: String) async {
guard case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(roomID) else {
return
}
presentCallScreen(roomProxy: roomProxy, notifyOtherParticipants: notifyOtherParticipants)
presentCallScreen(roomProxy: roomProxy)
}
private func presentCallScreen(roomProxy: JoinedRoomProxyProtocol, notifyOtherParticipants: Bool) {
private func presentCallScreen(roomProxy: JoinedRoomProxyProtocol) {
let colorScheme: ColorScheme = appMediator.windowManager.mainWindow.traitCollection.userInterfaceStyle == .light ? .light : .dark
presentCallScreen(configuration: .init(roomProxy: roomProxy,
clientProxy: userSession.clientProxy,
clientID: InfoPlistReader.main.bundleIdentifier,
elementCallBaseURL: appSettings.elementCallBaseURL,
elementCallBaseURLOverride: appSettings.elementCallBaseURLOverride,
colorScheme: colorScheme,
notifyOtherParticipants: notifyOtherParticipants))
colorScheme: colorScheme))
}
private var callScreenPictureInPictureController: AVPictureInPictureController?
@@ -833,7 +831,7 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
navigationSplitCoordinator.setSheetCoordinator(nil)
stateMachine.processEvent(.selectRoom(roomID: roomID, via: [], entryPoint: .room))
case .startCall(let roomID):
Task { await self.presentCallScreen(roomID: roomID, notifyOtherParticipants: false) }
Task { await self.presentCallScreen(roomID: roomID) }
case .dismiss:
navigationSplitCoordinator.setSheetCoordinator(nil)
}
@@ -9099,70 +9099,6 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol, @unchecked Sendable {
return elementCallWidgetDriverDeviceIDReturnValue
}
}
//MARK: - sendCallNotificationIfNeeded
var sendCallNotificationIfNeededUnderlyingCallsCount = 0
var sendCallNotificationIfNeededCallsCount: Int {
get {
if Thread.isMainThread {
return sendCallNotificationIfNeededUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = sendCallNotificationIfNeededUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
sendCallNotificationIfNeededUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
sendCallNotificationIfNeededUnderlyingCallsCount = newValue
}
}
}
}
var sendCallNotificationIfNeededCalled: Bool {
return sendCallNotificationIfNeededCallsCount > 0
}
var sendCallNotificationIfNeededUnderlyingReturnValue: Result<Void, RoomProxyError>!
var sendCallNotificationIfNeededReturnValue: Result<Void, RoomProxyError>! {
get {
if Thread.isMainThread {
return sendCallNotificationIfNeededUnderlyingReturnValue
} else {
var returnValue: Result<Void, RoomProxyError>? = nil
DispatchQueue.main.sync {
returnValue = sendCallNotificationIfNeededUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
sendCallNotificationIfNeededUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
sendCallNotificationIfNeededUnderlyingReturnValue = newValue
}
}
}
}
var sendCallNotificationIfNeededClosure: (() async -> Result<Void, RoomProxyError>)?
func sendCallNotificationIfNeeded() async -> Result<Void, RoomProxyError> {
sendCallNotificationIfNeededCallsCount += 1
if let sendCallNotificationIfNeededClosure = sendCallNotificationIfNeededClosure {
return await sendCallNotificationIfNeededClosure()
} else {
return sendCallNotificationIfNeededReturnValue
}
}
//MARK: - matrixToPermalink
var matrixToPermalinkUnderlyingCallsCount = 0
@@ -991,6 +991,48 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
await enableAllSendQueuesEnableClosure?(enable)
}
//MARK: - enableSendQueueUploadProgress
var enableSendQueueUploadProgressEnableUnderlyingCallsCount = 0
open var enableSendQueueUploadProgressEnableCallsCount: Int {
get {
if Thread.isMainThread {
return enableSendQueueUploadProgressEnableUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = enableSendQueueUploadProgressEnableUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
enableSendQueueUploadProgressEnableUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
enableSendQueueUploadProgressEnableUnderlyingCallsCount = newValue
}
}
}
}
open var enableSendQueueUploadProgressEnableCalled: Bool {
return enableSendQueueUploadProgressEnableCallsCount > 0
}
open var enableSendQueueUploadProgressEnableReceivedEnable: Bool?
open var enableSendQueueUploadProgressEnableReceivedInvocations: [Bool] = []
open var enableSendQueueUploadProgressEnableClosure: ((Bool) -> Void)?
open override func enableSendQueueUploadProgress(enable: Bool) {
enableSendQueueUploadProgressEnableCallsCount += 1
enableSendQueueUploadProgressEnableReceivedEnable = enable
DispatchQueue.main.async {
self.enableSendQueueUploadProgressEnableReceivedInvocations.append(enable)
}
enableSendQueueUploadProgressEnableClosure?(enable)
}
//MARK: - encryption
var encryptionUnderlyingCallsCount = 0
@@ -12507,6 +12549,81 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
}
}
//MARK: - fetchThreadSubscription
open var fetchThreadSubscriptionThreadRootEventIdThrowableError: Error?
var fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount = 0
open var fetchThreadSubscriptionThreadRootEventIdCallsCount: Int {
get {
if Thread.isMainThread {
return fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount = newValue
}
}
}
}
open var fetchThreadSubscriptionThreadRootEventIdCalled: Bool {
return fetchThreadSubscriptionThreadRootEventIdCallsCount > 0
}
open var fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventId: String?
open var fetchThreadSubscriptionThreadRootEventIdReceivedInvocations: [String] = []
var fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue: ThreadStatus?
open var fetchThreadSubscriptionThreadRootEventIdReturnValue: ThreadStatus? {
get {
if Thread.isMainThread {
return fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue
} else {
var returnValue: ThreadStatus?? = nil
DispatchQueue.main.sync {
returnValue = fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue = newValue
}
}
}
}
open var fetchThreadSubscriptionThreadRootEventIdClosure: ((String) async throws -> ThreadStatus?)?
open override func fetchThreadSubscription(threadRootEventId: String) async throws -> ThreadStatus? {
if let error = fetchThreadSubscriptionThreadRootEventIdThrowableError {
throw error
}
fetchThreadSubscriptionThreadRootEventIdCallsCount += 1
fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventId = threadRootEventId
DispatchQueue.main.async {
self.fetchThreadSubscriptionThreadRootEventIdReceivedInvocations.append(threadRootEventId)
}
if let fetchThreadSubscriptionThreadRootEventIdClosure = fetchThreadSubscriptionThreadRootEventIdClosure {
return try await fetchThreadSubscriptionThreadRootEventIdClosure(threadRootEventId)
} else {
return fetchThreadSubscriptionThreadRootEventIdReturnValue
}
}
//MARK: - forget
open var forgetThrowableError: Error?
@@ -15421,121 +15538,6 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
try await saveComposerDraftDraftThreadRootClosure?(draft, threadRoot)
}
//MARK: - sendCallNotification
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsThrowableError: Error?
var sendCallNotificationCallIdApplicationNotifyTypeMentionsUnderlyingCallsCount = 0
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsCallsCount: Int {
get {
if Thread.isMainThread {
return sendCallNotificationCallIdApplicationNotifyTypeMentionsUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = sendCallNotificationCallIdApplicationNotifyTypeMentionsUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
sendCallNotificationCallIdApplicationNotifyTypeMentionsUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
sendCallNotificationCallIdApplicationNotifyTypeMentionsUnderlyingCallsCount = newValue
}
}
}
}
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsCalled: Bool {
return sendCallNotificationCallIdApplicationNotifyTypeMentionsCallsCount > 0
}
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsReceivedArguments: (callId: String, application: RtcApplicationType, notifyType: NotifyType, mentions: Mentions)?
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsReceivedInvocations: [(callId: String, application: RtcApplicationType, notifyType: NotifyType, mentions: Mentions)] = []
open var sendCallNotificationCallIdApplicationNotifyTypeMentionsClosure: ((String, RtcApplicationType, NotifyType, Mentions) async throws -> Void)?
open override func sendCallNotification(callId: String, application: RtcApplicationType, notifyType: NotifyType, mentions: Mentions) async throws {
if let error = sendCallNotificationCallIdApplicationNotifyTypeMentionsThrowableError {
throw error
}
sendCallNotificationCallIdApplicationNotifyTypeMentionsCallsCount += 1
sendCallNotificationCallIdApplicationNotifyTypeMentionsReceivedArguments = (callId: callId, application: application, notifyType: notifyType, mentions: mentions)
DispatchQueue.main.async {
self.sendCallNotificationCallIdApplicationNotifyTypeMentionsReceivedInvocations.append((callId: callId, application: application, notifyType: notifyType, mentions: mentions))
}
try await sendCallNotificationCallIdApplicationNotifyTypeMentionsClosure?(callId, application, notifyType, mentions)
}
//MARK: - sendCallNotificationIfNeeded
open var sendCallNotificationIfNeededThrowableError: Error?
var sendCallNotificationIfNeededUnderlyingCallsCount = 0
open var sendCallNotificationIfNeededCallsCount: Int {
get {
if Thread.isMainThread {
return sendCallNotificationIfNeededUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = sendCallNotificationIfNeededUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
sendCallNotificationIfNeededUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
sendCallNotificationIfNeededUnderlyingCallsCount = newValue
}
}
}
}
open var sendCallNotificationIfNeededCalled: Bool {
return sendCallNotificationIfNeededCallsCount > 0
}
var sendCallNotificationIfNeededUnderlyingReturnValue: Bool!
open var sendCallNotificationIfNeededReturnValue: Bool! {
get {
if Thread.isMainThread {
return sendCallNotificationIfNeededUnderlyingReturnValue
} else {
var returnValue: Bool? = nil
DispatchQueue.main.sync {
returnValue = sendCallNotificationIfNeededUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
sendCallNotificationIfNeededUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
sendCallNotificationIfNeededUnderlyingReturnValue = newValue
}
}
}
}
open var sendCallNotificationIfNeededClosure: (() async throws -> Bool)?
open override func sendCallNotificationIfNeeded() async throws -> Bool {
if let error = sendCallNotificationIfNeededThrowableError {
throw error
}
sendCallNotificationIfNeededCallsCount += 1
if let sendCallNotificationIfNeededClosure = sendCallNotificationIfNeededClosure {
return try await sendCallNotificationIfNeededClosure()
} else {
return sendCallNotificationIfNeededReturnValue
}
}
//MARK: - sendLiveLocation
open var sendLiveLocationGeoUriThrowableError: Error?
@@ -15766,6 +15768,52 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
try await setNameNameClosure?(name)
}
//MARK: - setThreadSubscription
open var setThreadSubscriptionThreadRootEventIdSubscribedThrowableError: Error?
var setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount = 0
open var setThreadSubscriptionThreadRootEventIdSubscribedCallsCount: Int {
get {
if Thread.isMainThread {
return setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount = newValue
}
}
}
}
open var setThreadSubscriptionThreadRootEventIdSubscribedCalled: Bool {
return setThreadSubscriptionThreadRootEventIdSubscribedCallsCount > 0
}
open var setThreadSubscriptionThreadRootEventIdSubscribedReceivedArguments: (threadRootEventId: String, subscribed: Bool)?
open var setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocations: [(threadRootEventId: String, subscribed: Bool)] = []
open var setThreadSubscriptionThreadRootEventIdSubscribedClosure: ((String, Bool) async throws -> Void)?
open override func setThreadSubscription(threadRootEventId: String, subscribed: Bool) async throws {
if let error = setThreadSubscriptionThreadRootEventIdSubscribedThrowableError {
throw error
}
setThreadSubscriptionThreadRootEventIdSubscribedCallsCount += 1
setThreadSubscriptionThreadRootEventIdSubscribedReceivedArguments = (threadRootEventId: threadRootEventId, subscribed: subscribed)
DispatchQueue.main.async {
self.setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocations.append((threadRootEventId: threadRootEventId, subscribed: subscribed))
}
try await setThreadSubscriptionThreadRootEventIdSubscribedClosure?(threadRootEventId, subscribed)
}
//MARK: - setTopic
open var setTopicTopicThrowableError: Error?
@@ -137,7 +137,6 @@ extension JoinedRoomProxyMock {
widgetDriver.startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReturnValue = .success(url)
elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
sendCallNotificationIfNeededReturnValue = .success(())
matrixToPermalinkReturnValue = .success(.homeDirectory)
matrixToEventPermalinkReturnValue = .success(.homeDirectory)
@@ -50,7 +50,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
switch configuration.kind {
case .genericCallLink(let url):
widgetDriver = GenericCallLinkWidgetDriver(url: url)
case .roomCall(let roomProxy, let clientProxy, _, _, _, _, _):
case .roomCall(let roomProxy, let clientProxy, _, _, _, _):
guard let deviceID = clientProxy.deviceID else { fatalError("Missing device ID for the call.") }
widgetDriver = roomProxy.elementCallWidgetDriver(deviceID: deviceID)
}
@@ -174,7 +174,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
state.url = url
// We need widget messaging to work before enabling CallKit, otherwise mute, hangup etc do nothing.
case .roomCall(let roomProxy, _, let clientID, let elementCallBaseURL, let elementCallBaseURLOverride, let colorScheme, let notifyOtherParticipants):
case .roomCall(let roomProxy, _, let clientID, let elementCallBaseURL, let elementCallBaseURLOverride, let colorScheme):
Task { [weak self] in
guard let self else { return }
@@ -217,10 +217,6 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
await elementCallService.setupCallSession(roomID: roomProxy.id,
roomDisplayName: roomProxy.infoPublisher.value.displayName ?? roomProxy.id)
if notifyOtherParticipants {
_ = await roomProxy.sendCallNotificationIfNeeded()
}
}
}
}
@@ -321,7 +321,6 @@ struct CallScreen_Previews: PreviewProvider {
clientProxy.deviceID = "call-device-id"
let roomProxy = JoinedRoomProxyMock()
roomProxy.sendCallNotificationIfNeededReturnValue = .success(())
let widgetDriver = ElementCallWidgetDriverMock()
widgetDriver.underlyingMessagePublisher = .init()
@@ -336,8 +335,7 @@ struct CallScreen_Previews: PreviewProvider {
clientID: "io.element.elementx",
elementCallBaseURL: "https://call.element.io",
elementCallBaseURLOverride: nil,
colorScheme: .light,
notifyOtherParticipants: false),
colorScheme: .light),
allowPictureInPicture: false,
appHooks: AppHooks(),
appSettings: ServiceLocator.shared.settings,
@@ -21,8 +21,7 @@ struct ElementCallConfiguration {
clientID: String,
elementCallBaseURL: URL,
elementCallBaseURLOverride: URL?,
colorScheme: ColorScheme,
notifyOtherParticipants: Bool)
colorScheme: ColorScheme)
}
/// The type of call being configured i.e. whether it's an external URL or an internal room call.
@@ -59,15 +58,13 @@ struct ElementCallConfiguration {
clientID: String,
elementCallBaseURL: URL,
elementCallBaseURLOverride: URL?,
colorScheme: ColorScheme,
notifyOtherParticipants: Bool) {
colorScheme: ColorScheme) {
kind = .roomCall(roomProxy: roomProxy,
clientProxy: clientProxy,
clientID: clientID,
elementCallBaseURL: elementCallBaseURL,
elementCallBaseURLOverride: elementCallBaseURLOverride,
colorScheme: colorScheme,
notifyOtherParticipants: notifyOtherParticipants)
colorScheme: colorScheme)
}
/// A string representing the call being configured.
@@ -75,7 +72,7 @@ struct ElementCallConfiguration {
switch kind {
case .genericCallLink(let url):
url.absoluteString
case .roomCall(let roomProxy, _, _, _, _, _, _):
case .roomCall(let roomProxy, _, _, _, _, _):
roomProxy.id
}
}
@@ -75,30 +75,32 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
return .failure(.roomInvalid)
}
let useEncryption = await (try? room.latestEncryptionState() == .encrypted) ?? false
async let useEncryption = (try? room.latestEncryptionState() == .encrypted) ?? false
async let isDirect = room.isDirect()
let widgetSettings: WidgetSettings
do {
widgetSettings = try newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString,
widgetId: widgetID,
parentUrl: nil,
header: .appBar,
hideHeader: true,
preload: nil,
fontScale: nil,
appPrompt: false,
confineToRoom: true,
font: nil,
encryption: useEncryption ? .perParticipantKeys : .unencrypted,
intent: .startCall,
hideScreensharing: false,
posthogUserId: nil,
posthogApiHost: analyticsConfiguration?.posthogAPIHost,
posthogApiKey: analyticsConfiguration?.posthogAPIKey,
rageshakeSubmitUrl: rageshakeURL,
sentryDsn: analyticsConfiguration?.sentryDSN,
sentryEnvironment: nil,
controlledMediaDevices: !ProcessInfo.processInfo.isiOSAppOnMac))
widgetSettings = try await newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString,
widgetId: widgetID,
parentUrl: nil,
header: .appBar,
hideHeader: true,
preload: nil,
fontScale: nil,
appPrompt: false,
confineToRoom: true,
font: nil,
encryption: useEncryption ? .perParticipantKeys : .unencrypted,
intent: .startCall,
hideScreensharing: false,
posthogUserId: nil,
posthogApiHost: analyticsConfiguration?.posthogAPIHost,
posthogApiKey: analyticsConfiguration?.posthogAPIKey,
rageshakeSubmitUrl: rageshakeURL,
sentryDsn: analyticsConfiguration?.sentryDSN,
sentryEnvironment: nil,
controlledMediaDevices: !ProcessInfo.processInfo.isiOSAppOnMac,
sendNotificationType: isDirect ? .ring : .notification))
} catch {
MXLog.error("Failed to build widget settings: \(error)")
return .failure(.failedBuildingWidgetSettings)
@@ -639,16 +639,6 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
ElementCallWidgetDriver(room: room, deviceID: deviceID)
}
func sendCallNotificationIfNeeded() async -> Result<Void, RoomProxyError> {
do {
_ = try await room.sendCallNotificationIfNeeded()
return .success(())
} catch {
MXLog.error("Failed room call notification with error: \(error)")
return .failure(.sdkError(error))
}
}
// MARK: - Permalinks
func matrixToPermalink() async -> Result<URL, RoomProxyError> {
@@ -168,7 +168,6 @@ protocol JoinedRoomProxyProtocol: RoomProxyProtocol {
// MARK: - Element Call
func elementCallWidgetDriver(deviceID: String) -> ElementCallWidgetDriverProtocol
func sendCallNotificationIfNeeded() async -> Result<Void, RoomProxyError>
// MARK: - Permalinks
+2 -2
View File
@@ -68,7 +68,7 @@ packages:
# Element/Matrix dependencies
MatrixRustSDK:
url: https://github.com/element-hq/matrix-rust-components-swift
exactVersion: 25.07.29
exactVersion: 25.08.01
# path: ../matrix-rust-sdk
Compound:
url: https://github.com/element-hq/compound-ios
@@ -80,7 +80,7 @@ packages:
# path: ../matrix-analytics-events
EmbeddedElementCall:
url: https://github.com/element-hq/element-call-swift
exactVersion: 0.13.1
exactVersion: 0.14.0
Emojibase:
url: https://github.com/matrix-org/emojibase-bindings
minorVersion: 1.4.2