{"id":4341,"url":"https://github.com/rhaker/react-native-create-new-file-ios","last_synced_at":"2025-08-04T01:32:00.193Z","repository":{"id":96671868,"uuid":"41578000","full_name":"rhaker/react-native-create-new-file-ios","owner":"rhaker","description":"A react native interface for creating a unique new file. File must not exist already.","archived":false,"fork":false,"pushed_at":"2016-02-11T01:34:16.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-07T08:33:27.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhaker.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-29T02:40:20.000Z","updated_at":"2023-03-09T05:50:58.000Z","dependencies_parsed_at":"2023-04-11T15:31:30.276Z","dependency_job_id":null,"html_url":"https://github.com/rhaker/react-native-create-new-file-ios","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rhaker/react-native-create-new-file-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaker%2Freact-native-create-new-file-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaker%2Freact-native-create-new-file-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaker%2Freact-native-create-new-file-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaker%2Freact-native-create-new-file-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaker","download_url":"https://codeload.github.com/rhaker/react-native-create-new-file-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaker%2Freact-native-create-new-file-ios/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636316,"owners_count":24282075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:08.869Z","updated_at":"2025-08-04T01:31:59.867Z","avatar_url":"https://github.com/rhaker.png","language":"Objective-C","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"# react-native-create-new-file-ios\n\nThis is a wrapper for react-native that creates a blank new file in the app documents directory. File must not already exist\n\n# Add it to your project\n\nnpm install react-native-create-new-file-ios --save\n\nIn XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]\n\nGo to node_modules ➜ react-native-create-new-file-ios and add RNCreateNewFileUtil.xcodeproj\n\nIn XCode, in the project navigator, select your project. Add libRNCreateNewFileUtil.a to your project's Build Phases ➜ Link Binary With Libraries\n\nClick 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.\n\nRun your project (Cmd+R)\n\nSetup trouble?\n\nIf you get stuck, take a look at Brent Vatne's blog. His blog is my go to reference for this stuff.\n\n# Api Setup\n\n```javascript\nvar React = require('react-native');\n\nvar { NativeModules } = React;\n\nvar { RNCreateNewFileUtil } = NativeModules;\n\nRNCreateNewFileUtil.createFile(\n\n    'MyFile.txt',                   // File name\n\n    function errorCallback(results) {\n\n        console.log('Error: ' + results['errMsg']);\n\n    },\n\n    function successCallback(results) {\n\n        console.log('Success: Blank File Created');\n\n    }\n);\n```\n\n# Error Callback\n\nThe following will cause an error callback (use the console.log to see the specific message):\n\n1) File already exists - you can use the react-native-check-file-exists-ios package to test if file already exists (to prevent this error)\n\n2) File name not set in javascript\n\n3) File name does not contain a valid extension. Hidden files are also not allowed\n\n# Acknowledgements\n\nSpecial 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaker%2Freact-native-create-new-file-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaker%2Freact-native-create-new-file-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaker%2Freact-native-create-new-file-ios/lists"}