美文网首页Hybrid开发
RN离线包main.jsbundle

RN离线包main.jsbundle

作者: 马戏团小丑 | 来源:发表于2017-10-27 15:49 被阅读190次

前面与iOS 项目混用中有如下这段代码,代表的是RN在项目中是使用离线的代码,还是线上的。

- (NSURL*)getBundleUrl{
    // 离线包
    return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];  
    // 线上包
    //return [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios"];
}

那么如何将线上的转换成离线包,放进iOS项目中:

curl http://localhost:8081/index.ios.bundle -o main.jsbundle

相关文章

网友评论

    本文标题:RN离线包main.jsbundle

    本文链接:https://www.haomeiwen.com/subject/okxdpxtx.html