Looking at these docs keeping in mind I am using RN 62.2 Adding a react-native plugin(app) to iOS app, there is a Ultimately, your Podfile should look something similar to this
section that shows what the podfile of our ios app needs to contain. It gives local paths to the dependencies needed for React-Native to run. That being said my team works on a project that distributes a react-native app as a plugin and we have to host the specs on repo. In the integrating app we can add the repo as a source at the top. Our integrating app has its own podspec that says what it needs and it uses the repo to get all of those pods installed. Here is an example of a dev repo for the specs that I push to specs repo. With react-native@58.*
it looked like this
# React is split into a set of subspecs, these are the essentials s.dependency 'React/Core', react_native_version s.dependency 'React/CxxBridge', react_native_version s.dependency 'React/RCTActionSheet', react_native_version s.dependency 'React/RCTAnimation', react_native_version s.dependency 'React/RCTImage', react_native_version s.dependency 'React/RCTLinkingIOS', react_native_version s.dependency 'React/RCTNetwork', react_native_version s.dependency 'React/RCTText', react_native_version # React's Dependencies s.dependency 'yoga', "#{react_native_version}.React" react_podspecs = ['../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec','../node_modules/react-native/third-party-podspecs/Folly.podspec','../node_modules/react-native/third-party-podspecs/glog.podspec' ] # Native Dependencies dep_podspecs = [ # CodePush'../node_modules/react-native-code-push/CodePush.podspec', # ReactNativeI18N'../node_modules/react-native-i18n/RNI18N.podspec', # ReactNativeAwesomeCardIO'../node_modules/react-native-awesome-card-io/RNAwesomeCardIO.podspec', # React Native SVG'../node_modules/react-native-svg/RNSVG.podspec', # React Native Haptic Feedback'../node_modules/react-native-haptic-feedback/RNReactNativeHapticFeedback.podspec', # @Paciolan/react-native-payments'../node_modules/@paciolan/react-native-payments/lib/ios/ReactNativePayments.podspec', # React Native Webview'../node_modules/react-native-webview/react-native-webview.podspec', # React Native Device Info'../node_modules/react-native-device-info/RNDeviceInfo.podspec', # React Native AsyncStorage'../node_modules/@react-native-community/async-storage/RNCAsyncStorage.podspec' ] # Ties the exact versions so host apps don't need to guess the version # or have a potential mismatch podspecs = react_podspecs + dep_podspecs podspecs.each do |podspec_path| spec = Pod::Specification.from_file podspec_path s.dependency spec.name, "#{spec.version}" end
But now the Podfile for a standalone app has changed dramatically. Do I need to explicity take every podspec file referenced in "Ultimately, your Podfile should look something similar to this" section of the first link and add it to the podspec of my plugin? Thats a lot of Pods.
Here is what I have so far in the podspec of my plugin.. basically trying to mimic the dependencies the standalone app requires.
s.dependency "React-Core", react_native_version s.dependency "React-Core/DevSupport", react_native_version s.dependency "React-Core/RCTWebSocket", react_native_version s.dependency "React-RCTActionSheet", react_native_version s.dependency "React-RCTAnimation", react_native_version s.dependency "React-RCTBlob", react_native_version s.dependency "React-RCTImage", react_native_version s.dependency "React-RCTLinking", react_native_version s.dependency "React-RCTNetwork", react_native_version s.dependency "React-RCTSettings", react_native_version s.dependency "React-RCTText", react_native_version s.dependency "React-RCTVibration", react_native_version # React's Dependencies react_podspecs = ['../node_modules/react-native/Libraries/FBLazyVector/FBLazyVector.podspec','../node_modules/react-native/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec','../node_modules/react-native/Libraries/RCTRequired/RCTRequired.podspec','../node_modules/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec','../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec','../node_modules/react-native/third-party-podspecs/Folly.podspec','../node_modules/react-native/third-party-podspecs/glog.podspec','../node_modules/react-native/ReactCommon/yoga/Yoga.podspec','../node_modules/react-native/React-Core.podspec',"../node_modules/react-native/ReactCommon/ReactCommon.podspec", # '../node_modules/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec', # '../node_modules/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec', # '../node_modules/react-native/Libraries/Blob/React-RCTBlob.podspec', # '../node_modules/react-native/Libraries/Image/React-RCTImage.podspec', # '../node_modules/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec', # '../node_modules/react-native/Libraries/Network/React-RCTNetwork.podspec', # '../node_modules/react-native/Libraries/Settings/React-RCTSettings.podspec', # '../node_modules/react-native/Libraries/Text/React-RCTText.podspec', # '../node_modules/react-native/Libraries/Vibration/React-RCTVibration.podspec','../node_modules/react-native/ReactCommon/cxxreact/React-cxxreact.podspec','../node_modules/react-native/ReactCommon/jsi/React-jsi.podspec','../node_modules/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec','../node_modules/react-native/ReactCommon/jsinspector/React-jsinspector.podspec', ] # Native Dependencies dep_podspecs = [ # CodePush'../node_modules/react-native-code-push/CodePush.podspec', # ReactNativeI18N'../node_modules/react-native-i18n/RNI18N.podspec', # ReactNativeAwesomeCardIO'../node_modules/react-native-awesome-card-io/RNAwesomeCardIO.podspec', # React Native SVG'../node_modules/react-native-svg/RNSVG.podspec', # React Native Haptic Feedback'../node_modules/react-native-haptic-feedback/RNReactNativeHapticFeedback.podspec', # @Paciolan/react-native-payments'../node_modules/@paciolan/react-native-payments/lib/ios/ReactNativePayments.podspec', # React Native Webview'../node_modules/react-native-webview/react-native-webview.podspec', # React Native Device Info'../node_modules/react-native-device-info/RNDeviceInfo.podspec', # React Native AsyncStorage'../node_modules/@react-native-community/async-storage/RNCAsyncStorage.podspec' ] # Ties the exact versions so host apps don't need to guess the version # or have a potential mismatch podspecs = react_podspecs + dep_podspecs podspecs.each do |podspec_path| spec = Pod::Specification.from_file podspec_path s.dependency spec.name, "#{spec.version}" end
However, all the s.dependency references dont download the source when I pod install, they just add a SupportFiles folder in the pod. Should they be explicitly listed as all the others? One of our tasks was to distribute our react-native plugin as a framework and we couldn't figure out how to combine into one framework. Now there will be even more frameworks fro every pod. Any thoughts, comments, etc. appreciated. Thanks for reading.