Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Check Network Connection With Ionic Framework

When creating a mobile app, specifically one that makes heavy use of the internet, it is often necessary to make sure an internet connection exists at launch and possibly display a message or perform an action if one does not exist.

The following is for an Ionic Framework 1 application. If you’re using Ionic 2, you will want to check here.

The following chunk of example code is typically found in your Ionic Framework project’s js/app.js file. It demonstrates how to check if a network connection exists on application load and how to display an Ionic popup that is nicely styled in comparison to a JavaScript alert dialog.

Read More