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
Make react-native-image-picker compatible with use_frameworks #2242
Make react-native-image-picker compatible with use_frameworks #2242
Conversation
s.dependency "RCTTypeSafety" | ||
s.dependency "ReactCommon/turbomodule/core" | ||
if defined?(install_modules_dependencies) != nil | ||
install_modules_dependencies(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function has been defined in 0.70 and allows library maintainers not to care about the internals of React Native. We are going to handle all the dependencies on the internal pods ourselves and, as long as you use this function, you don't have to care about them.
Can someone approve this PR? This solution works. (check on my local project) |
# [7.1.0](v7.0.3...v7.1.0) (2023-12-04) ### Features * add use_frameworks compatibility ([#2242](#2242)) ([6cb36f4](6cb36f4))
🎉 This PR is included in version 7.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks for submitting a PR! Please read these instructions carefully:
main
branch, NOT a "stable" branch.Motivation (required)
react-native-image-picker is not compatible with React Native 0.72, when use_frameworks! is enabled.
It fails to load a module, because it is mixing Swift and Objective-C import styles
Given that React Native is a C++ project and Swift and C++ do not like each other, the current setup is dangerous and can break easily.
This PR updates the podspec introducing the
install_modules_dependencies
function when defined to relieve the burden of properly handling the React Native internals from the library.It also adds the dependency to the Apple's MobileCoreServices, so that we ca import it using the proper Objective-C syntax.
And then uses the right syntax to import the module.
Test Plan (required)
The example app is on 0.71, so the test is limited.
You can run the test by:
and then build and run from Xcode. You'll see the app building successfully.
I also created a new app using React Native 0.72, installed the library with
yarn add react-native-image-picker
and run the same commands.Before applying the patch in this PR, it was failing.
After the patch, it was building successfully.