axios/fetch request stuck with no error or no response on IOS only

Description:
sending a request with Axios or fetch in IOS not work and it doesn’t matter if the API is HTTPS or HTTP
no error reaches the catch or no response received
also no errors, only warnings

2020-02-18 21:31:21.096 [warn][tid:com.facebook.react.NetworkingQueue][RCTEventEmitter.m:53] Sending `didReceiveNetworkResponse` with no listeners registered.
2020-02-18 21:31:21.100 [warn][tid:com.facebook.react.NetworkingQueue][RCTEventEmitter.m:53] Sending `didReceiveNetworkData` with no listeners registered.
2020-02-18 21:31:21.100 [warn][tid:com.facebook.react.NetworkingQueue][RCTEventEmitter.m:53] Sending `didCompleteNetworkResponse` with no listeners registered.

this only happin with IOS , android works fine

React Native version:

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 40.29 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.15.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.7 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.12.0 => 16.12.0
    react-native: 0.61.5 => 0.61.5
  npmGlobalPackages:
    react-native-cli: 2.0.1

Steps To Reproduce

  1. just send any request to any API

Expected Results

get a result or even error from the API

Snack, code example, screenshot, or link to a repository:

the app stuck here because I’m waiting for a result or error from the request
image

my simple function

export const checkAuth = (accessToken) => async (dispatch, getState) => {
  try {
    const response = await fetch('https://www.google.com', {
      method: 'GET',
      headers: {
        // Accept: 'application/json',
        // Authorization: `Bearer ${accessToken}`,
      },
    })
    const json = await response.json()
    const { error } = json

    if (error) {
      return false
    }
    return true
  }
  catch (error) {
    return false
  }
}

my info.plist
image

2 thoughts on “axios/fetch request stuck with no error or no response on IOS only

  1. I’m also getting this error with iOS in release build. I’m trying to send a request to https.
    Weirdly if i turn off then turn on my iphone’s wi-fi requests starts working.
    But after a while requests keep failing again.
    I think this issue needs to be reopened.
    Note: I’m using axios

Comments are closed.