Workaround: Load it through an anchor tag (create it dynamically, and
programmatically click it).
This is because when we encounter a "tel:" uri we pass it off to the
underlying UIWebView handler, and it should pop up the call dialog.
When an anchor tag is used, it is of navigation type
"UIWebViewNavigationTypeLinkClicked" which is handled properly -- but
when it is called from "window.location", it is
"UIWebViewNavigationTypeOther".
If we took out our delegate handler, and relied on the default
UIWebView handler (none of our processing), it will exhibit the same
behaviour that you are seeing. Thus, it is not a Cordova issue.
On Mon, Aug 6, 2012 at 8:06 AM, Abraham Lopez <
ablop...@gmail.com> wrote:
> Calling phones from Javascript (using window.location) and the tel: URI scheme doesn't seem to be working on iPhone devices with apps packaged by PhoneGap Build, so the issue must be in the PhoneGap framework.
>
> They work alright when the app is loaded as a web app through Safari, but when it runs as a native app (where the phonegap.js file is loaded), they don't work anymore, no errors or alerts are displayed, it just doesn't do anything.
>
> Here's the code I use:
>
> function CallPhone(sPhoneNumber){
> sPhoneNumber = sPhoneNumber.replace(/[^0-9]/g, "");
> window.location = "tel:" + sPhoneNumber;
> };
>
> To try it out, just call the function when a button or link is clicked. I'm using Sencha Touch v2 to develop the app. You can also try changing the URI scheme to be "tel://" instead of just "tel:" but it will not work also. I'd like to reiterate that this code works perfectly when opening the app through Safari from a URL I uploaded the app to, but not when running it as a packaged PhoneGap app (using PhoneGap Build).
>
> --
> -- You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to
phon...@googlegroups.com
> To unsubscribe from this group, send email to
>
phonegap+u...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to
www.phonegap.com
>
> To compile in the cloud, check out
build.phonegap.com
>
>