Is there any way to detect whether a mobile device is capable of making voice calls / SMS messages?
This is important when applying tel:
and sms:
links in a web page. It is not enough to merely detect mobile, since tablets can't make calls, iTouch can't make calls, etc.
I'm not interested in mobile detection hacks using device size, UA string detection, etc. I want to use feature detection to determine if the device is capable of voice calls / SMS text messaging. I'd love a universal solution, but am mainly interested in iOS / Android.
You can simply add an onclick handler to your <tr> tag, then call window. open("tel:+1800229933"); . This should be marked as the correct answer as this is an implementation done without the <a /> anchor tag as asked in the question.
Settings. Under "Account," tap Devices and numbers. Tap New linked number. Enter the phone number to link.
I havent seen an obvious way to see that sms:
and tel:
links get special treatment.
Update: @janogosteve below has confirmed there is currently no reliable feature detect. This looks undetectable.
Here's a comprehensive way to check this feature detect. (Read jangosteve comment below!)
getComputedStyle
info for a bunch of details on them and throw that into an object as wellJSON.stringify
( that stuff so you can deal with it later on)Do the above on an iOS device and in desktop Safari/Chrome
Then JSON.parse
them back into objects... and use https://github.com/NV/objectDiff.js to see if you can spot any differences at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With