I have to send an http request to the server, and the request takes up to 20 seconds, during this time I have to send my app to background and open another app to do something else and then get back to my App, and when I receive the response from the first app when it at the background, and return it to foreground, Axios returns response 0 (Skipped), while it passed from the server and it should be 200.
return Axios.post(url, payLoad) .then(result => { return handleSuccessResultCode(result); }).catch(error => { console.log("AxiosPost-error", error); return handleResultCode(error, resolve, reject); });
Payload Header:
content-type: application/jsonprovider: iosmacaddress: <Device MAC>deviceid: <Device ID>
Console.log prints:
AxiosPost-error Error: Network Error at createError (createError.js:16) at EventTarget.handleError (xhr.js:83) at EventTarget.dispatchEvent (event-target-shim.js:818) at EventTarget.setReadyState (XMLHttpRequest.js:574) at EventTarget.__didCompleteResponse (XMLHttpRequest.js:388) at XMLHttpRequest.js:501 at RCTDeviceEventEmitter.emit (EventEmitter.js:189) at MessageQueue.__callFunction (MessageQueue.js:395) at MessageQueue.js:106 at MessageQueue.__guard (MessageQueue.js:343)
Response:response 200 if I received the http response when the app is in foreground.response 0 if I received the http response when the app is in the background.
by the way, this issue happens only on regular devices, and it works correctly if I test it on simulator.