React native 反应本机0.29+;在iOS中没有开发模式?

React native 反应本机0.29+;在iOS中没有开发模式?,react-native,React Native,升级到RN 0.29.1后,我的AppDelegate.m文件中没有一个URL,我可以说dev=false。。。是否有一种明显的方法可以关闭我所缺少的开发模式?facebook似乎没有更新文档,说明如何使用新的RCTBundleURLProvider。现在,我刚刚添加了以前版本中的旧URLWithString,效果很好: 添加: jsCodeLocation = [NSURL URLWithString:@"http://ipaddress:8081/index.ios.bundle?platf

升级到RN 0.29.1后,我的AppDelegate.m文件中没有一个URL,我可以说dev=false。。。是否有一种明显的方法可以关闭我所缺少的开发模式?

facebook似乎没有更新文档,说明如何使用新的
RCTBundleURLProvider
。现在,我刚刚添加了以前版本中的旧
URLWithString
,效果很好:

添加:

jsCodeLocation = [NSURL URLWithString:@"http://ipaddress:8081/index.ios.bundle?platform=ios&dev=true"];
[[RCTBundleURLProvider sharedSettings] setDefaults];
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
评论:

jsCodeLocation = [NSURL URLWithString:@"http://ipaddress:8081/index.ios.bundle?platform=ios&dev=true"];
[[RCTBundleURLProvider sharedSettings] setDefaults];
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

在花了一些时间查看RCTBundleUrlProvider代码后,我发现:

  • 如果在XCode项目中添加一个ip地址在其中的
    ip.txt
    文件,它将使用该文件来确定从何处获取
    index.ios
    (如果没有该文件,则默认为
    localhost

  • 默认情况下启用
    dev=true
    (在AppDelegate.m中调用
    setDefaults
    时)

  • 您可以通过设置
    enableDev


  • 编辑您的
    节点\u模块/react native/packager/react native xcode.sh
    文件并删除
    xip.io


    在某些地方(如中国),xip.io服务不起作用

    这有多疯狂?这似乎是他们应该考虑的一件非常基本的事情。他们忙于添加新功能,却忘了告诉人们如何使用它们:)