Hint when trying to dial a phone number using the tel: // scheme on iOS 11

I had a problem trying to start a phone call from my iOS application using:

UIApplication open(_:options: completionHandler:)

iOS displays a pop-up / warning before starting a call using the two Call and Cancel and CompletionHandler buttons, called with a Bool parameter that has true / false based on the button action in iOS 10.

But now in iOS11, the problem is that the Handler completion function is called automatically before clicking the Cancel or Call button of the confirmation pop-up window, which always has a true value.

Is this a bug in iOS11 or is there something I'm doing wrong?

+4
source share
2 answers

A behavior change has occurred when a closure is called in iOS 11. I cannot say whether this behavior will be canceled or if this is an error. But one way to determine when a user is interacting with a popup menu is to add a notification listener around the UIApplicationDidBecomeActive at the end of closing openURL (). To determine if a call has been pressed or not, you will need to create another custom notification and listener in CTCallCenter. It was the best way I could identify it, however there might be better solutions: D

+1
source

completeHandler will receive a call if your given URL receives an open success or failure, it has nothing to do with cancel and call buttons in Alert

., Apple

completeHandler

. , URL-. . :

, , URL- .

-1

Source: https://habr.com/ru/post/1684818/


All Articles