作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
将 react-native 集成到现有的 ios 应用程序中。
我有一个 native ios 应用程序,它从远程服务器中提取 ios 包。
我按照 react-native 站点 (https://facebook.github.io/react-native/docs/embedded-app-ios.html) 上的说明进行操作,我能够在 React 中安装 pod 依赖项并在模拟器中启动 ios 应用程序。
当我导航到加载 react-native 提供的 View 的 View 时,在该 View 中加载 react-native 应用程序的代码看起来像
NSString *urlString = @"https://<some_url_here>/main.jsbundle"; //a remotely hosted bundle.
NSURL *jsCodeLocation = [NSURL URLWithString:urlString];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName: @"react-native-app"
initialProperties: nil
launchOptions:nil];
https://<some_url_here>/main.jsbundle
我确实看到捆绑包被下载,所以我知道该 url 确实为捆绑包提供服务。
_fbBatchedBridge is undefined
最佳答案
这可能是与 ATS(应用程序传输安全)相关的问题。尝试为您要连接的域禁用它以进行调试。
在您的 Info.plist 中:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.the-domain-name.com</key>
<dict>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
关于ios - 尝试将 react-native 应用程序与现有 ios 应用程序集成时出现 "_fbBatchedBridge is undefined"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35326032/
将 react-native 集成到现有的 ios 应用程序中。 我有一个 native ios 应用程序,它从远程服务器中提取 ios 包。 我按照 react-native 站点 (https:/
第一次学习react-native。我开始实现文档中定义的教程,但出现错误,我也进行了搜索,但没有任何效果。 这是我的 index.ios.js 文件: /** * Sample React Nat
我是一名优秀的程序员,十分优秀!