-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support use without react-native link
; add .podspec
for libraries
#94
Comments
Hi @koenpunt, Thanks for reaching out. Can you explain a little bit what do you mean by this of linking your app? What react library files?
We'd also like to you learn more about your scenario of "brownfield" app. Just out of curiosity, have you considered using our iOS SDK, is there anything that you specifically need from the React-Native SDK? Thanks. |
Hi @dhei, The bridge classes (e.g. To support both ways most libraries include So to give an example, part of my pod 'React', path: '../node_modules/react-native', subspecs: [
'Core',
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
'BatchedBridge',
'RCTImage',
'DevSupport',
'RCTAnimation',
'RCTActionSheet',
'RCTLinkingIOS',
]
pod 'Yoga', path: '../node_modules/react-native/ReactCommon/yoga'
pod 'react-native-safari-view', path: '../node_modules/react-native-safari-view'
pod 'react-native-fbsdk', path: '../node_modules/react-native-fbsdk/ios'
pod 'react-native-google-analytics-bridge', path: '../node_modules/react-native-google-analytics-bridge'
pod 'RNStoreReview', path: '../node_modules/react-native-store-review/ios' As you can see I installed all these libraries using NPM, but installed them using CocoaPods. I think the
Yes, and I can of course initialize the SDK, but there's no way to interact with the native SDK from react native without the bridge classes. |
@koenpunt, my apologies for long delay in responding here. Thanks for providing the detailed information of your scenario. This is a very common scenario and we plan to support it after React Native merging this PR (facebook/react-native#15460). Based on this PR,
Thanks for the patience. We will update this thread once we support this scenario. |
Good!
Why wait for that? Because what I understand from the discussion there, is that they haven’t decided what the right approach would be, which means that it could still take months to land. Where if the podspecs are available earlier it can be used manually like is the case for every other library with a podspec |
It seems that facebook/react-native#15460 has been merged and will probably be included in 0.50 |
I have a so-called "brownfield" app; a native iOS Swift app with integrated React Native views.
To do this I had to add all React libraries as CocoaPods dependencies. But now when I add
mobile-center
as npm dependency and runreact-native link
, it's added correctly, but the project doesn't build because the linked project can't find the React library files.Up until now for all other libraries installed through npm, there was always a
podspec
file for the React Library too. So I just referred to the local podspec file in the node_modules directory, and didn't have to usereact-native link
.So my question is; can there be podspecs added to the different libraries? Or would you accept a PR that does so?
The text was updated successfully, but these errors were encountered: