6

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?

Community
  • 1
  • 1
viebel
  • 19,372
  • 10
  • 49
  • 83

2 Answers2

3

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

ckruse
  • 9,642
  • 1
  • 25
  • 25
  • Can you please share a reference for this information. Is it official by apple? What is the rationale behind it? – viebel Feb 19 '12 at 14:21
  • 2
    It was an android created property rather than W3C so Apple don't need an official reason not to support it. – koregan Feb 19 '12 at 14:44
  • Since it's standardized now ([The Network Information API](http://www.w3.org/TR/netinfo-api/#the-connection-interface)) does anyone know apple's stance? – barksten Jan 08 '13 at 20:25
0

You can call native IOS code from javascript that looks for connectivity in Reachability API,and return back the value to Javascript..

user2903299
  • 101
  • 2
  • 9