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

自闭症网瘾萝莉.ら 提交于 2019-12-05 13:55:04

There has been a behavior change in when the closure is called in iOS 11. I cant say if this behavior will be reverted or if this is a bug. But one of the ways you can identify when the user interacted with the popup is by adding a notification listener around UIApplicationDidBecomeActive in the completion closure of openURL(). To identify whether the call was clicked or not you will need to create another custom notification and listener on the CTCallCenter. That was the best way through which I was able to identify it, there might be better solutions though :D

completionHandler will get a call if your given URL gets open success or failure, this has nothing to do with Cancel & Call buttons on Alert

see what Apple docs has to say about it HERE

completionHandler

The block to execute with the results. Provide a value for this parameter if you want to be informed of the success or failure of opening the URL. This block is executed asynchronously on your app's main thread. The block has no return value and takes the following parameter:

success

A Boolean indicating whether the URL was opened successfully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!