mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
feat(healthchat): ring calls via gateway VoIP push
CallKit rejects the NSE hand-off without the filtering entitlement.
This commit is contained in:
@@ -30,6 +30,10 @@ nonisolated protocol CommonSettingsProtocol: AnyObject, Sendable {
|
||||
var enableOnlySignedDeviceIsolationMode: Bool { get }
|
||||
var threadsEnabled: Bool { get }
|
||||
var hideQuietNotificationAlerts: Bool { get }
|
||||
|
||||
var voipPusherAppID: String { get }
|
||||
var pushKitDeviceToken: String? { get }
|
||||
var voipPushGatewayNotifyURL: String? { get }
|
||||
}
|
||||
|
||||
nonisolated enum AppBuildType {
|
||||
@@ -244,6 +248,28 @@ final nonisolated class AppSettings: @unchecked Sendable {
|
||||
pushGatewayBaseURL.appending(path: "_matrix/push/v1/notify")
|
||||
}
|
||||
|
||||
// HealthChat: the NSE lacks the notification filtering entitlement, so it cannot hand ringing
|
||||
// calls to CallKit directly. Instead it asks the push gateway for a PushKit (VoIP) push, the
|
||||
// way the legacy element-ios app did. The app persists what the NSE needs for that request
|
||||
// here, because the NSE neither receives PushKit credentials nor runs the app settings hook.
|
||||
|
||||
/// The push gateway app ID that delivers PushKit pushes (`push_type: voip` in Sygnal).
|
||||
var voipPusherAppID: String {
|
||||
#if DEBUG
|
||||
InfoPlistReader.main.baseBundleIdentifier + ".ios.voip.dev"
|
||||
#else
|
||||
InfoPlistReader.main.baseBundleIdentifier + ".ios.voip.prod"
|
||||
#endif
|
||||
}
|
||||
|
||||
/// The device's PushKit token, base64 encoded like the APNs pushkey.
|
||||
@UserPreference
|
||||
var pushKitDeviceToken: String?
|
||||
|
||||
/// `pushGatewayNotifyEndpoint` as configured in the app, for the NSE.
|
||||
@UserPreference
|
||||
var voipPushGatewayNotifyURL: String?
|
||||
|
||||
@UserPreference(defaultValue: true)
|
||||
var enableNotifications: Bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user