React native IOS:axios/fetch请求被卡住,仅在IOS上没有错误或响应
说明: 在IOS中使用Axios或fetch发送请求不起作用,API是HTTPS还是HTTP也无关紧要 没有错误到达捕获或没有收到响应 也没有错误,只有警告React native IOS:axios/fetch请求被卡住,仅在IOS上没有错误或响应,ios,react-native,axios,fetch,Ios,React Native,Axios,Fetch,说明: 在IOS中使用Axios或fetch发送请求不起作用,API是HTTPS还是HTTP也无关紧要 没有错误到达捕获或没有收到响应 也没有错误,只有警告 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 2
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.
这只发生在IOS上,android运行良好
反应本机版本:
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
复制步骤
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
}
}
我的信息列表