Open tomjamesallen opened 6 years ago
Thanks for creating this plugin but I'm having this same problem. The callback fires right away. :(
after further review of the plugins code... I believe this is actually the intended behavior... sadly. It seems the only reason the error handler would ever fire is if the system is unable to use the "tel:#####" scheme or if the phone number passed is invalid. This plugin does nothing for the detection of "Call" or "Cancel"
I post this only because maybe it'll help someone one day. So it turns out, there are some "extra" hidden events that Cordova decided to not include in its documentation (https://cordova.apache.org/docs/en/latest/cordova/events/events.html) . Specifically, there are "active" and "resign" events that will fire when your app shows a dialog like the tel:### prompt. So a combination of this plugin (https://github.com/happieio/cordova-plugin-call-hooks) with these hidden events, and knowing when your firing the "tel:#####", you should be able to determine if they pressed call or cancel.
Hello! You may use CXCallObserver from CallKit to fire the success callback when the call state is "dialing". Hope to see this soon. Thank you!
Using
window.plugins.CallNumber.callNumber(onSuccess, onFailure, number);
the success callback is being called immediately on calling the method. This brings up the native call confirmation dialog, and neither of the callbacks get called on tappingCall
orCancel
.