From 42676188c754cffb5e116ccb06e53dba8843e536 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Tue, 12 Oct 2021 09:05:37 +1100 Subject: [PATCH] add continuous vibration --- Session/Calls/Views & Modals/IncomingCallBanner.swift | 7 ++++++- SessionMessagingKit/Calls/WebRTCSession.swift | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Session/Calls/Views & Modals/IncomingCallBanner.swift b/Session/Calls/Views & Modals/IncomingCallBanner.swift index dbc037139..63efce9c3 100644 --- a/Session/Calls/Views & Modals/IncomingCallBanner.swift +++ b/Session/Calls/Views & Modals/IncomingCallBanner.swift @@ -9,6 +9,8 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate { let uuid: String let sdp: RTCSessionDescription + private var vibrationTimer: Timer? + // MARK: UI Components private lazy var profilePictureView: ProfilePictureView = { let result = ProfilePictureView() @@ -176,10 +178,13 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate { UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: { self.alpha = 1.0 }, completion: nil) - AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) + vibrationTimer = WeakTimer.scheduledTimer(timeInterval: 0.5, target: self, userInfo: nil, repeats: true) { _ in + AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) + } } public func dismiss() { + vibrationTimer?.invalidate() UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: { self.alpha = 0.0 }, completion: { _ in diff --git a/SessionMessagingKit/Calls/WebRTCSession.swift b/SessionMessagingKit/Calls/WebRTCSession.swift index a9a4b00a9..f55c2e345 100644 --- a/SessionMessagingKit/Calls/WebRTCSession.swift +++ b/SessionMessagingKit/Calls/WebRTCSession.swift @@ -243,7 +243,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { } public func peerConnectionShouldNegotiate(_ peerConnection: RTCPeerConnection) { - // Do nothing + print("[Calls] Peer connection should negotiate.") } public func peerConnection(_ peerConnection: RTCPeerConnection, didChange state: RTCIceConnectionState) {