Page 1 of 1

How to create a pop up window which appears only if no internet connection

Posted: Tue Jan 21, 2014 5:32 pm
by marieall

Hi,

Only one section of my app requires internet.
I want to warn people who runs the app without internet connection, when they try to get into that section, that it won't work., or that they need internet..

Is there a js script I could put on the concerned page load that would solve this?

Thanks!


How to create a pop up window which appears only if no internet connection

Posted: Tue Jan 21, 2014 5:39 pm
by maxkatz

PhoneGap has API to check if there is Internet connection: http://docs.phonegap.com/en/3.3.0/cor...


How to create a pop up window which appears only if no internet connection

Posted: Wed Jan 22, 2014 5:36 pm
by marieall

Hi Max,

I'm really lost in how to do so, and I'm not sure it's exactly what I 'm looking for.
I just want that when the user get into the section "airport", the app detects if he has or not internet, and if he has not internet, that a pop up windows opens and let him know he won't be able to access this section unless he gets an access to the wifi.

You see what I mean?


How to create a pop up window which appears only if no internet connection

Posted: Wed Jan 22, 2014 6:52 pm
by maxkatz

The PhoneGap API link that I posted above allows you to check if there is internet connection or not. You would determine if there is internet connection and then open the popup window.


How to create a pop up window which appears only if no internet connection

Posted: Wed Jan 22, 2014 6:58 pm
by marieall

Thanks, but I just told you I don't know how to proceed... i don't understant what they are talking about.. so it doesn't really help what you are saying :)
Anyway, I found a way to do it with javascript. I tested and it works fine.

Ideally in fact, I would like my database to be accessible offline, so my whole app would be accessible offline. Is there a way to put my database offline? ( I used appery database service)


How to create a pop up window which appears only if no internet connection

Posted: Wed Jan 22, 2014 7:12 pm
by maxkatz

We understand and we are able to give you guidance and direction but we can't implement this logic for you. It's not part of our support (http://docs.appery.io/support-policy/).

Appery.io database is a cloud database (you can't use it if the app is offline).

There are browser-based databases such as SQLite or IndexedDB that you can store data when the app is offline.