This is a migrated thread and some comments may be shown as answers.

Is there a way to check if a device is actually connected to a network? Dealing with Cafes, hotels, etc?

1 Answer 154 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Carlos
Top achievements
Rank 1
Carlos asked on 18 Nov 2015, 07:30 PM

We are using Telerik Platform and Kendo UI Mobile for a hybrid project.

We ran into an issue where if the device/app sees a WiFi network, BUT the WiFi network requires authentication or a acceptance of their terms and conditions (most commonly seen for cafes, hotels, etc.) the app thinks it is online, but since it is really not, no external data can be pushed to the app.

Using the network check (assumed from Cordova) just sees a WiFi network, so a check for network is actually unreliable.  
The app is seeing a network, but the user is just not logged on to get remote data from the app.  Meaning that the app 'thinks' it is actually on a network, when it is really not.   They can't actually get external data through the app if the app is not actually connected to the internet.

We are trying to figure out a way to inform the user that they need to actually be logged into the network, or that we see a network but they are not actually online.

Has anyone dealt with this or handled these types of situations?
How did you approach or work through a solution. Any code snippets?

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 20 Nov 2015, 12:35 PM
Hi Carlos,

You can consider making a test request to a remote point that would be always available at the places your app is used, for example the server from which you are going to get the external data. If the ping fails, you can tell the user that they are either offline or there is no access to the server at this moment.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Carlos
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or