Reputation: 711
Phone links like <a href="tel:1-408-555-5555">1-408-555-5555</a>
are used in my app. On Blackberry 10 device, they work fine in browser. But when I wrap my app into Phonegap, the doesn't, just nothing happens. How do I dial a phone number from a phonegap app on Blackberry? My device is Blackberry Z10, if this matters.
Edit: Actually I've missed from my code that links have empty href href="#" and then phone dial fires from javascript. I've changed this to direct links and dial works.
Upvotes: 1
Views: 615
Reputation: 357
you can also create a function like this. worst case.
function callSomeone(number){
if (navigator.userAgent.toLowerCase().match(/android/)) {
document.location.href = 'tel:'+number;
} else if (navigator.userAgent.toLowerCase().match(/iphone/) || navigator.userAgent.toLowerCase().match(/ipad/)) {
window.plugins.phoneDialer.dial(number);
}
}
Upvotes: 1