Unable to detect Connection Mode on a tablet if it is connected to S.I.M

Viewed 40

Having problem detecting the network connection on a device in ionic app. navigator.connection.type is returning "wifi" when the device is connected to the WIFI, but it is returning "unknown" when the device is connected to the 3G or 2G. Just wanted to detect the connection state when the ionic app when moving from one state to another state. So I'm using this method to detect the connection state

if(window.Connection) { connection_type = navigator.connection.type console.log(connecetion_type); }

0 Answers
Related