on my website I want to integrate a call-by-click phone number. When you click on the phone number (or a button like "Call me now!") a call should start.
How can I do this in HTML? It must work for iOS and Android. I need one code for iOS an Android browsers.
if you want to implement this into an app, this:
in android, you can do this to detect PhoneLinks:
webView.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("tel:")) {
if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(intent);
}
return true;
}
}
});
in IOS, you can enable this on UIwebView's properties, inside Detection, there is the "Phone Numbers" tick. it will detect any phone number or phoneLink.
this is the code on your website, it will automatically trigger the phone:
<a href="tel:1-408-555-5555">1-408-555-5555</a>
more info on phoneLinks (works on both systems):