严格遵循Realm's website
上列出的说明现在正在运行npm list
以验证某些版本
现在根据"狗的数量修改出货的App.js"在Realm的入门页面中的示例(直接替换类主体)。
现在在XCode(v9.4)中打开myproj.xcodeproj,修复签名错误。确保没有其他正在运行的捆绑程序线程。选择在xcode中连接的ipad mini并点击“构建并运行”
将应用程序加载到ipad mini后,我可以看到
Number of dogs in theis Realm: 1
这意味着Realm已加载并正常运行。现在摇动ipad mini并点击" Debug JS Remotely"菜单,我在红色背景中收到此错误:
Failed to execute 'send' on 'XMLHttpRequest':Failed to load
'http://[IP_of_the_IPAD_mini]:8083/create_session'
Chrome React Native Debugger说"Status: Debugger session #10000 active"
,因此它已连接到ipad mini。
在我的iphone 7上进行了相同的测试,但得到了同样的错误。我确实需要进行设备调试,因为我们的项目需要使用设备的摄像头。有什么建议吗?
感谢。
答案 0 :(得分:0)
在here
中找到了一些线索解决问题,打开RealmReact.mm文件,搜索
"访问控制允许来源"
并将该行更改为
[response setValue:@"*" forAdditionalHeader:@"Access-Control-Allow-Origin"];