Merge pull request #349 from mpretty-cyro/fix/calls-without-callkit

Fixed an issue where incoming calls would always fail without CallKit
pull/1058/head
Morgan Pretty 3 months ago committed by GitHub
commit 2ba826faa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -106,6 +106,14 @@ public final class SessionCallManager: NSObject, CallManagerProtocol {
}
public func reportIncomingCall(_ call: CurrentCallProtocol, callerName: String, completion: @escaping (Error?) -> Void) {
// If CallKit isn't supported then we don't have anything to report the call to
guard Preferences.isCallKitSupported else {
UserDefaults.sharedLokiProject?[.isCallOngoing] = true
UserDefaults.sharedLokiProject?[.lastCallPreOffer] = Date()
completion(nil)
return
}
// Construct a CXCallUpdate describing the incoming call, including the caller.
let update = CXCallUpdate()
update.localizedCallerName = callerName

@ -104,8 +104,8 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
private func setUpViewHierarchy() {
self.clipsToBounds = true
self.layer.cornerRadius = Values.largeSpacing
self.set(.height, to: 100)
self.layer.cornerRadius = 16
self.set(.height, to: 80)
addSubview(backgroundView)
backgroundView.pin(to: self)
@ -125,8 +125,8 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
stackView.spacing = Values.largeSpacing
self.addSubview(stackView)
stackView.center(.vertical, in: self)
stackView.set(.width, to: .width, of: self, withOffset: Values.mediumSpacing)
stackView.center(in: self)
stackView.set(.width, to: .width, of: self, withOffset: -Values.mediumSpacing)
}
private func setUpGestureRecognizers() {
@ -222,8 +222,9 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
window.addSubview(self)
let topMargin = window.safeAreaInsets.top - Values.smallSpacing
self.set(.width, to: .width, of: window, withOffset: Values.smallSpacing)
self.set(.width, to: .width, of: window, withOffset: -Values.smallSpacing)
self.pin(.top, to: .top, of: window, withInset: topMargin)
self.center(.horizontal, in: window)
UIView.animate(withDuration: 0.5, delay: 0, options: [], animations: {
self.alpha = 1.0

Loading…
Cancel
Save