mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +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:
@@ -26,7 +26,9 @@ final class ElementCallServiceTests {
|
||||
let dateProvider: () -> Date = {
|
||||
self.currentDate
|
||||
}
|
||||
service = ElementCallService(callProvider: callProvider, timeProvider: TimeProvider(clock: clock, now: dateProvider))
|
||||
service = ElementCallService(callProvider: callProvider,
|
||||
timeProvider: TimeProvider(clock: clock, now: dateProvider),
|
||||
appSettings: AppSettings.volatile())
|
||||
}
|
||||
|
||||
isolated deinit {
|
||||
@@ -57,6 +59,21 @@ final class ElementCallServiceTests {
|
||||
}
|
||||
}
|
||||
|
||||
/// HealthChat: a VoIP push requested from the push gateway carries the expiration as JSON seconds.
|
||||
@Test
|
||||
func incomingCallFromPushGatewayVoIPPush() async {
|
||||
await waitForConfirmation { confirmation in
|
||||
let pkPushPayloadMock = PKPushPayloadMock().updatingExpiration(secondsSince1970: currentDate.timeIntervalSince1970 + 30)
|
||||
|
||||
service.pushRegistry(pushRegistry, didReceiveIncomingPushWith: pkPushPayloadMock, for: .voIP) {
|
||||
confirmation()
|
||||
}
|
||||
}
|
||||
|
||||
#expect(callProvider.reportNewIncomingCallWithUpdateCompletionCalled)
|
||||
#expect(!callProvider.reportCallWithEndedAtReasonCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
func incomingVoiceCall() async {
|
||||
#expect(!callProvider.reportNewIncomingCallWithUpdateCompletionCalled)
|
||||
@@ -280,6 +297,11 @@ private nonisolated class PKPushPayloadMock: PKPushPayload {
|
||||
return self
|
||||
}
|
||||
|
||||
func updatingExpiration(secondsSince1970: TimeInterval) -> Self {
|
||||
dict[ElementCallServiceNotificationKey.expirationDate.rawValue] = secondsSince1970
|
||||
return self
|
||||
}
|
||||
|
||||
func updateIsVoice(_ isVoice: Bool) -> Self {
|
||||
dict[ElementCallServiceNotificationKey.isVoiceCall.rawValue] = isVoice
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user