Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In iOS, how to detect from Javascript (web) the device is connected via 3G or Wifi?

In iOS on the web, I would like to detect from Javascript whether the device is connected via 3G or Wifi?

In Android, this information is available via navigator.connection.type. Is this information available on iOS (iPad/iPhone)?

See How do you detect 3G vs. Wifi connection on mobile safari?

like image 650
viebel Avatar asked Feb 19 '12 09:02

viebel


People also ask

How can you identify if a device iPhone is connected to a Wi-Fi network select one?

To check if your iOS mobile device is connected to Wi-Fi:From the main screen of your device, look for and open Settings. With Settings open, look for the Wi-Fi field. Off - the Wi-Fi antenna is currently disabled. Not Connected - Wi-Fi is turned on, but your device is not currently connected to a network.

How do I see network connections on my iPhone?

From your Home screen, go to Settings > Wi-Fi. Turn on Wi-Fi. Your device will automatically search for available Wi-Fi networks. Tap the name of the Wi-Fi network that you want to join.

How can I tell if my iPhone is Javascript or iPad?

In order to detect a device whether it is iOS or not. We're going to Navigator platform and Navigator userAgent property. This property returns the value of the user-agent header which is sent by the browser to the server. Returned value, have information about the name, version, and platform of browser.


1 Answers

You can't. iOS does not support this natively. You have to use a framework like PhoneGap to achieve this.

like image 130
ckruse Avatar answered Oct 26 '22 17:10

ckruse