You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-create-new-file-ios and add RNCreateNewFileUtil.xcodeproj
In XCode, in the project navigator, select your project. Add libRNCreateNewFileUtil.a to your project's Build Phases ➜ Link Binary With Libraries
Click RNCreateNewFileUtil.xcodeproj in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains both$(SRCROOT)/../react-native/React and $(SRCROOT)/../../React - mark both as recursive.
Run your project (Cmd+R)
Setup trouble?
If you get stuck, take a look at Brent Vatne's blog. His blog is my go to reference for this stuff.
The following will cause an error callback (use the console.log to see the specific message):
File already exists - you can use the react-native-check-file-exists-ios package to test if file already exists (to prevent this error)
File name not set in javascript
File name does not contain a valid extension. Hidden files are also not allowed
Acknowledgements
Special thanks to Brent Vatne for his posts on creating a react native packager. Some portions of this code have been based on answers from stackoverflow. This package also owes a special thanks to the tutorial by Modus Create on how to create a custom react native module.
About
A react native interface for creating a unique new file. File must not exist already.