cordova - Detecting internet connection with PhoneGap without the app being open -


i creating app phonegap lets user fill out form. if phonegap detects phone has internet connection, submit data via https site. if there no internet connection, store form data locally submit site once detects there internet connection again.

here tricky part:

is there way phonegap app check if internet available , saved forms should submitted without user opening app again? essentially, have happen background process. running 2-3 times day fine. ideas?

note: app utilized on androids , iphones.

you can check internet connection code below:

var networkstate = navigator.connection.type;      if (networkstate == connection.none)     {         alert('no network connection!');     } 

background process can implement using plugin, check here.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -