android - react 原生安卓 : Fetch Requests only working when React Native Debugger is connected

标签 android react-native apollo

我在 Android 上向我的 API 发出获取请求时遇到了一个奇怪的问题(使用 React Apollo)。在开发构建以及发布构建中,获取不起作用。一旦我启动 React Native Debugger 并启用 Enable Network Inspect,请求就会工作。

我不知道如何调试请求,因为在没有启用网络检查的情况下它们不会显示在调试器中。

有什么想法可以让我找到错误,或者你们中的任何人都遇到过同样的问题吗?

最佳答案

可能是API问题。我前段时间也有同样的问题。
React-native-debugger 处理 url 重定向。当您使用 react-native-debugger 时,会在您的 http 请求中添加一些额外的逻辑。
验证请求、http://https://、 header 、cookie 等。
( postman 和 react-native-debugger 一样)

关于android - react 原生安卓 : Fetch Requests only working when React Native Debugger is connected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51368634/

相关文章:

reactjs - 如果 Apollo GraphQL token 无效或已过期,则 NextAuth.js 注销

javascript - useLazyQuery 在循环和 Promise.all 内不起作用

android - 在 Android 中查看 PDF 文件

android - 如何用新的 getHour() 替换旧的 getCurrentHour()?

javascript - react native : Is there any way to check if the file exists in android_asset folder or not?

graphql - Amplify + AppSync 不会改变对象

android - 更新后 : "SQLiteException: unable to open database file"

android - PagerAdapter 类 instantiateItem 在 onCreate 中自动调用两次

javascript - : Invalid hook call. Hooks只能在React Native的函数组件体内调用

react-native - 找不到模块 'asap/raw'