My application fetch requests run fine for about 1 or 2 minutes and then completely stop. Using Charles Proxy that the fetch requests are not being made from the app. The fetch promise does not hit the then or the catch.
What could stop fetch from working? The issue is very intermittent and baffles me
In logcat I sometimes see
E/GTalkService: connectionClosed: no XMPPConnection - That's strange!
The device itself still has an internet connection, as when I open a web browser I can navigate to a web page with no issue.
This is happening on the emulator and a physical device, both in release and debug modes.
Running React Native 0.34.1
Fetch function:
export function fetchSecure(endpoint, JWT, requestProperties, getState) {
var requestProps = {
method: 'GET',
headers: {
'Content-Type' : 'application/json',
'Accept' : 'application/json',
'Authorization' : 'Bearer ' + JWT,
},
...requestProperties
};
const requestUrl = AppConfigs.BASE_URL + endpoint
return fetch(requestUrl, requestProps).then(response => checkStatus(requestUrl, response, getState))
}