react native android initial request takes too long

Viewed 434

I have a strange problem. It only occurs on Android with an internet connection via Wifi. The initial request to my NodeJs server takes up to 50 seconds. The requests after that work normally It does not happen when the device sends the request via mobile internet. It also does not occur on iOS devices.

Using:

  • react-native: 0.62.2
  • node: v12.13.0

sending requests like:

return fetch(`URL`, {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json',
                Authorization:
                    `Bearer ${token}`
            }
        })
            .then((response) => response.json())
            .then((json) => {
                return json            
            });

0 Answers
Related