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?
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.
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.
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.
You can't. iOS does not support this natively. You have to use a framework like PhoneGap to achieve this.
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