Search code examples
ioscordovacall

How to detect with PhoneGap on iOS if call is made or not


When using the telprompt intent on iOS like

window.location = 'telprompt://' + phoneNumber

the user gets prompted to either call the number or cancel. Is there a way to know which of the two actions the user has made?

Looking at the PhoneGap docs the "startcallbutton" event is only supported on BlackBerry.


Solution

  • All you can do is listen for the pause event.

    document.addEventListener("pause", yourCallbackFunction, false);
    

    This event will be fired when there is an incoming call or starting a call.

    or you could look into the phone listener plugin and try to write it for iOS https://github.com/devgeeks/PhoneListener