RN 使用远程pod集成
0.63.2 📁 对应react-native 0.63.2 版本
0.61.0 📁 对应react-native 0.61.0 版本
0.61.0-rc.0 📁 对应react-natice 0.61.0-rc.0 版本
0.60.4 📁 对应react-natice 0.60.4 版本
在Podfile中增加如下源和依赖
source 'https://github.com/xcuYao/PrivatePods.git'
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
pod 'RNFramework', '0.1.10'
🐙 0.1.1(rn 0.61.0-rc.0)支持
🐙 0.1.2(rn 0.61.0)支持
🐙 0.1.10(rn 0.63.2)支持
对于常规的react-native项目 我们一般需要在iOS项目的Podfile中增加类似一堆依赖
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
...
从本地的目录(一般为上级node_modules/react-native)中读取依赖
这个项目将依赖(podspec)拆到远端私有源
并封装在RNFramewrok中 这样就解耦了依赖
方便集成项目,而且公共部分也方便统一处理,新老项目也可快速接入
具体使用参考示例工程