I want when the user clicks on the a-href it navigates to dial this number

This application is developed using elixir and phoenix liveview. I have a problem while using this code.

      <a class ="text-zinc-900 text-sm font-medium" href="tel:19000"><%= gettext("19000") %></a>

it workes on the browser but when i test it on the actual app it doesn’t work at all. please advise me what should i do or should i add javascript.

it workes on the browser but when i test it on the actual app it doesn’t work at all.

@ntamer what do you mean with “in the actual app”? Is this web page loaded in a webview inside a native mobile application? If so, some mobile webviews do not work with tel: or mailto: links, and need some setup that is specific to the platform you are using (Android, iOS, specific framework, etc.). Unfortunately, if that’s your case, this has nothing to do with Elixir or Phoenix, but rather with the mobile app framework you are using.

One thing you can try, is to add target="_blank" to your link tag, like:

<a href="tel:123456789" target="_blank">123456789</a>

This should cause the link to be opened in a new browser window, even when the original page was loaded inside a mobile app. The user experience might not be great (a new browser window will be opened), but it might be a stop-gap solution until you set up your native app to handle tel links.

2 Likes

I meant that by the actual app that while testing it locally not in browser. I will try adding the target =“_blank” hopefully it would work. Also i’ll search how to handle it native. Thank you so much for your help!!