network.getConnectionStatus()

Hi there,

Does anyone know why network.getConnectionStatus() isn’t documented?

It seems to work as a very simple way of checking if a device is connected to the internet but I’m worried about using it if it may just disappear or cease to work at some point in a future release.

Thanks,

Ian

I don’t know, maybe it is because not work on both platforms (iOS & Android - again I don’t know - didn’t test it) ?

Hi guys,

I have asked the question (is this api safe to use and will it go away?) in the past to Corona and here is the answer from Joshua :

We don’t plan on removing this API.

 

But that said, the reason it is undocumented is because it has a potential design issue for devices that have multiple network connections.  This is not a common case on iOS and Android, so, we’ve let it be for now.  However, that may change when we add support for Windows Store apps (aka: metro, aka: Windows 8), because then the app is running on a PC which typically has 2-3 network connections (physical Ethernet port, WiFi, maybe blue-tooth, and a virtual machine’s network connection).

 

In my opinion, this API is not that useful.  Just because you have network access does not mean you have Internet access.  It’s really just a clue for your app to assume that you might have access to the Internet.  The only way to know for sure is to just “go for it” and attempt a connection via our “network” API.  Especially since Internet access can come-and-go at anytime on a mobile device if you live in an area with shaky Internet access and cellular service (I have family members who live in areas with this problem).  In fact, I suppose the only useful bit of info that you’ll get from this API is whether or not the device is connected to the cellular service’s network or not for those concerned about data usage, but that’s best managed by the end-user and the device’s settings.

 

In any case, that’s my quick opinion on this API.

makes sense.

Thanks guys. I’m only using it as a preliminary test and then running more tests to check for an internet connection if I get a “true” returned from this.

I don’t know, maybe it is because not work on both platforms (iOS & Android - again I don’t know - didn’t test it) ?

Hi guys,

I have asked the question (is this api safe to use and will it go away?) in the past to Corona and here is the answer from Joshua :

We don’t plan on removing this API.

 

But that said, the reason it is undocumented is because it has a potential design issue for devices that have multiple network connections.  This is not a common case on iOS and Android, so, we’ve let it be for now.  However, that may change when we add support for Windows Store apps (aka: metro, aka: Windows 8), because then the app is running on a PC which typically has 2-3 network connections (physical Ethernet port, WiFi, maybe blue-tooth, and a virtual machine’s network connection).

 

In my opinion, this API is not that useful.  Just because you have network access does not mean you have Internet access.  It’s really just a clue for your app to assume that you might have access to the Internet.  The only way to know for sure is to just “go for it” and attempt a connection via our “network” API.  Especially since Internet access can come-and-go at anytime on a mobile device if you live in an area with shaky Internet access and cellular service (I have family members who live in areas with this problem).  In fact, I suppose the only useful bit of info that you’ll get from this API is whether or not the device is connected to the cellular service’s network or not for those concerned about data usage, but that’s best managed by the end-user and the device’s settings.

 

In any case, that’s my quick opinion on this API.

makes sense.

Thanks guys. I’m only using it as a preliminary test and then running more tests to check for an internet connection if I get a “true” returned from this.