I am trying to make a FaceTime call from inside my app. I am using the UIApplication.shared.open
method to do it, as it provides a callback:
@available(iOS 10.0, *)
open func open(_ url: URL, options: [UIApplication.OpenExternalURLOptionsKey : Any] = [:], completionHandler completion: ((Bool) -> Void)? = nil)
If I provide a correct phone number, everything works fine (FaceTime makes a call). Problems start when an invalid number is provided. FaceTime call window opens for a split second, then immediately closes. The UIApplication.shared.canOpenURL
method returns true
, and so does the UIApplication.shared.open
callback.
Example URL:
URL(string: "facetime://123456789")
I am aware that I should validate the number on my side, but I think that it should still be possible to somehow gracefully handle FaceTime failing to make the call. Any hints on what to do in this situation would be appreciated.