Software Archive
Read-only legacy content
17061 Обсуждение

Cordova href=tel Whitelist

simsam7
Начинающий
1 604Просмотр.

Hi,

When working with Cordova directly, i.e. not through XDK, you can modify the Whitelist to include protocols such as:

<a href="tel:+1555444444>Call</a>

This makes it possible to dial a number from within a Cordova app, and is necessary due to this:

https://www.ibm.com/developerworks/community/blogs/worklight/entry/action_required_cordova_android_security_update?lang=en

For a Stackoverflow post on the same issue, see this:

http://stackoverflow.com/questions/26271313/tel-sms-and-mailto-no-longer-working-in-android-after-upgrading-to-cordo

I tried adding the white listing option directly to the: intelxdk.config.additions.xml like so:

<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>

It has no effect though. How do I do this using XDK?

 

Thanks!

 

 

0 баллов
7 Ответы
Swati_S_Intel1
Сотрудник
1 604Просмотр.

There is domain whitelisting feature in the build settings section of the Projects page. You can specify tel and mailto in Domain list.

Swati

simsam7
Начинающий
1 604Просмотр.

Hi Swati,

Thank you for responding, I've entered this in the Domain List, each on its own:

<access origin="tel:*" launch-external="yes"/>

<access origin="mailto:*" launch-external="yes"/>

I also checked the "Allow external applications to launch from this domain" box, and refreshed the instance, but I'm still not getting it to dial.

What am I doing wrong? This is such a common setting, there must be an easy way to do this.

Regards,

Sam

Swati_S_Intel1
Сотрудник
1 604Просмотр.

You have to only put tel:* in the domain list input box. You have to put different domains separately by adding using "+add another domain". Also, make sure you check the box "Allow external applications to launch from this domain."

See the attached image.

simsam7
Начинающий
1 604Просмотр.

Thank you Swati, I've tried it like that as well, see attached file. It is still not launching the dialer and not prompting an email client to use.

The same code works when I put it in Cordova directly, using the same plugins, what else could I be missing here?

Regards,

Sam

simsam7
Начинающий
1 604Просмотр.

Setting the whitelist options for tel: and mailto: does not work for me.

Anyone else with the same issue? I'll have to abandon XDK if this doesn't work.

Thanks
Sam

Anusha_M_Intel1
Сотрудник
1 604Просмотр.

Hi Simsam,

I tried including your line of code along with an email example. With the whitelist entries listed in your image, it worked fine for me in the emulator. Can you create a new application with just these two lines of code and the whitelist entries and see if it works?

<body>
    <a href="tel:+1555444444">Call</a>
    <a href="mailto:html5tools@intel.com">Email</a>
</body>

 

simsam7
Начинающий
1 604Просмотр.

Hi Anusha,

Thank you for your reply.

I had actually created a fresh project previously, but still experienced the same problem. Just to be thorough, I created yet another test project, using the HTML5+Cordova template.

Using the "Run on USB Connected Devices" did not work, however, building the test app and downloading it, worked! The real app still does not work with either option.

I'll work off a new fresh template, bring over all the code of the real app, and see if that works.

 

 

 

Ответить