mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
EC update and improvements
Use .startCall intent, and always pass rageshakeURL to the widget Updated EC to 0.9.0-rc.4 rageshakeURL is now a parameter
This commit is contained in:
@@ -8585,7 +8585,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/element-call-swift";
|
repositoryURL = "https://github.com/element-hq/element-call-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = "0.9.0-rc.3";
|
version = "0.9.0-rc.4";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {
|
||||||
|
|||||||
@@ -59,8 +59,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/element-call-swift",
|
"location" : "https://github.com/element-hq/element-call-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "101bdac7a5f9c53f702065bac7772e9dedb26c62",
|
"revision" : "88836b6add336f7d5a1c83266dfc725ae444b69b",
|
||||||
"version" : "0.9.0-rc.3"
|
"version" : "0.9.0-rc.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5989,15 +5989,15 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
|
|||||||
|
|
||||||
//MARK: - start
|
//MARK: - start
|
||||||
|
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = 0
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = 0
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount: Int {
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationCallsCount: Int {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount
|
return startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingCallsCount
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Int? = nil
|
var returnValue: Int? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount
|
returnValue = startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingCallsCount
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -6005,29 +6005,29 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = newValue
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingCallsCount = newValue
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingCallsCount = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationCalled: Bool {
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationCalled: Bool {
|
||||||
return startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount > 0
|
return startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationCallsCount > 0
|
||||||
}
|
}
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?)?
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReceivedArguments: (baseURL: URL, clientID: String, colorScheme: ColorScheme, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)?
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] = []
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReceivedInvocations: [(baseURL: URL, clientID: String, colorScheme: ColorScheme, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?)] = []
|
||||||
|
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue: Result<URL, ElementCallWidgetDriverError>!
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingReturnValue: Result<URL, ElementCallWidgetDriverError>!
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue: Result<URL, ElementCallWidgetDriverError>! {
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReturnValue: Result<URL, ElementCallWidgetDriverError>! {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue
|
return startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingReturnValue
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Result<URL, ElementCallWidgetDriverError>? = nil
|
var returnValue: Result<URL, ElementCallWidgetDriverError>? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue
|
returnValue = startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingReturnValue
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -6035,26 +6035,26 @@ class ElementCallWidgetDriverMock: ElementCallWidgetDriverProtocol, @unchecked S
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue = newValue
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingReturnValue = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationUnderlyingReturnValue = newValue
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationUnderlyingReturnValue = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure: ((URL, String, ColorScheme, ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError>)?
|
var startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationClosure: ((URL, String, ColorScheme, String?, ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError>)?
|
||||||
|
|
||||||
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
|
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, rageshakeURL: String?, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationCallsCount += 1
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationCallsCount += 1
|
||||||
startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedArguments = (baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, analyticsConfiguration: analyticsConfiguration)
|
startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReceivedArguments = (baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, rageshakeURL: rageshakeURL, analyticsConfiguration: analyticsConfiguration)
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.startBaseURLClientIDColorSchemeAnalyticsConfigurationReceivedInvocations.append((baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, analyticsConfiguration: analyticsConfiguration))
|
self.startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReceivedInvocations.append((baseURL: baseURL, clientID: clientID, colorScheme: colorScheme, rageshakeURL: rageshakeURL, analyticsConfiguration: analyticsConfiguration))
|
||||||
}
|
}
|
||||||
if let startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure = startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure {
|
if let startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationClosure = startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationClosure {
|
||||||
return await startBaseURLClientIDColorSchemeAnalyticsConfigurationClosure(baseURL, clientID, colorScheme, analyticsConfiguration)
|
return await startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationClosure(baseURL, clientID, colorScheme, rageshakeURL, analyticsConfiguration)
|
||||||
} else {
|
} else {
|
||||||
return startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue
|
return startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReturnValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//MARK: - handleMessage
|
//MARK: - handleMessage
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ extension JoinedRoomProxyMock {
|
|||||||
fatalError()
|
fatalError()
|
||||||
}
|
}
|
||||||
|
|
||||||
widgetDriver.startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue = .success(url)
|
widgetDriver.startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReturnValue = .success(url)
|
||||||
|
|
||||||
elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
|
elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
|
||||||
sendCallNotificationIfNeededReturnValue = .success(())
|
sendCallNotificationIfNeededReturnValue = .success(())
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
|||||||
state.url = url
|
state.url = url
|
||||||
// We need widget messaging to work before enabling CallKit, otherwise mute, hangup etc do nothing.
|
// We need widget messaging to work before enabling CallKit, otherwise mute, hangup etc do nothing.
|
||||||
|
|
||||||
case .roomCall(let roomProxy, let clientProxy, let clientID, let elementCallBaseURL, let elementCallBaseURLOverride, let colorScheme, let notifyOtherParticipants):
|
case .roomCall(let roomProxy, _, let clientID, let elementCallBaseURL, let elementCallBaseURLOverride, let colorScheme, let notifyOtherParticipants):
|
||||||
Task { [weak self] in
|
Task { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
|
|
||||||
@@ -155,11 +155,11 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
|||||||
// We only set the analytics configuration if analytics are enabled
|
// We only set the analytics configuration if analytics are enabled
|
||||||
let analyticsConfiguration = analyticsService.isEnabled ? ElementCallAnalyticsConfiguration(posthogAPIHost: appSettings.elementCallPosthogAPIHost,
|
let analyticsConfiguration = analyticsService.isEnabled ? ElementCallAnalyticsConfiguration(posthogAPIHost: appSettings.elementCallPosthogAPIHost,
|
||||||
posthogAPIKey: appSettings.elementCallPosthogAPIKey,
|
posthogAPIKey: appSettings.elementCallPosthogAPIKey,
|
||||||
rageshakeSubmitURL: Secrets.rageshakeServerURL,
|
|
||||||
sentryDSN: appSettings.elementCallPosthogSentryDSN) : nil
|
sentryDSN: appSettings.elementCallPosthogSentryDSN) : nil
|
||||||
switch await widgetDriver.start(baseURL: baseURL,
|
switch await widgetDriver.start(baseURL: baseURL,
|
||||||
clientID: clientID,
|
clientID: clientID,
|
||||||
colorScheme: colorScheme,
|
colorScheme: colorScheme,
|
||||||
|
rageshakeURL: Secrets.rageshakeServerURL,
|
||||||
analyticsConfiguration: analyticsConfiguration) {
|
analyticsConfiguration: analyticsConfiguration) {
|
||||||
case .success(let url):
|
case .success(let url):
|
||||||
state.url = url
|
state.url = url
|
||||||
|
|||||||
@@ -301,7 +301,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.startBaseURLClientIDColorSchemeAnalyticsConfigurationReturnValue = .success(URL.userDirectory)
|
widgetDriver.startBaseURLClientIDColorSchemeRageshakeURLAnalyticsConfigurationReturnValue = .success(URL.userDirectory)
|
||||||
|
|
||||||
roomProxy.elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
|
roomProxy.elementCallWidgetDriverDeviceIDReturnValue = widgetDriver
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,11 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
|
|||||||
self.deviceID = deviceID
|
self.deviceID = deviceID
|
||||||
}
|
}
|
||||||
|
|
||||||
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
|
func start(baseURL: URL,
|
||||||
|
clientID: String,
|
||||||
|
colorScheme: ColorScheme,
|
||||||
|
rageshakeURL: String?,
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
@@ -85,12 +89,12 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
|
|||||||
confineToRoom: true,
|
confineToRoom: true,
|
||||||
font: nil,
|
font: nil,
|
||||||
encryption: useEncryption ? .perParticipantKeys : .unencrypted,
|
encryption: useEncryption ? .perParticipantKeys : .unencrypted,
|
||||||
intent: nil,
|
intent: .startCall,
|
||||||
hideScreensharing: false,
|
hideScreensharing: false,
|
||||||
posthogUserId: nil,
|
posthogUserId: nil,
|
||||||
posthogApiHost: analyticsConfiguration?.posthogAPIHost,
|
posthogApiHost: analyticsConfiguration?.posthogAPIHost,
|
||||||
posthogApiKey: analyticsConfiguration?.posthogAPIKey,
|
posthogApiKey: analyticsConfiguration?.posthogAPIKey,
|
||||||
rageshakeSubmitUrl: analyticsConfiguration?.rageshakeSubmitURL,
|
rageshakeSubmitUrl: rageshakeURL,
|
||||||
sentryDsn: analyticsConfiguration?.sentryDSN,
|
sentryDsn: analyticsConfiguration?.sentryDSN,
|
||||||
sentryEnvironment: nil))
|
sentryEnvironment: nil))
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -29,7 +29,11 @@ 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, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError>
|
func start(baseURL: URL,
|
||||||
|
clientID: String,
|
||||||
|
colorScheme: ColorScheme,
|
||||||
|
rageshakeURL: String?,
|
||||||
|
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>
|
||||||
@@ -38,6 +42,5 @@ protocol ElementCallWidgetDriverProtocol {
|
|||||||
struct ElementCallAnalyticsConfiguration {
|
struct ElementCallAnalyticsConfiguration {
|
||||||
let posthogAPIHost: String
|
let posthogAPIHost: String
|
||||||
let posthogAPIKey: String
|
let posthogAPIKey: String
|
||||||
let rageshakeSubmitURL: String
|
|
||||||
let sentryDSN: String
|
let sentryDSN: String
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ class GenericCallLinkWidgetDriver: ElementCallWidgetDriverProtocol {
|
|||||||
self.url = url
|
self.url = url
|
||||||
}
|
}
|
||||||
|
|
||||||
func start(baseURL: URL, clientID: String, colorScheme: ColorScheme, analyticsConfiguration: ElementCallAnalyticsConfiguration?) async -> Result<URL, ElementCallWidgetDriverError> {
|
func start(baseURL: URL,
|
||||||
|
clientID: String,
|
||||||
|
colorScheme: ColorScheme,
|
||||||
|
rageshakeURL: String?,
|
||||||
|
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
@@ -83,7 +83,7 @@ packages:
|
|||||||
# path: ../matrix-rich-text-editor/platforms/ios/lib/WysiwygComposer
|
# path: ../matrix-rich-text-editor/platforms/ios/lib/WysiwygComposer
|
||||||
EmbeddedElementCall:
|
EmbeddedElementCall:
|
||||||
url: https://github.com/element-hq/element-call-swift
|
url: https://github.com/element-hq/element-call-swift
|
||||||
exactVersion: 0.9.0-rc.3
|
exactVersion: 0.9.0-rc.4
|
||||||
|
|
||||||
# External dependencies
|
# External dependencies
|
||||||
Algorithms:
|
Algorithms:
|
||||||
|
|||||||
Reference in New Issue
Block a user