Cordova (ex phonegap) tel: links in <a href> do not work in ios5
I checked everywhere here on stackoverflow, google, phonegap and other websites, but I cannot find a solution, but if I missed the link I need, please write to me because I'm lost.
1: I use Cordova + JQmobi to write my applications. 2: the only link that doesn't work is TEL: in the tag links. 3: they work in Safari for ios (any version I found from ios4 to ios5.1) 4: only in ios5 the link to TEL: will not work in native applications
Here are the codes I tried:
<a href="tel:+39000000">Link to the tel</a> <a href="tel:+39000000" target="_blank">Link to the tel</a> <a href="tel:+39000000" target="_self">Link to the tel</a> <a href="" onclick="windows.location('tel:+39000000')" target="_blank">Link to the tel</a> For the format of the phone number I used: tel: +39000000 (+39 for Italy) tel: 123456 (I tried any real phone numbers, but I don't have #, * or spaces) tel: // + 39123456
When I check the xCode simulator for SMS: link, I get this error: AppDelegate :: shouldStartLoadWithRequest: Received raw URL sms: +39123456
And this is correct, because the simulator does not have an SMS application, but then when I try to use TEL: link: Failed to load webpage with error. Unable to show url
This is what I know, this is what happens if you write an illogical URL that you want to open using a browser.
I read that jqmobi (like other frameworks like jqtouch) can prevent the default behavior for the link, but if you explicitly call it.
What really changed in ios5? Since all my links work on ios4.3
Someone out there, please help me, and many others I saw could not find a real solution for this new Apple update.
thanks for all
My solution: no solution. But plug-in: https://github.com/mchristie/PhoneGap-ios-PhoneDialer/
If you use a cord, be sure to check the 4 lines that you must change (cord instead of a telephone plug)
Actually there is a solution to this, or at least for me, here it is:
In HTML:
<input type="button" href="tel:+1-800-555-1234" class="phone-number" value="1-800-555-1234"/> In Javascript:
$('.phone-number').bind(click, function(e) { e.preventDefault() var phoneLink = $(e.currentTarget).attr('href'); window.open(phoneLink, '_system', 'location=yes'); } Have you tried to remove the "+"?
<a href="tel:39000000">Link to the tel</a> <a href="tel:39000000" target="_blank">Link to the tel</a> <a href="tel:39000000" target="_self">Link to the tel</a> <a href="" onclick="windows.location('tel:39000000')" target="_blank">Link to the tel</a> as from their specification it sounds like they do not fully support all special characters:
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html