简体   繁体   English

检测到用户对iPhone呼叫链接的确认?

[英]Detect user's confirmation of iPhone call link?

The following code, if triggered by a button press in an app, presents the user with a UIAlertView giving them the option to "Cancel", and dismiss the UIAlertView , or "Call" and go through with dialing the number displayed to the user: 以下代码(如果通过在应用程序中按下按钮触发)向用户提供UIAlertView为他们提供“取消”选项,并关闭UIAlertView或“呼叫”,然后拨打显示给用户的号码进行操作:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://555-555-5555"]];

My question is: Is there a way to detect whether or not the user followed through with actually dialing the number? 我的问题是:有没有办法检测用户是否实际拨打了电话? I am implementing Google "Analytics" in my app to see how users are interacting with it, and I can track when they tap the UIButton that calls the code above, but that doesn't necessarily mean they actually made the call. 我正在我的应用程序中实现Google“ Analytics”,以查看用户如何与之交互,并且我可以跟踪他们何时点击了调用上面代码的UIButton ,但这并不一定意味着他们实际上进行了调用。

Hopefully that makes sense. 希望这是有道理的。 Thanks in advance for any help! 在此先感谢您的帮助!

You won't be able to check the user dialed that specific number. 您将无法检查用户拨打了该特定号码。 But you will be able to check they dialed a number using CTCallCenter:setCallEventHandler: 但是您将能够使用CTCallCenter:setCallEventHandler检查他们是否拨打了电话:

If they made a call immediately after you present the view its 99.9% reasonable to assume it was that number. 如果他们在您提出视图后立即拨打了电话,则认为该数字为99.9%是合理的。

But also your app delegate's willResignActive will get called if they place the call and get connected (I think, I can't remember exactly) so you could use that as an indication. 但是,如果您的应用程序委托的willResignActive发出呼叫并建立连接,它们也会被调用(我想,我记不清了),因此您可以将其用作指示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM