BarcodeScanner
BarcodeScanner copied to clipboard
Barcode scanner cancel trigger offline
I dont know what happen, but there's case in my apps when I use back button to cancel barcode scanner, suddenly navigator.onLine is false. But, when I do ajax request then navigator.onLine is back to true. The thing is, my apps is going to be offline first apps, so that when it is navigated back to the page the first thing it check is that is navigator.onLine is true or false.
I think it would be better to simply check the connection status with Cordova: https://github.com/apache/cordova-plugin-network-information
You should probably also listen to events and change your app status when the phone is going online.