@munsterlander looking to your code modifications i agree that isn’t necessary
to keep part of the code like:
states[Connection.WIFI] = 'WiFi connection';
states[Connection.CELL_2G] = 'Cell 2G connection';
states[Connection.CELL_3G] = 'Cell 3G connection';
states[Connection.CELL_4G] = 'Cell 4G connection';
states[Connection.CELL] = 'Cell generic connection';
When i’m checking just my connection ( If i have or not)
I just have added other navigator.app.exitApp(); for one reason:
if the user access the settings but cancel for any reason , could be possible to return to the application.
if (index == 0) {
if (typeof cordova.plugins.settings.openSetting != undefined) {
cordova.plugins.settings.openSetting("wifi", function () { console.log("Acessando suas configurações") }, function () { console.log("Erro para alterar configurações, tente manualmente!") });
}
} else if (index == 1) {
navigator.app.exitApp();
}
navigator.app.exitApp();