incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CB-1213) Calling phone numbers with the tel: URI scheme from JS doesn't work
Date Wed, 08 Aug 2012 19:38:21 GMT

     [ https://issues.apache.org/jira/browse/CB-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shazron Abdullah resolved CB-1213.
----------------------------------

    Resolution: Won't Fix

Adding for knowledge base purpose.

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. 
                
> Calling phone numbers with the tel: URI scheme from JS doesn't work 
> --------------------------------------------------------------------
>
>                 Key: CB-1213
>                 URL: https://issues.apache.org/jira/browse/CB-1213
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: Master
>            Reporter: Shazron Abdullah
>            Assignee: Shazron Abdullah
>
> Discussion: https://groups.google.com/d/topic/phonegap/w2E7WOnhgiw/discussion
> 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).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message