tel: link not working on Android when anonymous call code #31# is used

ⅰ亾dé卋堺 提交于 2021-01-28 08:54:54

问题


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


回答1:


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

For example:

tel:%2331%23XXXXXXXXXX



来源:https://stackoverflow.com/questions/51019518/tel-link-not-working-on-android-when-anonymous-call-code-31-is-used

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!