简体   繁体   中英

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...

Any idea ?

There is a similar question with a relevant answer here: 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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