add continuous vibration

pull/560/head
ryanzhao 4 years ago
parent 57a04f4ff5
commit 42676188c7

@ -9,6 +9,8 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
let uuid: String let uuid: String
let sdp: RTCSessionDescription let sdp: RTCSessionDescription
private var vibrationTimer: Timer?
// MARK: UI Components // MARK: UI Components
private lazy var profilePictureView: ProfilePictureView = { private lazy var profilePictureView: ProfilePictureView = {
let result = ProfilePictureView() let result = ProfilePictureView()
@ -176,10 +178,13 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: { UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: {
self.alpha = 1.0 self.alpha = 1.0
}, completion: nil) }, completion: nil)
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) vibrationTimer = WeakTimer.scheduledTimer(timeInterval: 0.5, target: self, userInfo: nil, repeats: true) { _ in
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
}
} }
public func dismiss() { public func dismiss() {
vibrationTimer?.invalidate()
UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: { UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: {
self.alpha = 0.0 self.alpha = 0.0
}, completion: { _ in }, completion: { _ in

@ -243,7 +243,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
} }
public func peerConnectionShouldNegotiate(_ peerConnection: RTCPeerConnection) { public func peerConnectionShouldNegotiate(_ peerConnection: RTCPeerConnection) {
// Do nothing print("[Calls] Peer connection should negotiate.")
} }
public func peerConnection(_ peerConnection: RTCPeerConnection, didChange state: RTCIceConnectionState) { public func peerConnection(_ peerConnection: RTCPeerConnection, didChange state: RTCIceConnectionState) {

Loading…
Cancel
Save