add continuous vibration

This commit is contained in:
ryanzhao 2021-10-12 09:05:37 +11:00
parent 57a04f4ff5
commit 42676188c7
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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) {