Show Popup Confirm instead of "connection to the server was unsuccessful"


#1

Hi Ionites,

I just want to seek help about displaying an ionic popup instead of “connection to the server was unsuccessful. (file ///android_asset/www/index.html)” for user to know that there is a problem(network connection) in the app. Thanks


#2

add network-information plugin to you app.

In a base controller/component you could handle the “online” and “offline” javascript events.
If offline --> show popup.

If online --> hide it again if it is showing.

If you want to use ngCordova:
http://ngcordova.com/docs/plugins/network/


#3

I already have that plugin and use it for checking Connection Type but when the connection is slow this alert shows(because I use external links). All I want is if the external links fail it will show a alert popup instead of the real error… thanks for that… it really helps…