Http Requests - Stop Working After Sleep/Background

Hi,

I’m having a weird issue I’m hoping someone has some insights on. I’ve not had any luck after multiple hours and searches and debugging.

The android tablet the app is running on is asleep all night. The app is no longer able to make http calls, even though the tablet is connected to wifi and the internet (tested via different app).

The same happens when say driving from the office to my home and the app switches wifi networks.

I’m also using the Network native plugin to check the network status, and this does not seem to be reporting the correct connection state either. I am using the Angular HttpClient.

Some relative dependency versions:

"@angular/http": "5.2.11",
"cordova-android": "7.1.0",
"cordova-plugin-network-information": "2.0.1",
"@ionic-native/core": "4.7.0",
"@ionic-native/network": "4.7.0",
"ionic": "3.20.0",
"ionic-angular": "3.9.2",

Thanks in advance!

1 Like