简体   繁体   English

如何在 safari 中测量 tel:// 链接的通话时间?

[英]How to measure call time of a tel:// link in safari?

I try to measure the call duration (or time between click and end of call) when a user click on a phone link, click accept to call, call and end call.当用户单击电话链接、单击接受呼叫、呼叫和结束呼叫时,我尝试测量呼叫持续时间(或单击和结束通话之间的时间)。 The default behaviour user is switched back on the page.默认行为用户切换回页面。

The problem is that no event is fired on begining or end of switch on phone app, and javascript seems not to stop during the call...问题是在打开手机应用程序的开始或结束时没有触发任何事件,并且 javascript 在通话过程中似乎没有停止......

Any idea ?任何的想法 ?

There is a similar question with a relevant answer here: https://stackoverflow.com/a/18310457/3677221这里有一个类似的问题,有一个相关的答案: https : //stackoverflow.com/a/18310457/3677221

As rckoenes sais you can use CTCallCenter but be prepared that you app might be rejected for not valid background mode usage.正如 rckoenes 所说,您可以使用 CTCallCenter,但要准备好您的应用程序可能会因无效的后台模式使用而被拒绝。

It could be a solution that you first save the date when the link is clicked (or the call starts).这可能是一种解决方案,即您首先保存单击链接(或呼叫开始)时的日期。 Than detect the end of the call from the state change of CTCallCenter's callEventHandler block ( Apple Documentation ) and calculate the time difference.然后从 CTCallCenter 的 callEventHandler 块( Apple 文档)的状态变化中检测呼叫结束并计算时间差。

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

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