1

Problem

I want to call anonymously using an HTML tel: link with the prefix #31#. This works on iPhone, but on Android it opens up an empty dial screen.

Using tel: links without the prefix work fine on both android and iPhone.

When clicked, the link does open the phone app, but the dial screen is empty. Without the prefix the dialscreen has the phonenumber filled in, ready to be called.

What I've tried

I tried to use encodeURIComponent('#31#') to escape the pound signs to no avail

<a href="tel:#31#0123456798">Anonymous tel:#31#</a> //opens empty dial screen
<a href="tel:0123456789">Regular tel:</a> //does work, but it's not anonymous

My research

Similar topics on stackoverflow only talk about native android code using Android Intent and ACTION_CALL which is not available in JavaScript. This is not of any use for me, I need a basic HTML (or Javascript) solution.

Question

How do I make an anonymous phone call on Android using a tel: link in HTML?

Code to demonstrate the problem

https://codepen.io/skrln/pen/WaPEwO

skrln
  • 542
  • 2
  • 8
  • 19
  • are you trying to do that in a hybrid application (i.e `HTML` as front and `JAVA` as Backend)? – vikscool Jun 25 '18 at 09:06
  • @vikscool HTML and Javascript in a webview app – skrln Jun 25 '18 at 09:29
  • if that is the case create an `@javascriptInterface` method in the backend which will call the `phone` intent and call that intent from your javascript function and in the intent function use this code [how to use call intent](https://stackoverflow.com/a/34596732/2417602). and [this](https://stackoverflow.com/a/11699829/2417602) – vikscool Jun 25 '18 at 09:40

1 Answers1

3

You have to replace the # with %23 so you get %2331%23 instead of #31#.

For example:

tel:%2331%23XXXXXXXXXX

PeeJee
  • 536
  • 6
  • 22