updated the SDK to 25.03.24

This commit is contained in:
Mauro Romito
2025-03-19 12:38:21 +01:00
committed by Mauro
parent 24777184ef
commit cfd4392837
17 changed files with 99 additions and 68 deletions
+1 -1
View File
@@ -8565,7 +8565,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = { requirement = {
kind = exactVersion; kind = exactVersion;
version = 25.03.21; version = 25.03.24;
}; };
}; };
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
@@ -149,8 +149,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift", "location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : { "state" : {
"revision" : "93b8303fa004060c8ba6a856e0b66a1d47514490", "revision" : "0da89f2a2ddaf2306144f42aed642af3f3228a1c",
"version" : "25.3.21" "version" : "25.3.24"
} }
}, },
{ {
@@ -267,7 +267,12 @@ final class AppSettings {
// MARK: - Element Call // MARK: - Element Call
let elementCallBaseURL: URL = "https://call.element.io" let elementCallBaseURL: URL = "https://call.element.io/room"
// These are publicly availble on https://call.element.io so we don't neeed to treat them as secrets
let elementCallPosthogAPIHost = "https://posthog-element-call.element.io"
let elementCallPosthogAPIKey = "phc_rXGHx9vDmyEvyRxPziYtdVIv0ahEv8A9uLWFcCi1WcU"
let elementCallPosthogSentryDSN = "https://3bd2f95ba5554d4497da7153b552ffb5@sentry.tools.element.io/41"
@UserPreference(key: UserDefaultsKeys.elementCallBaseURLOverride, defaultValue: nil, storageType: .userDefaults(store)) @UserPreference(key: UserDefaultsKeys.elementCallBaseURLOverride, defaultValue: nil, storageType: .userDefaults(store))
var elementCallBaseURLOverride: URL? var elementCallBaseURLOverride: URL?
@@ -5989,15 +5989,15 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
//MARK: - start //MARK: - start
var startBaseURLClientIDColorSchemeUnderlyingCallsCount = 0 var startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = 0
var startBaseURLClientIDColorSchemeCallsCount: Int { var startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount: Int {
get { get {
if Thread.isMainThread { if Thread.isMainThread {
return startBaseURLClientIDColorSchemeUnderlyingCallsCount return startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount
} else { } else {
var returnValue: Int? = nil var returnValue: Int? = nil
DispatchQueue.main.sync { DispatchQueue.main.sync {
returnValue = startBaseURLClientIDColorSchemeUnderlyingCallsCount returnValue = startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount
} }
return returnValue! return returnValue!
@@ -6005,29 +6005,29 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
} }
set { set {
if Thread.isMainThread { if Thread.isMainThread {
startBaseURLClientIDColorSchemeUnderlyingCallsCount = newValue startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = newValue
} else { } else {
DispatchQueue.main.sync { DispatchQueue.main.sync {
startBaseURLClientIDColorSchemeUnderlyingCallsCount = newValue startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = newValue
} }
} }
} }
} }
var startBaseURLClientIDColorSchemeCalled: Bool { var startBaseURLClientIDColorSchemeAnalyticsConfigurationCalled: Bool {
return startBaseURLClientIDColorSchemeCallsCount > 0 return startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount > 0
} }
var startBaseURLClientIDColorSchemeReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme)? var startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?)?
var startBaseURLClientIDColorSchemeReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme)] = [] var startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] = []
var startBaseURLClientIDColorSchemeUnderlyingReturnValue: Result<URL, ElementCallWidgetDriverError>! var startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue: Result<URL, ElementCallWidgetDriverError>!
var startBaseURLClientIDColorSchemeReturnValue: Result<URL, ElementCallWidgetDriverError>! { var startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue: Result<URL, ElementCallWidgetDriverError>! {
get { get {
if Thread.isMainThread { if Thread.isMainThread {
return startBaseURLClientIDColorSchemeUnderlyingReturnValue return startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue
} else { } else {
var returnValue: Result<URL, ElementCallWidgetDriverError>? = nil var returnValue: Result<URL, ElementCallWidgetDriverError>? = nil
DispatchQueue.main.sync { DispatchQueue.main.sync {
returnValue = startBaseURLClientIDColorSchemeUnderlyingReturnValue returnValue = startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue
} }
return returnValue! return returnValue!
@@ -6035,26 +6035,26 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
} }
set { set {
if Thread.isMainThread { if Thread.isMainThread {
startBaseURLClientIDColorSchemeUnderlyingReturnValue = newValue startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue = newValue
} else { } else {
DispatchQueue.main.sync { DispatchQueue.main.sync {
startBaseURLClientIDColorSchemeUnderlyingReturnValue = newValue startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue = newValue
} }
} }
} }
} }
var startBaseURLClientIDColorSchemeClosure: ((URL, String, ColorScheme) async -> Result<URL, ElementCallWidgetDriverError>)? var startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure: ((URL, String, ColorScheme, ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError>)?
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme) async -> Result<URL, ElementCallWidgetDriverError> { func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
startBaseURLClientIDColorSchemeCallsCount += 1 startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount += 1
startBaseURLClientIDColorSchemeReceivedArguments = (baseURL: baseURL, clientID: clientID, colorScheme: colorScheme) startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedArguments = (baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, analyticsConfiguration: analyticsConfiguration)
DispatchQueue.main.async { DispatchQueue.main.async {
self.startBaseURLClientIDColorSchemeReceivedInvocations.append((baseURL: baseURL, clientID: clientID, colorScheme: colorScheme)) self.startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedInvocations.append((baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, analyticsConfiguration: analyticsConfiguration))
} }
if let startBaseURLClientIDColorSchemeClosure = startBaseURLClientIDColorSchemeClosure { if let startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure = startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure {
return await startBaseURLClientIDColorSchemeClosure(baseURL, clientID, colorScheme) return await startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure(baseURL, clientID, colorScheme, analyticsConfiguration)
} else { } else {
return startBaseURLClientIDColorSchemeReturnValue return startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue
} }
} }
//MARK: - handleMessage //MARK: - handleMessage
@@ -2567,16 +2567,16 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
//MARK: - loginWithOidcCallback //MARK: - loginWithOidcCallback
open var loginWithOidcCallbackAuthorizationDataCallbackUrlThrowableError: Error? open var loginWithOidcCallbackCallbackUrlThrowableError: Error?
var loginWithOidcCallbackAuthorizationDataCallbackUrlUnderlyingCallsCount = 0 var loginWithOidcCallbackCallbackUrlUnderlyingCallsCount = 0
open var loginWithOidcCallbackAuthorizationDataCallbackUrlCallsCount: Int { open var loginWithOidcCallbackCallbackUrlCallsCount: Int {
get { get {
if Thread.isMainThread { if Thread.isMainThread {
return loginWithOidcCallbackAuthorizationDataCallbackUrlUnderlyingCallsCount return loginWithOidcCallbackCallbackUrlUnderlyingCallsCount
} else { } else {
var returnValue: Int? = nil var returnValue: Int? = nil
DispatchQueue.main.sync { DispatchQueue.main.sync {
returnValue = loginWithOidcCallbackAuthorizationDataCallbackUrlUnderlyingCallsCount returnValue = loginWithOidcCallbackCallbackUrlUnderlyingCallsCount
} }
return returnValue! return returnValue!
@@ -2584,31 +2584,31 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
} }
set { set {
if Thread.isMainThread { if Thread.isMainThread {
loginWithOidcCallbackAuthorizationDataCallbackUrlUnderlyingCallsCount = newValue loginWithOidcCallbackCallbackUrlUnderlyingCallsCount = newValue
} else { } else {
DispatchQueue.main.sync { DispatchQueue.main.sync {
loginWithOidcCallbackAuthorizationDataCallbackUrlUnderlyingCallsCount = newValue loginWithOidcCallbackCallbackUrlUnderlyingCallsCount = newValue
} }
} }
} }
} }
open var loginWithOidcCallbackAuthorizationDataCallbackUrlCalled: Bool { open var loginWithOidcCallbackCallbackUrlCalled: Bool {
return loginWithOidcCallbackAuthorizationDataCallbackUrlCallsCount > 0 return loginWithOidcCallbackCallbackUrlCallsCount > 0
} }
open var loginWithOidcCallbackAuthorizationDataCallbackUrlReceivedArguments: (authorizationData: OAuthAuthorizationData, callbackUrl: String)? open var loginWithOidcCallbackCallbackUrlReceivedCallbackUrl: String?
open var loginWithOidcCallbackAuthorizationDataCallbackUrlReceivedInvocations: [(authorizationData: OAuthAuthorizationData, callbackUrl: String)] = [] open var loginWithOidcCallbackCallbackUrlReceivedInvocations: [String] = []
open var loginWithOidcCallbackAuthorizationDataCallbackUrlClosure: ((OAuthAuthorizationData, String) async throws -> Void)? open var loginWithOidcCallbackCallbackUrlClosure: ((String) async throws -> Void)?
open override func loginWithOidcCallback(authorizationData: OAuthAuthorizationData, callbackUrl: String) async throws { open override func loginWithOidcCallback(callbackUrl: String) async throws {
if let error = loginWithOidcCallbackAuthorizationDataCallbackUrlThrowableError { if let error = loginWithOidcCallbackCallbackUrlThrowableError {
throw error throw error
} }
loginWithOidcCallbackAuthorizationDataCallbackUrlCallsCount += 1 loginWithOidcCallbackCallbackUrlCallsCount += 1
loginWithOidcCallbackAuthorizationDataCallbackUrlReceivedArguments = (authorizationData: authorizationData, callbackUrl: callbackUrl) loginWithOidcCallbackCallbackUrlReceivedCallbackUrl = callbackUrl
DispatchQueue.main.async { DispatchQueue.main.async {
self.loginWithOidcCallbackAuthorizationDataCallbackUrlReceivedInvocations.append((authorizationData: authorizationData, callbackUrl: callbackUrl)) self.loginWithOidcCallbackCallbackUrlReceivedInvocations.append(callbackUrl)
} }
try await loginWithOidcCallbackAuthorizationDataCallbackUrlClosure?(authorizationData, callbackUrl) try await loginWithOidcCallbackCallbackUrlClosure?(callbackUrl)
} }
//MARK: - logout //MARK: - logout
@@ -119,7 +119,7 @@ extension JoinedRoomProxyMock {
fatalError() fatalError()
} }
widgetDriver.startBaseURLClientIDColorSchemeReturnValue = .success(url) widgetDriver.startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue = .success(url)
elementCallWidgetDriverDeviceIDReturnValue = widgetDriver elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
sendCallNotificationIfNeededReturnValue = .success(()) sendCallNotificationIfNeededReturnValue = .success(())
@@ -47,7 +47,7 @@ class OIDCAuthenticationPresenter: NSObject {
return .failure(.oidcError(.unknown)) return .failure(.oidcError(.unknown))
} }
switch await authenticationService.loginWithOIDCCallback(url, data: oidcData) { switch await authenticationService.loginWithOIDCCallback(url) {
case .success(let userSession): case .success(let userSession):
return .success(userSession) return .success(userSession)
case .failure(let error): case .failure(let error):
@@ -43,7 +43,9 @@ final class CallScreenCoordinator: CoordinatorProtocol {
viewModel = CallScreenViewModel(elementCallService: parameters.elementCallService, viewModel = CallScreenViewModel(elementCallService: parameters.elementCallService,
configuration: parameters.configuration, configuration: parameters.configuration,
allowPictureInPicture: parameters.allowPictureInPicture, allowPictureInPicture: parameters.allowPictureInPicture,
appHooks: parameters.appHooks) appHooks: parameters.appHooks,
appSettings: ServiceLocator.shared.settings,
analyticsService: ServiceLocator.shared.analytics)
} }
func start() { func start() {
@@ -16,6 +16,8 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
private let elementCallService: ElementCallServiceProtocol private let elementCallService: ElementCallServiceProtocol
private let configuration: ElementCallConfiguration private let configuration: ElementCallConfiguration
private let isPictureInPictureAllowed: Bool private let isPictureInPictureAllowed: Bool
private let appSettings: AppSettings
private let analyticsService: AnalyticsService
private let widgetDriver: ElementCallWidgetDriverProtocol private let widgetDriver: ElementCallWidgetDriverProtocol
@@ -33,9 +35,13 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
init(elementCallService: ElementCallServiceProtocol, init(elementCallService: ElementCallServiceProtocol,
configuration: ElementCallConfiguration, configuration: ElementCallConfiguration,
allowPictureInPicture: Bool, allowPictureInPicture: Bool,
appHooks: AppHooks) { appHooks: AppHooks,
appSettings: AppSettings,
analyticsService: AnalyticsService) {
self.elementCallService = elementCallService self.elementCallService = elementCallService
self.configuration = configuration self.configuration = configuration
self.appSettings = appSettings
self.analyticsService = analyticsService
isPictureInPictureAllowed = allowPictureInPicture isPictureInPictureAllowed = allowPictureInPicture
switch configuration.kind { switch configuration.kind {
@@ -148,7 +154,15 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
elementCallBaseURL elementCallBaseURL
} }
switch await widgetDriver.start(baseURL: baseURL, clientID: clientID, colorScheme: colorScheme) { // We only set the analytics configuration if analytics are enabled
let analyticsConfiguration = analyticsService.isEnabled ? ElementCallAnalyticsConfiguration(posthogAPIHost: appSettings.elementCallPosthogAPIHost,
posthogAPIKey: appSettings.elementCallPosthogAPIKey,
rageshakeSubmitURL: Secrets.rageshakeServerURL,
sentryDSN: appSettings.elementCallPosthogSentryDSN) : nil
switch await widgetDriver.start(baseURL: baseURL,
clientID: clientID,
colorScheme: colorScheme,
analyticsConfiguration: analyticsConfiguration) {
case .success(let url): case .success(let url):
state.url = url state.url = url
case .failure(let error): case .failure(let error):
@@ -286,7 +286,7 @@ struct CallScreen_Previews: PreviewProvider {
let widgetDriver = ElementCallWidgetDriverMock() let widgetDriver = ElementCallWidgetDriverMock()
widgetDriver.underlyingMessagePublisher = .init() widgetDriver.underlyingMessagePublisher = .init()
widgetDriver.underlyingActions = PassthroughSubject<ElementCallWidgetDriverAction, Never>().eraseToAnyPublisher() widgetDriver.underlyingActions = PassthroughSubject<ElementCallWidgetDriverAction, Never>().eraseToAnyPublisher()
widgetDriver.startBaseURLClientIDColorSchemeReturnValue = .success(URL.userDirectory) widgetDriver.startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue = .success(URL.userDirectory)
roomProxy.elementCallWidgetDriverDeviceIDReturnValue = widgetDriver roomProxy.elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
@@ -299,7 +299,9 @@ struct CallScreen_Previews: PreviewProvider {
colorScheme: .light, colorScheme: .light,
notifyOtherParticipants: false), notifyOtherParticipants: false),
allowPictureInPicture: false, allowPictureInPicture: false,
appHooks: AppHooks()) appHooks: AppHooks(),
appSettings: ServiceLocator.shared.settings,
analyticsService: ServiceLocator.shared.analytics)
}() }()
static var previews: some View { static var previews: some View {
@@ -106,10 +106,10 @@ class AuthenticationService: AuthenticationServiceProtocol {
await client.abortOidcAuth(authorizationData: data.underlyingData) await client.abortOidcAuth(authorizationData: data.underlyingData)
} }
func loginWithOIDCCallback(_ callbackURL: URL, data: OIDCAuthorizationDataProxy) async -> Result<UserSessionProtocol, AuthenticationServiceError> { func loginWithOIDCCallback(_ callbackURL: URL) async -> Result<UserSessionProtocol, AuthenticationServiceError> {
guard let client else { return .failure(.failedLoggingIn) } guard let client else { return .failure(.failedLoggingIn) }
do { do {
try await client.loginWithOidcCallback(authorizationData: data.underlyingData, callbackUrl: callbackURL.absoluteString) try await client.loginWithOidcCallback(callbackUrl: callbackURL.absoluteString)
return await userSession(for: client) return await userSession(for: client)
} catch OidcError.Cancelled { } catch OidcError.Cancelled {
return .failure(.oidcError(.userCancellation)) return .failure(.oidcError(.userCancellation))
@@ -45,7 +45,7 @@ protocol AuthenticationServiceProtocol {
/// Asks the SDK to abort an ongoing OIDC login if we didn't get a callback to complete the request with. /// Asks the SDK to abort an ongoing OIDC login if we didn't get a callback to complete the request with.
func abortOIDCLogin(data: OIDCAuthorizationDataProxy) async func abortOIDCLogin(data: OIDCAuthorizationDataProxy) async
/// Completes an OIDC login that was started using ``urlForOIDCLogin``. /// Completes an OIDC login that was started using ``urlForOIDCLogin``.
func loginWithOIDCCallback(_ callbackURL: URL, data: OIDCAuthorizationDataProxy) async -> Result<UserSessionProtocol, AuthenticationServiceError> func loginWithOIDCCallback(_ callbackURL: URL) async -> Result<UserSessionProtocol, AuthenticationServiceError>
/// Performs a password login using the current homeserver. /// Performs a password login using the current homeserver.
func login(username: String, password: String, initialDeviceName: String?, deviceID: String?) async -> Result<UserSessionProtocol, AuthenticationServiceError> func login(username: String, password: String, initialDeviceName: String?, deviceID: String?) async -> Result<UserSessionProtocol, AuthenticationServiceError>
/// Completes registration using the credentials obtained via the helper URL. /// Completes registration using the credentials obtained via the helper URL.
@@ -50,6 +50,7 @@ struct ElementCallWidgetMessage: Codable {
class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriverProtocol { class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriverProtocol {
private let room: RoomProtocol private let room: RoomProtocol
private let deviceID: String private let deviceID: String
private var widgetDriver: WidgetDriverAndHandle? private var widgetDriver: WidgetDriverAndHandle?
let widgetID = UUID().uuidString let widgetID = UUID().uuidString
@@ -65,14 +66,14 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
self.deviceID = deviceID self.deviceID = deviceID
} }
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme) async -> Result<URL, ElementCallWidgetDriverError> { func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
guard let room = room as? Room else { guard let room = room as? Room else {
return .failure(.roomInvalid) return .failure(.roomInvalid)
} }
let useEncryption = await (try? room.latestEncryptionState() == .encrypted) ?? false let useEncryption = await (try? room.latestEncryptionState() == .encrypted) ?? false
let widgetSettings: WidgetSettings let widgetSettings: WidgetSettings
do { do {
widgetSettings = try newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString, widgetSettings = try newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString,
widgetId: widgetID, widgetId: widgetID,
@@ -84,13 +85,13 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
confineToRoom: true, confineToRoom: true,
font: nil, font: nil,
encryption: useEncryption ? .perParticipantKeys : .unencrypted, encryption: useEncryption ? .perParticipantKeys : .unencrypted,
intent: .startCall, intent: nil,
hideScreensharing: false, // The web view will hide it automatically hideScreensharing: false,
posthogUserId: nil, posthogUserId: nil,
posthogApiHost: nil, posthogApiHost: analyticsConfiguration?.posthogAPIHost,
posthogApiKey: nil, posthogApiKey: analyticsConfiguration?.posthogAPIKey,
rageshakeSubmitUrl: nil, rageshakeSubmitUrl: analyticsConfiguration?.rageshakeSubmitURL,
sentryDsn: nil, sentryDsn: analyticsConfiguration?.sentryDSN,
sentryEnvironment: nil)) sentryEnvironment: nil))
} catch { } catch {
MXLog.error("Failed to build widget settings: \(error)") MXLog.error("Failed to build widget settings: \(error)")
@@ -29,8 +29,15 @@ protocol ElementCallWidgetDriverProtocol {
var messagePublisher: PassthroughSubject<String, Never> { get } var messagePublisher: PassthroughSubject<String, Never> { get }
var actions: AnyPublisher<ElementCallWidgetDriverAction, Never> { get } var actions: AnyPublisher<ElementCallWidgetDriverAction, Never> { get }
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme) async -> Result<URL, ElementCallWidgetDriverError> func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError>
/// Passes a message from the Widget to the SDK to handle, returning a Bool that represents whether or not the widget driver is still running. /// Passes a message from the Widget to the SDK to handle, returning a Bool that represents whether or not the widget driver is still running.
func handleMessage(_ message: String) async -> Result<Bool, ElementCallWidgetDriverError> func handleMessage(_ message: String) async -> Result<Bool, ElementCallWidgetDriverError>
} }
struct ElementCallAnalyticsConfiguration {
let posthogAPIHost: String
let posthogAPIKey: String
let rageshakeSubmitURL: String
let sentryDSN: String
}
@@ -23,7 +23,7 @@ class GenericCallLinkWidgetDriver: ElementCallWidgetDriverProtocol {
self.url = url self.url = url
} }
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme) async -> Result<URL, ElementCallWidgetDriverError> { func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
MXLog.error("Nothing to start, use the configuration's URL directly instead.") MXLog.error("Nothing to start, use the configuration's URL directly instead.")
return .success(url) return .success(url)
} }
+1 -1
View File
@@ -68,7 +68,7 @@ struct BuildSDK: ParsableCommand {
/// but only when the ``target`` option hasn't been supplied. /// but only when the ``target`` option hasn't been supplied.
func checkRustupTargets() throws { func checkRustupTargets() throws {
guard target.isEmpty, device == 0, simulator == 0 else { return } guard target.isEmpty, device == 0, simulator == 0 else { return }
guard let output = try Zsh.run(command: "rustup show") else { throw Error.rustupOutputFailure } guard let output = try Zsh.run(command: "rustup target list --toolchain stable --installed") else { throw Error.rustupOutputFailure }
var requiredTargets = Target.allCases.reduce(into: [String: Bool]()) { partialResult, target in var requiredTargets = Target.allCases.reduce(into: [String: Bool]()) { partialResult, target in
partialResult[target.rawValue] = false partialResult[target.rawValue] = false
+1 -1
View File
@@ -59,7 +59,7 @@ packages:
# Element/Matrix dependencies # Element/Matrix dependencies
MatrixRustSDK: MatrixRustSDK:
url: https://github.com/element-hq/matrix-rust-components-swift url: https://github.com/element-hq/matrix-rust-components-swift
exactVersion: 25.03.21 exactVersion: 25.03.24
# path: ../matrix-rust-sdk # path: ../matrix-rust-sdk
Compound: Compound:
url: https://github.com/element-hq/compound-ios url: https://github.com/element-hq/compound-ios