Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16514] iOS: tel: links on webviews are not prompting user before making the call

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-03T23:10:30.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 05, 2014 Sprint 05 API, Release 3.3.0
ComponentsiOS
Labelsmodule_webview, qe-testadded, supportTeam
Reporterdemetri ganoff
AssigneePedro Enrique
Created2014-02-10T19:12:05.000+0000
Updated2014-07-29T17:27:22.000+0000

Description

Issue description

There seem to be an issue where the telephone links are automatically calling the number instead of prompting the user beforehand.

Steps to reproduce

- Go to Locations section of the app
var win = Ti.UI.createWindow({backgroundColor : 'white', layout: 'vertical'});
var aWebView = Ti.UI.createWebView({
	url: 'http://www.hdsupply.com/locations',	top: 25,	backgroundColor: 'gray',
});
aWebView.addEventListener('load', function(e) {
	Ti.API.info('webview loaded: '+ e.url);
});
win.add(aWebView);
win.open();
- The locations section of the app has a webview. There you can see the html behind the tel: links. Click any tel number. No dialog box is displayed. Right screen of screen shoot attached. - If you go to http://www.hdspply.com/locations an iPhone using Safari and the tel: links are prompting me before making the call as they should. Left screen of Screen shoot attached.

Apple docs

"When a user taps a telephone link in a webpage, iOS displays an alert asking if the user really wants to dial the phone number and initiates dialing if the user accepts. When a user opens a URL with the tel scheme in a native app, iOS does not display an alert and initiates dialing without further prompting the user. However, a native app can be configured to display its own alert." https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html

Attachments

FileDateSize
TIMOB-16514.jpg2014-02-28T21:57:59.000+0000217098

Comments

  1. Pedro Enrique 2014-03-03

    PR: https://github.com/appcelerator/titanium_mobile/pull/5409 Test code:
       var win = Titanium.UI.createWindow({
       	backgroundColor: 'white'
       });
       
       win.add(Ti.UI.createWebView({
       	html: '<body><a href="tel:555-123-4567">Call me</a></body>',
       	handlePlatformUrl: true
       }));
       
       win.open();
       
  2. Vishal Duggal 2014-03-03

    PR merged.
  3. Priya Agarwal 2014-04-18

    Verified the issue. Working fine. Used the below code:
       var win = Titanium.UI.createWindow({
           backgroundColor: 'white'
       });
        
       win.add(Ti.UI.createWebView({
           html: '<body><a href="tel:555-123-4567">Call me</a></body>',
           handlePlatformUrl: true
       }));
        
       win.open();
       
    Test Environment: Appc-Studio:3.2.3.201404162038 sdk:3.3.0.v20140417173316 acs:1.0.14 alloy:1.3.1 npm:1.3.2 titanium:3.2.3-beta titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Nexus5(v4.4.2),Iphone5(v7.1),Samsung Note(v2.3.6) telephone links on webviews prompts user before making the call.

JSON Source