├── .gitattributes ├── .gitignore ├── Example ├── .buckconfig ├── .editorconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── color.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── assets │ ├── animated_photo.gif │ ├── info.plist │ └── photo.jpg ├── babel.config.js ├── index.js ├── ios │ ├── Example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Example.xcscheme │ ├── Example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── Podfile ├── metro.config.js └── package.json ├── LICENSE ├── README.md ├── RNFileSelector.js ├── android ├── .classpath ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── ui │ └── fileselector │ ├── RNFileSelectorModule.java │ └── RNFileSelectorPackage.java ├── assets └── setup.png ├── ios ├── RNFileSelector.h ├── RNFileSelector.m ├── RNFileSelector.podspec ├── RNFileSelector.xcodeproj │ └── project.pbxproj └── RNFileSelector.xcworkspace │ └── contents.xcworkspacedata └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # OSX 3 | # 4 | .DS_Store 5 | 6 | # node.js 7 | # 8 | node_modules/ 9 | npm-debug.log 10 | yarn-error.log 11 | 12 | 13 | # Xcode 14 | # 15 | build/ 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | xcuserdata 25 | *.xccheckout 26 | *.moved-aside 27 | DerivedData 28 | *.hmap 29 | *.ipa 30 | *.xcuserstate 31 | project.xcworkspace 32 | 33 | 34 | # Android/IntelliJ 35 | # 36 | build/ 37 | .idea 38 | .gradle 39 | local.properties 40 | *.iml 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | 47 | .history/* -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /Example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /Example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | esproposal.optional_chaining=enable 27 | esproposal.nullish_coalescing=enable 28 | 29 | exact_by_default=true 30 | 31 | module.file_ext=.js 32 | module.file_ext=.json 33 | module.file_ext=.ios.js 34 | 35 | munge_underscores=true 36 | 37 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 38 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 39 | 40 | suppress_type=$FlowIssue 41 | suppress_type=$FlowFixMe 42 | suppress_type=$FlowFixMeProps 43 | suppress_type=$FlowFixMeState 44 | 45 | [lints] 46 | sketchy-null-number=warn 47 | sketchy-null-mixed=warn 48 | sketchy-number=warn 49 | untyped-type-import=warn 50 | nonstrict-import=warn 51 | deprecated-type=warn 52 | unsafe-getters-setters=warn 53 | unnecessary-invariant=warn 54 | signature-verification-failure=warn 55 | 56 | [strict] 57 | deprecated-type 58 | nonstrict-import 59 | sketchy-null 60 | unclear-type 61 | unsafe-getters-setters 62 | untyped-import 63 | untyped-type-import 64 | 65 | [version] 66 | ^0.137.0 67 | -------------------------------------------------------------------------------- /Example/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /Example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /Example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, {Component} from 'react'; 8 | import {Platform, StyleSheet, Text, View, TouchableOpacity} from 'react-native'; 9 | 10 | import RNFileSelector from 'react-native-file-selector'; 11 | 12 | import RNFS from 'react-native-fs'; 13 | 14 | import animatedPhoto from './assets/animated_photo.gif'; 15 | import photo from './assets/photo.jpg'; 16 | // import info from './assets/nfo.plist' 17 | 18 | export default class App extends Component { 19 | constructor(props) { 20 | super(props); 21 | 22 | this.state = { 23 | visible: false, 24 | }; 25 | } 26 | 27 | _onPress() { 28 | let filter; 29 | if (Platform.OS === 'ios') { 30 | filter = []; 31 | } else if (Platform.OS === 'android') { 32 | filter = '.*\\.*'; 33 | } 34 | 35 | RNFileSelector.Show({ 36 | path: RNFS.DocumentDirectoryPath, 37 | filter: filter, 38 | title: 'Select File', 39 | closeMenu: true, 40 | editable: true, 41 | onDone: path => { 42 | console.log('file selected: ' + path); 43 | }, 44 | onCancel: () => { 45 | console.log('cancelled'); 46 | }, 47 | }); 48 | } 49 | 50 | componentDidMount() { 51 | // create a path you want to write to 52 | let animatedPhotoPath = RNFS.DocumentDirectoryPath + '/animated_photo.gif'; 53 | let photoPath = RNFS.DocumentDirectoryPath + '/photo.jpg'; 54 | // let infoPath = RNFS.DocumentDirectoryPath + "/info.plist"; 55 | let assetsPath = RNFS.DocumentDirectoryPath + '/assets'; 56 | 57 | // write the file 58 | RNFS.writeFile(animatedPhotoPath, animatedPhoto, 'utf8') 59 | .then(success => { 60 | console.log('FILE WRITTEN!'); 61 | }) 62 | .catch(err => { 63 | console.log(err.message); 64 | }); 65 | 66 | RNFS.writeFile(photoPath, photo, 'utf8') 67 | .then(success => { 68 | console.log('FILE WRITTEN!'); 69 | }) 70 | .catch(err => { 71 | console.log(err.message); 72 | }); 73 | 74 | RNFS.mkdir(assetsPath).then(success => { 75 | console.log('DIRECTORY CREATED'); 76 | 77 | RNFS.writeFile(assetsPath + '/animated_photo.gif', animatedPhoto, 'utf8') 78 | .then(success => { 79 | console.log('DIRECTORY WRITTEN!'); 80 | }) 81 | .catch(err => { 82 | console.log(err.message); 83 | }); 84 | 85 | RNFS.writeFile(assetsPath + '/photo.jpg', photo, 'utf8') 86 | .then(success => { 87 | console.log('DIRECTORY WRITTEN!'); 88 | }) 89 | .catch(err => { 90 | console.log(err.message); 91 | }); 92 | }); 93 | 94 | // RNFS.writeFile(infoPath, info, "utf8") 95 | // .then(success => { 96 | // console.log("FILE WRITTEN!"); 97 | // }) 98 | // .catch(err => { 99 | // console.log(err.message); 100 | // }); 101 | } 102 | 103 | render() { 104 | return ( 105 | 106 | { 108 | this._onPress(); 109 | 110 | // this.setState({ visible: true }); 111 | }}> 112 | Click 113 | { 117 | console.log('file selected: ' + path); 118 | }} 119 | onCancel={() => { 120 | console.log('cancelled'); 121 | }} 122 | /> 123 | 124 | 125 | ); 126 | } 127 | } 128 | 129 | const styles = StyleSheet.create({ 130 | container: { 131 | flex: 1, 132 | justifyContent: 'center', 133 | alignItems: 'center', 134 | backgroundColor: '#F5FCFF', 135 | }, 136 | }); 137 | -------------------------------------------------------------------------------- /Example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /Example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /Example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and mirrored here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | android { 124 | ndkVersion rootProject.ext.ndkVersion 125 | 126 | compileSdkVersion rootProject.ext.compileSdkVersion 127 | 128 | compileOptions { 129 | sourceCompatibility JavaVersion.VERSION_1_8 130 | targetCompatibility JavaVersion.VERSION_1_8 131 | } 132 | 133 | defaultConfig { 134 | applicationId "com.example" 135 | minSdkVersion rootProject.ext.minSdkVersion 136 | targetSdkVersion rootProject.ext.targetSdkVersion 137 | versionCode 1 138 | versionName "1.0" 139 | } 140 | splits { 141 | abi { 142 | reset() 143 | enable enableSeparateBuildPerCPUArchitecture 144 | universalApk false // If true, also generate a universal APK 145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 146 | } 147 | } 148 | signingConfigs { 149 | debug { 150 | storeFile file('debug.keystore') 151 | storePassword 'android' 152 | keyAlias 'androiddebugkey' 153 | keyPassword 'android' 154 | } 155 | } 156 | buildTypes { 157 | debug { 158 | signingConfig signingConfigs.debug 159 | } 160 | release { 161 | // Caution! In production, you need to generate your own keystore file. 162 | // see https://reactnative.dev/docs/signed-apk-android. 163 | signingConfig signingConfigs.debug 164 | minifyEnabled enableProguardInReleaseBuilds 165 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 166 | } 167 | } 168 | 169 | // applicationVariants are e.g. debug, release 170 | applicationVariants.all { variant -> 171 | variant.outputs.each { output -> 172 | // For each separate APK per architecture, set a unique version code as described here: 173 | // https://developer.android.com/studio/build/configure-apk-splits.html 174 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 175 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 176 | def abi = output.getFilter(OutputFile.ABI) 177 | if (abi != null) { // null for the universal-debug, universal-release variants 178 | output.versionCodeOverride = 179 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 180 | } 181 | 182 | } 183 | } 184 | } 185 | 186 | dependencies { 187 | implementation fileTree(dir: "libs", include: ["*.jar"]) 188 | //noinspection GradleDynamicVersion 189 | implementation "com.facebook.react:react-native:+" // From node_modules 190 | 191 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 192 | 193 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 194 | exclude group:'com.facebook.fbjni' 195 | } 196 | 197 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 198 | exclude group:'com.facebook.flipper' 199 | exclude group:'com.squareup.okhttp3', module:'okhttp' 200 | } 201 | 202 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 203 | exclude group:'com.facebook.flipper' 204 | } 205 | 206 | if (enableHermes) { 207 | def hermesPath = "../../node_modules/hermes-engine/android/"; 208 | debugImplementation files(hermesPath + "hermes-debug.aar") 209 | releaseImplementation files(hermesPath + "hermes-release.aar") 210 | } else { 211 | implementation jscFlavor 212 | } 213 | } 214 | 215 | // Run this once to be able to run the application with BUCK 216 | // puts all compile dependencies into folder libs for BUCK to use 217 | task copyDownloadableDepsToLibs(type: Copy) { 218 | from configurations.compile 219 | into 'libs' 220 | } 221 | 222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 223 | -------------------------------------------------------------------------------- /Example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /Example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/debug.keystore -------------------------------------------------------------------------------- /Example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "Example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.example.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Example 3 | 4 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "29.0.3" 6 | minSdkVersion = 21 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.1.0") 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | maven { 38 | url "http://dl.bintray.com/lukaville/maven" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.75.1 29 | -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /Example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /Example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /Example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /Example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "displayName": "Example" 4 | } -------------------------------------------------------------------------------- /Example/assets/animated_photo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/assets/animated_photo.gif -------------------------------------------------------------------------------- /Example/assets/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 8 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/assets/photo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/Example/assets/photo.jpg -------------------------------------------------------------------------------- /Example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /Example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 12 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 13 | 81485BF3268DE5F400D5AE42 /* libswiftWebKit.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 81485BF2268DE5F400D5AE42 /* libswiftWebKit.tbd */; }; 14 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 15 | EEA98F64C03F8E2549EF4B3F /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D27857551015F817F129B9F3 /* Pods_Example.framework */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 20 | 00E356F21AD99517003FC87E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; }; 21 | 10FF54DD63A6D84457468191 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 22 | 13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Example/AppDelegate.h; sourceTree = ""; }; 24 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Example/AppDelegate.m; sourceTree = ""; }; 25 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = ""; }; 26 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; }; 27 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Example/main.m; sourceTree = ""; }; 28 | 254257A6570C8315C121E50E /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 29 | 81485BF2268DE5F400D5AE42 /* libswiftWebKit.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libswiftWebKit.tbd; path = usr/lib/swift/libswiftWebKit.tbd; sourceTree = SDKROOT; }; 30 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Example/LaunchScreen.storyboard; sourceTree = ""; }; 31 | D27857551015F817F129B9F3 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | 81485BF3268DE5F400D5AE42 /* libswiftWebKit.tbd in Frameworks */, 41 | EEA98F64C03F8E2549EF4B3F /* Pods_Example.framework in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 00E356EF1AD99517003FC87E /* ExampleTests */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 00E356F21AD99517003FC87E /* ExampleTests.m */, 52 | 00E356F01AD99517003FC87E /* Supporting Files */, 53 | ); 54 | path = ExampleTests; 55 | sourceTree = ""; 56 | }; 57 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 00E356F11AD99517003FC87E /* Info.plist */, 61 | ); 62 | name = "Supporting Files"; 63 | sourceTree = ""; 64 | }; 65 | 13B07FAE1A68108700A75B9A /* Example */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 69 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 70 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 71 | 13B07FB61A68108700A75B9A /* Info.plist */, 72 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 73 | 13B07FB71A68108700A75B9A /* main.m */, 74 | ); 75 | name = Example; 76 | sourceTree = ""; 77 | }; 78 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 81485BF2268DE5F400D5AE42 /* libswiftWebKit.tbd */, 82 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 83 | D27857551015F817F129B9F3 /* Pods_Example.framework */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | ); 92 | name = Libraries; 93 | sourceTree = ""; 94 | }; 95 | 83CBB9F61A601CBA00E9B192 = { 96 | isa = PBXGroup; 97 | children = ( 98 | 13B07FAE1A68108700A75B9A /* Example */, 99 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 100 | 00E356EF1AD99517003FC87E /* ExampleTests */, 101 | 83CBBA001A601CBA00E9B192 /* Products */, 102 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 103 | AA883CB79623FD58A75CF863 /* Pods */, 104 | ); 105 | indentWidth = 2; 106 | sourceTree = ""; 107 | tabWidth = 2; 108 | usesTabs = 0; 109 | }; 110 | 83CBBA001A601CBA00E9B192 /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 13B07F961A680F5B00A75B9A /* Example.app */, 114 | ); 115 | name = Products; 116 | sourceTree = ""; 117 | }; 118 | AA883CB79623FD58A75CF863 /* Pods */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 10FF54DD63A6D84457468191 /* Pods-Example.debug.xcconfig */, 122 | 254257A6570C8315C121E50E /* Pods-Example.release.xcconfig */, 123 | ); 124 | path = Pods; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 13B07F861A680F5B00A75B9A /* Example */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */; 133 | buildPhases = ( 134 | B30FBA541266AD3A9CE35049 /* [CP] Check Pods Manifest.lock */, 135 | FD10A7F022414F080027D42C /* Start Packager */, 136 | 13B07F871A680F5B00A75B9A /* Sources */, 137 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 138 | 13B07F8E1A680F5B00A75B9A /* Resources */, 139 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 140 | 0241099B4D17CAFE2F3AAFDD /* [CP] Embed Pods Frameworks */, 141 | 4B2DA9BC8A18A7B2B6B19D2E /* [CP] Copy Pods Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Example; 148 | productName = Example; 149 | productReference = 13B07F961A680F5B00A75B9A /* Example.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 1210; 159 | TargetAttributes = { 160 | 13B07F861A680F5B00A75B9A = { 161 | LastSwiftMigration = 1120; 162 | }; 163 | }; 164 | }; 165 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */; 166 | compatibilityVersion = "Xcode 12.0"; 167 | developmentRegion = en; 168 | hasScannedForEncodings = 0; 169 | knownRegions = ( 170 | en, 171 | Base, 172 | ); 173 | mainGroup = 83CBB9F61A601CBA00E9B192; 174 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 175 | projectDirPath = ""; 176 | projectRoot = ""; 177 | targets = ( 178 | 13B07F861A680F5B00A75B9A /* Example */, 179 | ); 180 | }; 181 | /* End PBXProject section */ 182 | 183 | /* Begin PBXResourcesBuildPhase section */ 184 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 185 | isa = PBXResourcesBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 189 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXResourcesBuildPhase section */ 194 | 195 | /* Begin PBXShellScriptBuildPhase section */ 196 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 197 | isa = PBXShellScriptBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | ); 201 | inputPaths = ( 202 | ); 203 | name = "Bundle React Native code and images"; 204 | outputPaths = ( 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | shellPath = /bin/sh; 208 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 209 | }; 210 | 0241099B4D17CAFE2F3AAFDD /* [CP] Embed Pods Frameworks */ = { 211 | isa = PBXShellScriptBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | inputFileListPaths = ( 216 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 217 | ); 218 | name = "[CP] Embed Pods Frameworks"; 219 | outputFileListPaths = ( 220 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | shellPath = /bin/sh; 224 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; 225 | showEnvVarsInLog = 0; 226 | }; 227 | 4B2DA9BC8A18A7B2B6B19D2E /* [CP] Copy Pods Resources */ = { 228 | isa = PBXShellScriptBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | inputFileListPaths = ( 233 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-input-files.xcfilelist", 234 | ); 235 | name = "[CP] Copy Pods Resources"; 236 | outputFileListPaths = ( 237 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-output-files.xcfilelist", 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | shellPath = /bin/sh; 241 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; 242 | showEnvVarsInLog = 0; 243 | }; 244 | B30FBA541266AD3A9CE35049 /* [CP] Check Pods Manifest.lock */ = { 245 | isa = PBXShellScriptBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ); 249 | inputFileListPaths = ( 250 | ); 251 | inputPaths = ( 252 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 253 | "${PODS_ROOT}/Manifest.lock", 254 | ); 255 | name = "[CP] Check Pods Manifest.lock"; 256 | outputFileListPaths = ( 257 | ); 258 | outputPaths = ( 259 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | shellPath = /bin/sh; 263 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 264 | showEnvVarsInLog = 0; 265 | }; 266 | FD10A7F022414F080027D42C /* Start Packager */ = { 267 | isa = PBXShellScriptBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | inputFileListPaths = ( 272 | ); 273 | inputPaths = ( 274 | ); 275 | name = "Start Packager"; 276 | outputFileListPaths = ( 277 | ); 278 | outputPaths = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 283 | showEnvVarsInLog = 0; 284 | }; 285 | /* End PBXShellScriptBuildPhase section */ 286 | 287 | /* Begin PBXSourcesBuildPhase section */ 288 | 13B07F871A680F5B00A75B9A /* Sources */ = { 289 | isa = PBXSourcesBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 293 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin XCBuildConfiguration section */ 300 | 13B07F941A680F5B00A75B9A /* Debug */ = { 301 | isa = XCBuildConfiguration; 302 | baseConfigurationReference = 10FF54DD63A6D84457468191 /* Pods-Example.debug.xcconfig */; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | CLANG_ENABLE_MODULES = YES; 306 | CURRENT_PROJECT_VERSION = 1; 307 | ENABLE_BITCODE = NO; 308 | INFOPLIST_FILE = Example/Info.plist; 309 | LD_RUNPATH_SEARCH_PATHS = ( 310 | "$(inherited)", 311 | "@executable_path/Frameworks", 312 | ); 313 | LIBRARY_SEARCH_PATHS = ( 314 | "$(inherited)", 315 | "$(SDKROOT)/usr/lib/swift", 316 | ); 317 | OTHER_LDFLAGS = ( 318 | "$(inherited)", 319 | "-ObjC", 320 | "-lc++", 321 | ); 322 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 323 | PRODUCT_NAME = Example; 324 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 325 | SWIFT_VERSION = 5.0; 326 | VERSIONING_SYSTEM = "apple-generic"; 327 | }; 328 | name = Debug; 329 | }; 330 | 13B07F951A680F5B00A75B9A /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | baseConfigurationReference = 254257A6570C8315C121E50E /* Pods-Example.release.xcconfig */; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | CLANG_ENABLE_MODULES = YES; 336 | CURRENT_PROJECT_VERSION = 1; 337 | INFOPLIST_FILE = Example/Info.plist; 338 | LD_RUNPATH_SEARCH_PATHS = ( 339 | "$(inherited)", 340 | "@executable_path/Frameworks", 341 | ); 342 | LIBRARY_SEARCH_PATHS = ( 343 | "$(inherited)", 344 | "$(SDKROOT)/usr/lib/swift", 345 | ); 346 | OTHER_LDFLAGS = ( 347 | "$(inherited)", 348 | "-ObjC", 349 | "-lc++", 350 | ); 351 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 352 | PRODUCT_NAME = Example; 353 | SWIFT_VERSION = 5.0; 354 | VERSIONING_SYSTEM = "apple-generic"; 355 | }; 356 | name = Release; 357 | }; 358 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ALWAYS_SEARCH_USER_PATHS = NO; 362 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 363 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 364 | CLANG_CXX_LIBRARY = "libc++"; 365 | CLANG_ENABLE_MODULES = YES; 366 | CLANG_ENABLE_OBJC_ARC = YES; 367 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 368 | CLANG_WARN_BOOL_CONVERSION = YES; 369 | CLANG_WARN_COMMA = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 372 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 373 | CLANG_WARN_EMPTY_BODY = YES; 374 | CLANG_WARN_ENUM_CONVERSION = YES; 375 | CLANG_WARN_INFINITE_RECURSION = YES; 376 | CLANG_WARN_INT_CONVERSION = YES; 377 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 378 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 379 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 381 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 382 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 383 | CLANG_WARN_STRICT_PROTOTYPES = YES; 384 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 385 | CLANG_WARN_UNREACHABLE_CODE = YES; 386 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 387 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 388 | COPY_PHASE_STRIP = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | ENABLE_TESTABILITY = YES; 391 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 392 | GCC_C_LANGUAGE_STANDARD = gnu99; 393 | GCC_DYNAMIC_NO_PIC = NO; 394 | GCC_NO_COMMON_BLOCKS = YES; 395 | GCC_OPTIMIZATION_LEVEL = 0; 396 | GCC_PREPROCESSOR_DEFINITIONS = ( 397 | "DEBUG=1", 398 | "$(inherited)", 399 | ); 400 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 401 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 402 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 403 | GCC_WARN_UNDECLARED_SELECTOR = YES; 404 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 405 | GCC_WARN_UNUSED_FUNCTION = YES; 406 | GCC_WARN_UNUSED_VARIABLE = YES; 407 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 408 | LD_RUNPATH_SEARCH_PATHS = ( 409 | /usr/lib/swift, 410 | "$(inherited)", 411 | ); 412 | LIBRARY_SEARCH_PATHS = ( 413 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 414 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 415 | "\"$(inherited)\"", 416 | ); 417 | MTL_ENABLE_DEBUG_INFO = YES; 418 | ONLY_ACTIVE_ARCH = YES; 419 | SDKROOT = iphoneos; 420 | }; 421 | name = Debug; 422 | }; 423 | 83CBBA211A601CBA00E9B192 /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ALWAYS_SEARCH_USER_PATHS = NO; 427 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 428 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 429 | CLANG_CXX_LIBRARY = "libc++"; 430 | CLANG_ENABLE_MODULES = YES; 431 | CLANG_ENABLE_OBJC_ARC = YES; 432 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 433 | CLANG_WARN_BOOL_CONVERSION = YES; 434 | CLANG_WARN_COMMA = YES; 435 | CLANG_WARN_CONSTANT_CONVERSION = YES; 436 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_EMPTY_BODY = YES; 439 | CLANG_WARN_ENUM_CONVERSION = YES; 440 | CLANG_WARN_INFINITE_RECURSION = YES; 441 | CLANG_WARN_INT_CONVERSION = YES; 442 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 443 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 444 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 446 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 447 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 448 | CLANG_WARN_STRICT_PROTOTYPES = YES; 449 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 450 | CLANG_WARN_UNREACHABLE_CODE = YES; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 453 | COPY_PHASE_STRIP = YES; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 457 | GCC_C_LANGUAGE_STANDARD = gnu99; 458 | GCC_NO_COMMON_BLOCKS = YES; 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNDECLARED_SELECTOR = YES; 462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 463 | GCC_WARN_UNUSED_FUNCTION = YES; 464 | GCC_WARN_UNUSED_VARIABLE = YES; 465 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 466 | LD_RUNPATH_SEARCH_PATHS = ( 467 | /usr/lib/swift, 468 | "$(inherited)", 469 | ); 470 | LIBRARY_SEARCH_PATHS = ( 471 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 472 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 473 | "\"$(inherited)\"", 474 | ); 475 | MTL_ENABLE_DEBUG_INFO = NO; 476 | SDKROOT = iphoneos; 477 | VALIDATE_PRODUCT = YES; 478 | }; 479 | name = Release; 480 | }; 481 | /* End XCBuildConfiguration section */ 482 | 483 | /* Begin XCConfigurationList section */ 484 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */ = { 485 | isa = XCConfigurationList; 486 | buildConfigurations = ( 487 | 13B07F941A680F5B00A75B9A /* Debug */, 488 | 13B07F951A680F5B00A75B9A /* Release */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 83CBBA201A601CBA00E9B192 /* Debug */, 497 | 83CBBA211A601CBA00E9B192 /* Release */, 498 | ); 499 | defaultConfigurationIsVisible = 0; 500 | defaultConfigurationName = Release; 501 | }; 502 | /* End XCConfigurationList section */ 503 | }; 504 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 505 | } 506 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Example/ios/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"Example" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/ios/Example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/ios/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/ios/Example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ios/Example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'Example' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | use_frameworks! :linkage => :static 16 | 17 | pod 'FileBrowser', :git => 'https://github.com/prscX/FileBrowser' 18 | 19 | # Enables Flipper. 20 | # 21 | # Note that if you have use_frameworks! enabled, Flipper will not work and 22 | # you should disable the next line. 23 | use_flipper!() 24 | 25 | post_install do |installer| 26 | react_native_post_install(installer) 27 | end 28 | 29 | $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 30 | 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', 31 | 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', 32 | 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native'] 33 | 34 | pre_install do |installer| 35 | Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} 36 | installer.pod_targets.each do |pod| 37 | if $static_framework.include?(pod.name) 38 | def pod.build_type; 39 | Pod::BuildType.static_library 40 | end 41 | end 42 | end 43 | end 44 | 45 | end -------------------------------------------------------------------------------- /Example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /Example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "react": "17.0.1", 14 | "react-native": "0.64.2", 15 | "react-native-fs": "2.18.0", 16 | "react-native-file-selector": "../" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.14.6", 20 | "@babel/runtime": "^7.14.6", 21 | "@react-native-community/eslint-config": "^3.0.0", 22 | "babel-jest": "^27.0.6", 23 | "eslint": "^7.29.0", 24 | "jest": "^27.0.6", 25 | "metro-react-native-babel-preset": "^0.66.0", 26 | "react-test-renderer": "17.0.1" 27 | }, 28 | "jest": { 29 | "preset": "react-native" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 3 | Apache License 4 | Version 2.0, January 2004 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, 12 | and distribution as defined by Sections 1 through 9 of this document. 13 | 14 | "Licensor" shall mean the copyright owner or entity authorized by 15 | the copyright owner that is granting the License. 16 | 17 | "Legal Entity" shall mean the union of the acting entity and all 18 | other entities that control, are controlled by, or are under common 19 | control with that entity. For the purposes of this definition, 20 | "control" means (i) the power, direct or indirect, to cause the 21 | direction or management of such entity, whether by contract or 22 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 23 | outstanding shares, or (iii) beneficial ownership of such entity. 24 | 25 | "You" (or "Your") shall mean an individual or Legal Entity 26 | exercising permissions granted by this License. 27 | 28 | "Source" form shall mean the preferred form for making modifications, 29 | including but not limited to software source code, documentation 30 | source, and configuration files. 31 | 32 | "Object" form shall mean any form resulting from mechanical 33 | transformation or translation of a Source form, including but 34 | not limited to compiled object code, generated documentation, 35 | and conversions to other media types. 36 | 37 | "Work" shall mean the work of authorship, whether in Source or 38 | Object form, made available under the License, as indicated by a 39 | copyright notice that is included in or attached to the work 40 | (an example is provided in the Appendix below). 41 | 42 | "Derivative Works" shall mean any work, whether in Source or Object 43 | form, that is based on (or derived from) the Work and for which the 44 | editorial revisions, annotations, elaborations, or other modifications 45 | represent, as a whole, an original work of authorship. For the purposes 46 | of this License, Derivative Works shall not include works that remain 47 | separable from, or merely link (or bind by name) to the interfaces of, 48 | the Work and Derivative Works thereof. 49 | 50 | "Contribution" shall mean any work of authorship, including 51 | the original version of the Work and any modifications or additions 52 | to that Work or Derivative Works thereof, that is intentionally 53 | submitted to Licensor for inclusion in the Work by the copyright owner 54 | or by an individual or Legal Entity authorized to submit on behalf of 55 | the copyright owner. For the purposes of this definition, "submitted" 56 | means any form of electronic, verbal, or written communication sent 57 | to the Licensor or its representatives, including but not limited to 58 | communication on electronic mailing lists, source code control systems, 59 | and issue tracking systems that are managed by, or on behalf of, the 60 | Licensor for the purpose of discussing and improving the Work, but 61 | excluding communication that is conspicuously marked or otherwise 62 | designated in writing by the copyright owner as "Not a Contribution." 63 | 64 | "Contributor" shall mean Licensor and any individual or Legal Entity 65 | on behalf of whom a Contribution has been received by Licensor and 66 | subsequently incorporated within the Work. 67 | 68 | 2. Grant of Copyright License. Subject to the terms and conditions of 69 | this License, each Contributor hereby grants to You a perpetual, 70 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 71 | copyright license to reproduce, prepare Derivative Works of, 72 | publicly display, publicly perform, sublicense, and distribute the 73 | Work and such Derivative Works in Source or Object form. 74 | 75 | 3. Grant of Patent License. Subject to the terms and conditions of 76 | this License, each Contributor hereby grants to You a perpetual, 77 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 78 | (except as stated in this section) patent license to make, have made, 79 | use, offer to sell, sell, import, and otherwise transfer the Work, 80 | where such license applies only to those patent claims licensable 81 | by such Contributor that are necessarily infringed by their 82 | Contribution(s) alone or by combination of their Contribution(s) 83 | with the Work to which such Contribution(s) was submitted. If You 84 | institute patent litigation against any entity (including a 85 | cross-claim or counterclaim in a lawsuit) alleging that the Work 86 | or a Contribution incorporated within the Work constitutes direct 87 | or contributory patent infringement, then any patent licenses 88 | granted to You under this License for that Work shall terminate 89 | as of the date such litigation is filed. 90 | 91 | 4. Redistribution. You may reproduce and distribute copies of the 92 | Work or Derivative Works thereof in any medium, with or without 93 | modifications, and in Source or Object form, provided that You 94 | meet the following conditions: 95 | 96 | (a) You must give any other recipients of the Work or 97 | Derivative Works a copy of this License; and 98 | 99 | (b) You must cause any modified files to carry prominent notices 100 | stating that You changed the files; and 101 | 102 | (c) You must retain, in the Source form of any Derivative Works 103 | that You distribute, all copyright, patent, trademark, and 104 | attribution notices from the Source form of the Work, 105 | excluding those notices that do not pertain to any part of 106 | the Derivative Works; and 107 | 108 | (d) If the Work includes a "NOTICE" text file as part of its 109 | distribution, then any Derivative Works that You distribute must 110 | include a readable copy of the attribution notices contained 111 | within such NOTICE file, excluding those notices that do not 112 | pertain to any part of the Derivative Works, in at least one 113 | of the following places: within a NOTICE text file distributed 114 | as part of the Derivative Works; within the Source form or 115 | documentation, if provided along with the Derivative Works; or, 116 | within a display generated by the Derivative Works, if and 117 | wherever such third-party notices normally appear. The contents 118 | of the NOTICE file are for informational purposes only and 119 | do not modify the License. You may add Your own attribution 120 | notices within Derivative Works that You distribute, alongside 121 | or as an addendum to the NOTICE text from the Work, provided 122 | that such additional attribution notices cannot be construed 123 | as modifying the License. 124 | 125 | You may add Your own copyright statement to Your modifications and 126 | may provide additional or different license terms and conditions 127 | for use, reproduction, or distribution of Your modifications, or 128 | for any such Derivative Works as a whole, provided Your use, 129 | reproduction, and distribution of the Work otherwise complies with 130 | the conditions stated in this License. 131 | 132 | 5. Submission of Contributions. Unless You explicitly state otherwise, 133 | any Contribution intentionally submitted for inclusion in the Work 134 | by You to the Licensor shall be under the terms and conditions of 135 | this License, without any additional terms or conditions. 136 | Notwithstanding the above, nothing herein shall supersede or modify 137 | the terms of any separate license agreement you may have executed 138 | with Licensor regarding such Contributions. 139 | 140 | 6. Trademarks. This License does not grant permission to use the trade 141 | names, trademarks, service marks, or product names of the Licensor, 142 | except as required for reasonable and customary use in describing the 143 | origin of the Work and reproducing the content of the NOTICE file. 144 | 145 | 7. Disclaimer of Warranty. Unless required by applicable law or 146 | agreed to in writing, Licensor provides the Work (and each 147 | Contributor provides its Contributions) on an "AS IS" BASIS, 148 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 149 | implied, including, without limitation, any warranties or conditions 150 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 151 | PARTICULAR PURPOSE. You are solely responsible for determining the 152 | appropriateness of using or redistributing the Work and assume any 153 | risks associated with Your exercise of permissions under this License. 154 | 155 | 8. Limitation of Liability. In no event and under no legal theory, 156 | whether in tort (including negligence), contract, or otherwise, 157 | unless required by applicable law (such as deliberate and grossly 158 | negligent acts) or agreed to in writing, shall any Contributor be 159 | liable to You for damages, including any direct, indirect, special, 160 | incidental, or consequential damages of any character arising as a 161 | result of this License or out of the use or inability to use the 162 | Work (including but not limited to damages for loss of goodwill, 163 | work stoppage, computer failure or malfunction, or any and all 164 | other commercial damages or losses), even if such Contributor 165 | has been advised of the possibility of such damages. 166 | 167 | 9. Accepting Warranty or Additional Liability. While redistributing 168 | the Work or Derivative Works thereof, You may choose to offer, 169 | and charge a fee for, acceptance of support, warranty, indemnity, 170 | or other liability obligations and/or rights consistent with this 171 | License. However, in accepting such obligations, You may act only 172 | on Your own behalf and on Your sole responsibility, not on behalf 173 | of any other Contributor, and only if You agree to indemnify, 174 | defend, and hold each Contributor harmless for any liability 175 | incurred by, or claims asserted against, such Contributor by reason 176 | of your accepting any such warranty or additional liability. 177 | 178 | END OF TERMS AND CONDITIONS 179 | 180 | APPENDIX: How to apply the Apache License to your work. 181 | 182 | To apply the Apache License to your work, attach the following 183 | boilerplate notice, with the fields enclosed by brackets "[]" 184 | replaced with your own identifying information. (Don't include 185 | the brackets!) The text should be enclosed in the appropriate 186 | comment syntax for the file format. We also recommend that a 187 | file or class name and description of purpose be included on the 188 | same "printed page" as the copyright notice for easier 189 | identification within third-party archives. 190 | 191 | Copyright @ [Pranav Raj Singh Chauhan] 192 | 193 | Licensed under the Apache License, Version 2.0 (the "License"); 194 | you may not use this file except in compliance with the License. 195 | You may obtain a copy of the License at 196 | 197 | http://www.apache.org/licenses/LICENSE-2.0 198 | 199 | Unless required by applicable law or agreed to in writing, software 200 | distributed under the License is distributed on an "AS IS" BASIS, 201 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 202 | See the License for the specific language governing permissions and 203 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 |

6 | 7 | PRs Welcome 8 | 9 |

10 | 11 | ReactNative: Native File Selector (Android/iOS) 12 | 13 | If this project has helped you out, please support us with a star 🌟 14 |

15 | 16 | This library is a ReactNative Bridge around native libraries. It allows you to natively select/pick file from device file system: 17 | 18 | 19 | | **Android: [nbsp-team/MaterialFilePicker/](https://github.com/nbsp-team/MaterialFilePicker)** | 20 | | ----------------- | 21 | | | 22 | 23 | 24 | > **Note**: It allows you to pick file without using Intent/Third Party Software 25 | 26 | | **iOS: [marmelroy/FileBrowser](https://github.com/marmelroy/FileBrowser)** | 27 | | ----------------- | 28 | | | 29 | 30 | 31 | > **Note**: It allows you to select only local files associate to app sandbox. 32 | 33 | 34 | ## 📖 Getting started 35 | `$ npm install react-native-file-selector --save` 36 | 37 | > This library is supports RN60 and above 38 | 39 | - **iOS** 40 | 41 | > **iOS Prerequisite:** Please make sure `CocoaPods` is installed on your system 42 | 43 | - Add the following to your `Podfile` -> `ios/Podfile` and run pod update: 44 | 45 | 46 | ``` 47 | use_native_modules! 48 | 49 | pod 'RNFileSelector', :path => '../node_modules/react-native-file-selector/ios' 50 | 51 | use_frameworks! :linkage => :static 52 | 53 | pod 'FileBrowser', :git => 'https://github.com/prscX/FileBrowser' 54 | 55 | # Follow [Flipper iOS Setup Guidelines](https://fbflipper.com/docs/getting-started/ios-native) 56 | # This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile 57 | $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 58 | 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', 59 | 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', 60 | 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native'] 61 | 62 | pre_install do |installer| 63 | Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} 64 | installer.pod_targets.each do |pod| 65 | if $static_framework.include?(pod.name) 66 | def pod.build_type; 67 | Pod::BuildType.static_library 68 | end 69 | end 70 | end 71 | end 72 | ``` 73 | 74 | - Please make sure [**Flipper iOS Setup Guidelines**](https://fbflipper.com/docs/getting-started/ios-native/) steps are added to Podfile, since iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile 75 | 76 | 77 | - **Android** 78 | 79 | - Add below color attributes in your app's `android/app/src/main/res/values/color.xml` file. You can provide your own color codes. 80 | 81 | ``` 82 | 83 | 84 | #3F51B5 85 | #303F9F 86 | #FF4081 87 | 88 | ``` 89 | 90 | ## 💻 Usage 91 | 92 | `import RNFileSelector from 'react-native-file-selector';` 93 | 94 | - API Way 95 | 96 | ```javascript 97 | RNFileSelector.Show( 98 | { 99 | title: 'Select File', 100 | onDone: (path) => { 101 | console.log('file selected: ' + path) 102 | }, 103 | onCancel: () => { 104 | console.log('cancelled') 105 | } 106 | } 107 | ) 108 | ``` 109 | 110 | - React Way 111 | 112 | ```javascript 113 | { 114 | console.log("file selected: " + path); 115 | }} onCancel={() => { 116 | console.log("cancelled"); 117 | }}/> 118 | ``` 119 | 120 | 121 | ## 💡 Props 122 | 123 | 124 | | Prop | Type | Default | Note | 125 | | ----------------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------------- | 126 | | `title` | `string` | | Title on the toolbar 127 | | `closeMenu` | `string` | true | Color of tint 128 | | `hiddenFiles: Android` | `bool` | false | If true it shows hidden files as well | 129 | | `path` | `string` | | Path of directory | | 130 | | `filter` | `string` | | Filter to sort the files | | 131 | | `filterDirectories: Android` | `bool` | | Filter should be applied on directories or not 132 | | `onDone` | `func` | | Function called when file is selected | | 133 | | `onCancel` | `func` | | Function called when file selector is closed without selecting any file | | 134 | | `visible` | `bool` | false | To invoke file selector | | 135 | 136 | 137 | > **Note** 138 | > - **Filter** 139 | > - **Android:** Please find [regex/Pattern](https://developer.android.com/reference/java/util/regex/Pattern.html) for defining filter 140 | > - **iOS:** Array of file extension needs to be ignore 141 | 142 | 143 | ## ✨ Credits 144 | 145 | - Android: [nbsp-team/MaterialFilePicker/](https://github.com/nbsp-team/MaterialFilePicker) 146 | - iOS: [marmelroy/FileBrowser](https://github.com/marmelroy/FileBrowser) 147 | 148 | ## 🤔 How to contribute 149 | Have an idea? Found a bug? Please raise to [ISSUES](https://github.com/prscX/react-native-file-selector/issues). 150 | Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given. 151 | 152 | ## 💫 Where is this library used? 153 | If you are using this library in one of your projects, add it in this list below. ✨ 154 | 155 | 156 | ## 📜 License 157 | This library is provided under the Apache License. 158 | 159 | RNFileSelector @ [prscX](https://github.com/prscX) 160 | 161 | ## 💖 Support my projects 162 | I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it). 163 | 164 | However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: 165 | * Starring and sharing the projects you like 🚀 166 | * If you're feeling especially charitable, please follow [prscX](https://github.com/prscX) on GitHub. 167 | 168 | Buy Me A Coffee 169 | 170 | Thanks! ❤️ 171 |
172 | [prscX.github.io](https://prscx.github.io) 173 |
174 | -------------------------------------------------------------------------------- /RNFileSelector.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { PureComponent } from "react"; 3 | import { ViewPropTypes, NativeModules, Platform } from "react-native"; 4 | import PropTypes from "prop-types"; 5 | 6 | const { RNFileSelector } = NativeModules; 7 | 8 | class FileSelector extends PureComponent { 9 | static propTypes = { 10 | ...ViewPropTypes, 11 | 12 | filter: PropTypes.string, 13 | filterDirectories: PropTypes.bool, 14 | path: PropTypes.string, 15 | hiddenFiles: PropTypes.bool, 16 | closeMenu: PropTypes.bool, 17 | title: PropTypes.string, 18 | onDone: PropTypes.func, 19 | onCancel: PropTypes.func, 20 | editable: PropTypes.bool 21 | }; 22 | 23 | static defaultProps = { 24 | visible: false, 25 | 26 | filterDirectories: false, 27 | path: '', 28 | hiddenFiles: false, 29 | closeMenu: true, 30 | title: '', 31 | editable: false 32 | }; 33 | 34 | static Show(props) { 35 | if (props.filter === undefined) { 36 | props.filter = FileSelector.defaultProps.filter 37 | } if (props.filterDirectories === undefined) { 38 | props.filterDirectories = FileSelector.defaultProps.filterDirectories 39 | } if (props.path === undefined) { 40 | props.path = FileSelector.defaultProps.path; 41 | } if (props.hiddenFiles === undefined) { 42 | props.hiddenFiles = FileSelector.defaultProps.hiddenFiles 43 | } if (props.closeMenu === undefined) { 44 | props.closeMenu = FileSelector.defaultProps.closeMenu 45 | } if (props.title === undefined) { 46 | props.title = FileSelector.defaultProps.title 47 | } if (props.editable === undefined) { 48 | props.editable = FileSelector.defaultProps.editable 49 | } 50 | 51 | if (props.filter === undefined) { 52 | if (Platform.OS === 'ios') { 53 | props.filter = [] 54 | } else if (Platform.OS === 'android') { 55 | props.filter = '' 56 | } 57 | } 58 | 59 | RNFileSelector.Show(props, path => { 60 | props.onDone && props.onDone(path) 61 | }, () => { 62 | props.onCancel && props.onCancel() 63 | }); 64 | } 65 | 66 | componentDidMount() { 67 | this._show(); 68 | } 69 | 70 | componentDidUpdate() { 71 | this._show(); 72 | } 73 | 74 | _show() { 75 | if (this.props.visible) { 76 | FileSelector.Show({ 77 | filter: this.props.filter, 78 | filterDirectories: this.props.filterDirectories, 79 | path: this.props.path, 80 | hiddenFiles: this.props.hiddenFiles, 81 | closeMenu: this.props.closeMenu, 82 | title: this.props.title, 83 | editable: this.props.editable, 84 | onDone: this.props.onDone, 85 | onCancel: this.props.onCancel 86 | }); 87 | } 88 | } 89 | 90 | render() { 91 | return null; 92 | } 93 | } 94 | 95 | 96 | export default FileSelector; -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | #Fri May 18 17:05:41 IST 2018 2 | connection.project.dir= 3 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | def safeExtGet(prop, fallback) { 2 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 3 | } 4 | 5 | buildscript { 6 | repositories { 7 | google() 8 | maven { url "https://maven.google.com" } 9 | jcenter() 10 | } 11 | 12 | dependencies { 13 | classpath("com.android.tools.build:gradle:4.2.1") 14 | } 15 | } 16 | apply plugin: 'com.android.library' 17 | 18 | android { 19 | compileSdkVersion safeExtGet("compileSdkVersion", 27) 20 | buildToolsVersion safeExtGet("buildToolsVersion", "27.0.3") 21 | 22 | defaultConfig { 23 | minSdkVersion safeExtGet("minSdkVersion", 16) 24 | targetSdkVersion safeExtGet("targetSdkVersion", 27) 25 | versionCode 1 26 | versionName "1.0" 27 | } 28 | lintOptions { 29 | abortOnError false 30 | } 31 | } 32 | 33 | repositories { 34 | mavenCentral() 35 | maven { url "https://maven.google.com" } 36 | } 37 | 38 | dependencies { 39 | implementation 'com.nbsp:materialfilepicker:1.9.1' 40 | implementation 'com.android.support:appcompat-v7:27.0.2' 41 | implementation 'com.android.support:support-v4:27.0.2' 42 | implementation 'com.facebook.react:react-native:+' 43 | } 44 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/ui/fileselector/RNFileSelectorModule.java: -------------------------------------------------------------------------------- 1 | 2 | package ui.fileselector; 3 | 4 | import android.Manifest; 5 | import android.app.Activity; 6 | import android.content.Intent; 7 | import android.content.pm.PackageManager; 8 | import androidx.core.app.ActivityCompat; 9 | import androidx.core.content.ContextCompat; 10 | import androidx.appcompat.app.AppCompatActivity; 11 | import android.util.Log; 12 | import android.widget.Toast; 13 | 14 | import com.facebook.react.bridge.ActivityEventListener; 15 | import com.facebook.react.bridge.Callback; 16 | import com.facebook.react.bridge.ReactApplicationContext; 17 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 18 | import com.facebook.react.bridge.ReactMethod; 19 | import com.facebook.react.bridge.ReadableMap; 20 | import com.nbsp.materialfilepicker.MaterialFilePicker; 21 | import com.nbsp.materialfilepicker.ui.FilePickerActivity; 22 | 23 | import java.util.regex.Pattern; 24 | 25 | public class RNFileSelectorModule extends ReactContextBaseJavaModule { 26 | 27 | public static final int PERMISSIONS_REQUEST_CODE = 0; 28 | public static final int FILE_PICKER_REQUEST_CODE = 1; 29 | 30 | private Callback onDone; 31 | private Callback onCancel; 32 | 33 | public RNFileSelectorModule(ReactApplicationContext reactContext) { 34 | super(reactContext); 35 | 36 | getReactApplicationContext().addActivityEventListener(new ActivityEventListener()); 37 | } 38 | 39 | @Override 40 | public String getName() { 41 | return "RNFileSelector"; 42 | } 43 | 44 | @ReactMethod 45 | public void Show(final ReadableMap props, final Callback onDone, final Callback onCancel) { 46 | boolean openFilePicker = checkPermissionsAndOpenFilePicker(); 47 | if (openFilePicker) { 48 | openFilePicker(props, onDone, onCancel); 49 | } 50 | } 51 | 52 | 53 | private boolean checkPermissionsAndOpenFilePicker() { 54 | String permission = Manifest.permission.READ_EXTERNAL_STORAGE; 55 | 56 | if (ContextCompat.checkSelfPermission(getCurrentActivity(), permission) != PackageManager.PERMISSION_GRANTED) { 57 | if (ActivityCompat.shouldShowRequestPermissionRationale(getCurrentActivity(), permission)) { 58 | showError(); 59 | return false; 60 | } else { 61 | ActivityCompat.requestPermissions(getCurrentActivity(), new String[]{permission}, PERMISSIONS_REQUEST_CODE); 62 | return true; 63 | } 64 | } 65 | 66 | return true; 67 | } 68 | 69 | private void showError() { 70 | Toast.makeText(getCurrentActivity(), "Allow external storage reading", Toast.LENGTH_SHORT).show(); 71 | } 72 | 73 | 74 | private void openFilePicker(final ReadableMap props, final Callback onDone, final Callback onCancel) { 75 | MaterialFilePicker picker = new MaterialFilePicker(); 76 | picker = picker.withActivity(getCurrentActivity()); 77 | picker = picker.withRequestCode(1); 78 | 79 | String filter = props.getString("filter"); 80 | boolean filterDirectories = props.getBoolean("filterDirectories"); 81 | String path = props.getString("path"); 82 | boolean hiddenFiles = props.getBoolean("hiddenFiles"); 83 | boolean closeMenu = props.getBoolean("closeMenu"); 84 | String title = props.getString("title"); 85 | 86 | if (filter.length() > 0) { 87 | picker = picker.withFilter(Pattern.compile(filter)); 88 | } 89 | 90 | picker = picker.withFilterDirectories(filterDirectories); 91 | 92 | if (path.length() > 0) { 93 | picker = picker.withRootPath(path); 94 | } 95 | 96 | picker = picker.withHiddenFiles(hiddenFiles); 97 | picker = picker.withCloseMenu(closeMenu); 98 | 99 | picker = picker.withTitle(title); 100 | 101 | this.onDone = onDone; 102 | this.onCancel = onCancel; 103 | 104 | picker.start(); 105 | } 106 | 107 | private class ActivityEventListener implements com.facebook.react.bridge.ActivityEventListener { 108 | 109 | @Override 110 | public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) { 111 | 112 | if (requestCode == 1 && resultCode == AppCompatActivity.RESULT_OK) { 113 | String filePath = data.getStringExtra(FilePickerActivity.RESULT_FILE_PATH); 114 | 115 | if (onDone != null) { 116 | onDone.invoke(filePath); 117 | } 118 | 119 | onDone = null; 120 | } else if (requestCode == 1 && resultCode == AppCompatActivity.RESULT_CANCELED) { 121 | if (onCancel != null) { 122 | onCancel.invoke(); 123 | } 124 | 125 | onCancel = null; 126 | } 127 | } 128 | 129 | @Override 130 | public void onNewIntent(Intent intent) { 131 | 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /android/src/main/java/ui/fileselector/RNFileSelectorPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package ui.fileselector; 3 | 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.bridge.JavaScriptModule; 6 | import com.facebook.react.bridge.NativeModule; 7 | import com.facebook.react.bridge.ReactApplicationContext; 8 | import com.facebook.react.uimanager.ViewManager; 9 | 10 | import java.util.Arrays; 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | public class RNFileSelectorPackage implements ReactPackage { 15 | @Override 16 | public List createNativeModules(ReactApplicationContext reactContext) { 17 | return Arrays.asList(new RNFileSelectorModule(reactContext)); 18 | } 19 | 20 | // Deprecated from RN 0.47 21 | public List> createJSModules() { 22 | return Collections.emptyList(); 23 | } 24 | 25 | @Override 26 | public List createViewManagers(ReactApplicationContext reactContext) { 27 | return Collections.emptyList(); 28 | } 29 | } -------------------------------------------------------------------------------- /assets/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-file-selector/487a7472b647423f96a3cf0bfaac5c2f71e3d468/assets/setup.png -------------------------------------------------------------------------------- /ios/RNFileSelector.h: -------------------------------------------------------------------------------- 1 | 2 | #import "RCTUIManager.h" 3 | 4 | #import 5 | 6 | @interface RNFileSelector : NSObject 7 | 8 | @end 9 | 10 | -------------------------------------------------------------------------------- /ios/RNFileSelector.m: -------------------------------------------------------------------------------- 1 | 2 | #import "RNFileSelector.h" 3 | 4 | @implementation RNFileSelector 5 | 6 | @synthesize bridge = _bridge; 7 | 8 | - (dispatch_queue_t)methodQueue 9 | { 10 | return dispatch_get_main_queue(); 11 | } 12 | RCT_EXPORT_MODULE() 13 | 14 | 15 | RCT_EXPORT_METHOD(Show:(nonnull NSDictionary *)props onDone:(RCTResponseSenderBlock)onDone onCancel:(RCTResponseSenderBlock)onCancel) { 16 | 17 | dispatch_async(dispatch_get_main_queue(), ^{ 18 | 19 | NSArray *filter = [props objectForKey: @"filter"]; 20 | NSNumber *filterDirectories = [props objectForKey: @"filterDirectories"]; 21 | NSString *path = [props objectForKey: @"path"]; 22 | NSNumber *hiddenFiles = [props objectForKey: @"hiddenFiles"]; 23 | NSNumber *closeMenu = [props objectForKey: @"closeMenu"]; 24 | NSString *title = [props objectForKey: @"title"]; 25 | NSNumber *editable = [props objectForKey: @"editable"]; 26 | 27 | NSURL *url = nil; 28 | if ([path length] > 0) url = [NSURL URLWithString: path]; 29 | 30 | id app = [[UIApplication sharedApplication] delegate]; 31 | FileBrowser *fileBrowser = [[FileBrowser alloc] initWithInitialPath: url allowEditing: [editable boolValue] showCancelButton: [closeMenu boolValue]]; 32 | [fileBrowser setDidSelectFile:^(FBFile * _Nonnull file) { 33 | onDone(@[[[file filePath] absoluteString]]); 34 | }]; 35 | 36 | NSMutableArray *filterExtensions = [[NSMutableArray alloc] init]; 37 | for (int i = 0;i < filter.count; i++) { 38 | [filterExtensions addObject: [filter objectAtIndex: i]]; 39 | } 40 | 41 | [fileBrowser setExcludesFileExtensions: filterExtensions]; 42 | 43 | [((UINavigationController*) app.window.rootViewController) presentViewController:fileBrowser animated:YES completion:nil]; 44 | }); 45 | } 46 | 47 | @end 48 | 49 | -------------------------------------------------------------------------------- /ios/RNFileSelector.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, '../package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'RNFileSelector' 7 | s.version = package['version'] 8 | s.summary = package['description'] 9 | s.description = package['description'] 10 | s.homepage = package['homepage'] 11 | s.license = package['license'] 12 | s.author = package['author'] 13 | s.source = { :git => 'https://github.com/prscX/react-native-file-selector.git', :tag => s.version } 14 | 15 | s.platform = :ios, '9.0' 16 | s.ios.deployment_target = '8.0' 17 | 18 | s.preserve_paths = 'LICENSE', 'package.json' 19 | s.source_files = '**/*.{h,m}' 20 | s.dependency 'React-Core' 21 | s.dependency 'FileBrowser' 22 | end -------------------------------------------------------------------------------- /ios/RNFileSelector.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 81A297F4FE4B7837D66616E8 /* Pods_RNFileSelector.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8AE4589AE9EAE28E8C0C60 /* Pods_RNFileSelector.framework */; }; 11 | B3E7B58A1CC2AC0600A0062D /* RNFileSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNFileSelector.m */; }; 12 | CE4052362144E03300F995AA /* FileBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE4052332144E02B00F995AA /* FileBrowser.framework */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXContainerItemProxy section */ 16 | CE4052322144E02B00F995AA /* PBXContainerItemProxy */ = { 17 | isa = PBXContainerItemProxy; 18 | containerPortal = CE40522D2144E02B00F995AA /* Pods.xcodeproj */; 19 | proxyType = 2; 20 | remoteGlobalIDString = FB1460DD423CD37FE705DDE91338EEE0; 21 | remoteInfo = FileBrowser; 22 | }; 23 | CE4052342144E02B00F995AA /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = CE40522D2144E02B00F995AA /* Pods.xcodeproj */; 26 | proxyType = 2; 27 | remoteGlobalIDString = 6D6A0BF9A517481DFEC80F967E6D1A16; 28 | remoteInfo = "Pods-RNFileSelector"; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXCopyFilesBuildPhase section */ 33 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 34 | isa = PBXCopyFilesBuildPhase; 35 | buildActionMask = 2147483647; 36 | dstPath = "include/$(PRODUCT_NAME)"; 37 | dstSubfolderSpec = 16; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXCopyFilesBuildPhase section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 134814201AA4EA6300B7C361 /* libRNFileSelector.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFileSelector.a; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 3EA737E0FFBB40D2ECF9C736 /* Pods-RNFileSelector.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNFileSelector.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNFileSelector/Pods-RNFileSelector.release.xcconfig"; sourceTree = ""; }; 47 | A73D196C67F67BCCD9F439C8 /* Pods-RNFileSelector.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNFileSelector.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNFileSelector/Pods-RNFileSelector.debug.xcconfig"; sourceTree = ""; }; 48 | B3E7B5881CC2AC0600A0062D /* RNFileSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNFileSelector.h; sourceTree = ""; }; 49 | B3E7B5891CC2AC0600A0062D /* RNFileSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFileSelector.m; sourceTree = ""; }; 50 | CE40522D2144E02B00F995AA /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = ""; }; 51 | CE8AE4589AE9EAE28E8C0C60 /* Pods_RNFileSelector.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNFileSelector.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | CE4052362144E03300F995AA /* FileBrowser.framework in Frameworks */, 60 | 81A297F4FE4B7837D66616E8 /* Pods_RNFileSelector.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 134814211AA4EA7D00B7C361 /* Products */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 134814201AA4EA6300B7C361 /* libRNFileSelector.a */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | 58B511D21A9E6C8500147676 = { 76 | isa = PBXGroup; 77 | children = ( 78 | B3E7B5881CC2AC0600A0062D /* RNFileSelector.h */, 79 | B3E7B5891CC2AC0600A0062D /* RNFileSelector.m */, 80 | 134814211AA4EA7D00B7C361 /* Products */, 81 | CE569A9020403969005B5ACC /* Frameworks */, 82 | 6EE51A2FE94F687D07C4BA7A /* Pods */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 6EE51A2FE94F687D07C4BA7A /* Pods */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | A73D196C67F67BCCD9F439C8 /* Pods-RNFileSelector.debug.xcconfig */, 90 | 3EA737E0FFBB40D2ECF9C736 /* Pods-RNFileSelector.release.xcconfig */, 91 | ); 92 | name = Pods; 93 | sourceTree = ""; 94 | }; 95 | CE40522E2144E02B00F995AA /* Products */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | CE4052332144E02B00F995AA /* FileBrowser.framework */, 99 | CE4052352144E02B00F995AA /* Pods_RNFileSelector.framework */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | CE569A9020403969005B5ACC /* Frameworks */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | CE40522D2144E02B00F995AA /* Pods.xcodeproj */, 108 | CE8AE4589AE9EAE28E8C0C60 /* Pods_RNFileSelector.framework */, 109 | ); 110 | name = Frameworks; 111 | sourceTree = ""; 112 | }; 113 | /* End PBXGroup section */ 114 | 115 | /* Begin PBXNativeTarget section */ 116 | 58B511DA1A9E6C8500147676 /* RNFileSelector */ = { 117 | isa = PBXNativeTarget; 118 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFileSelector" */; 119 | buildPhases = ( 120 | 6D4D3109B8467E15A8C40301 /* [CP] Check Pods Manifest.lock */, 121 | 58B511D71A9E6C8500147676 /* Sources */, 122 | 58B511D81A9E6C8500147676 /* Frameworks */, 123 | 58B511D91A9E6C8500147676 /* CopyFiles */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = RNFileSelector; 130 | productName = RCTDataManager; 131 | productReference = 134814201AA4EA6300B7C361 /* libRNFileSelector.a */; 132 | productType = "com.apple.product-type.library.static"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | 58B511D31A9E6C8500147676 /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | LastUpgradeCheck = 0830; 141 | ORGANIZATIONNAME = Facebook; 142 | TargetAttributes = { 143 | 58B511DA1A9E6C8500147676 = { 144 | CreatedOnToolsVersion = 6.1.1; 145 | }; 146 | }; 147 | }; 148 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFileSelector" */; 149 | compatibilityVersion = "Xcode 3.2"; 150 | developmentRegion = English; 151 | hasScannedForEncodings = 0; 152 | knownRegions = ( 153 | en, 154 | ); 155 | mainGroup = 58B511D21A9E6C8500147676; 156 | productRefGroup = 58B511D21A9E6C8500147676; 157 | projectDirPath = ""; 158 | projectReferences = ( 159 | { 160 | ProductGroup = CE40522E2144E02B00F995AA /* Products */; 161 | ProjectRef = CE40522D2144E02B00F995AA /* Pods.xcodeproj */; 162 | }, 163 | ); 164 | projectRoot = ""; 165 | targets = ( 166 | 58B511DA1A9E6C8500147676 /* RNFileSelector */, 167 | ); 168 | }; 169 | /* End PBXProject section */ 170 | 171 | /* Begin PBXReferenceProxy section */ 172 | CE4052332144E02B00F995AA /* FileBrowser.framework */ = { 173 | isa = PBXReferenceProxy; 174 | fileType = wrapper.framework; 175 | path = FileBrowser.framework; 176 | remoteRef = CE4052322144E02B00F995AA /* PBXContainerItemProxy */; 177 | sourceTree = BUILT_PRODUCTS_DIR; 178 | }; 179 | CE4052352144E02B00F995AA /* Pods_RNFileSelector.framework */ = { 180 | isa = PBXReferenceProxy; 181 | fileType = wrapper.framework; 182 | path = Pods_RNFileSelector.framework; 183 | remoteRef = CE4052342144E02B00F995AA /* PBXContainerItemProxy */; 184 | sourceTree = BUILT_PRODUCTS_DIR; 185 | }; 186 | /* End PBXReferenceProxy section */ 187 | 188 | /* Begin PBXShellScriptBuildPhase section */ 189 | 6D4D3109B8467E15A8C40301 /* [CP] Check Pods Manifest.lock */ = { 190 | isa = PBXShellScriptBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | inputPaths = ( 195 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 196 | "${PODS_ROOT}/Manifest.lock", 197 | ); 198 | name = "[CP] Check Pods Manifest.lock"; 199 | outputPaths = ( 200 | "$(DERIVED_FILE_DIR)/Pods-RNFileSelector-checkManifestLockResult.txt", 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 205 | showEnvVarsInLog = 0; 206 | }; 207 | /* End PBXShellScriptBuildPhase section */ 208 | 209 | /* Begin PBXSourcesBuildPhase section */ 210 | 58B511D71A9E6C8500147676 /* Sources */ = { 211 | isa = PBXSourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | B3E7B58A1CC2AC0600A0062D /* RNFileSelector.m in Sources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | /* End PBXSourcesBuildPhase section */ 219 | 220 | /* Begin XCBuildConfiguration section */ 221 | 58B511ED1A9E6C8500147676 /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ALWAYS_SEARCH_USER_PATHS = NO; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_WARN_BOOL_CONVERSION = YES; 230 | CLANG_WARN_CONSTANT_CONVERSION = YES; 231 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 232 | CLANG_WARN_EMPTY_BODY = YES; 233 | CLANG_WARN_ENUM_CONVERSION = YES; 234 | CLANG_WARN_INFINITE_RECURSION = YES; 235 | CLANG_WARN_INT_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 238 | CLANG_WARN_UNREACHABLE_CODE = YES; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | COPY_PHASE_STRIP = NO; 241 | ENABLE_STRICT_OBJC_MSGSEND = YES; 242 | ENABLE_TESTABILITY = YES; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_DYNAMIC_NO_PIC = NO; 245 | GCC_NO_COMMON_BLOCKS = YES; 246 | GCC_OPTIMIZATION_LEVEL = 0; 247 | GCC_PREPROCESSOR_DEFINITIONS = ( 248 | "DEBUG=1", 249 | "$(inherited)", 250 | ); 251 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 252 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 254 | GCC_WARN_UNDECLARED_SELECTOR = YES; 255 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 256 | GCC_WARN_UNUSED_FUNCTION = YES; 257 | GCC_WARN_UNUSED_VARIABLE = YES; 258 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 259 | MTL_ENABLE_DEBUG_INFO = YES; 260 | ONLY_ACTIVE_ARCH = YES; 261 | SDKROOT = iphoneos; 262 | }; 263 | name = Debug; 264 | }; 265 | 58B511EE1A9E6C8500147676 /* Release */ = { 266 | isa = XCBuildConfiguration; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 270 | CLANG_CXX_LIBRARY = "libc++"; 271 | CLANG_ENABLE_MODULES = YES; 272 | CLANG_ENABLE_OBJC_ARC = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_CONSTANT_CONVERSION = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_EMPTY_BODY = YES; 277 | CLANG_WARN_ENUM_CONVERSION = YES; 278 | CLANG_WARN_INFINITE_RECURSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 282 | CLANG_WARN_UNREACHABLE_CODE = YES; 283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 284 | COPY_PHASE_STRIP = YES; 285 | ENABLE_NS_ASSERTIONS = NO; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_NO_COMMON_BLOCKS = YES; 289 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 291 | GCC_WARN_UNDECLARED_SELECTOR = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 293 | GCC_WARN_UNUSED_FUNCTION = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 296 | MTL_ENABLE_DEBUG_INFO = NO; 297 | SDKROOT = iphoneos; 298 | VALIDATE_PRODUCT = YES; 299 | }; 300 | name = Release; 301 | }; 302 | 58B511F01A9E6C8500147676 /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | baseConfigurationReference = A73D196C67F67BCCD9F439C8 /* Pods-RNFileSelector.debug.xcconfig */; 305 | buildSettings = { 306 | HEADER_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 309 | "$(SRCROOT)/../../../React/**", 310 | "$(SRCROOT)/../../react-native/React/**", 311 | ); 312 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 313 | OTHER_LDFLAGS = "-ObjC"; 314 | PRODUCT_NAME = RNFileSelector; 315 | SKIP_INSTALL = YES; 316 | }; 317 | name = Debug; 318 | }; 319 | 58B511F11A9E6C8500147676 /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | baseConfigurationReference = 3EA737E0FFBB40D2ECF9C736 /* Pods-RNFileSelector.release.xcconfig */; 322 | buildSettings = { 323 | HEADER_SEARCH_PATHS = ( 324 | "$(inherited)", 325 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 326 | "$(SRCROOT)/../../../React/**", 327 | "$(SRCROOT)/../../react-native/React/**", 328 | ); 329 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 330 | OTHER_LDFLAGS = "-ObjC"; 331 | PRODUCT_NAME = RNFileSelector; 332 | SKIP_INSTALL = YES; 333 | }; 334 | name = Release; 335 | }; 336 | /* End XCBuildConfiguration section */ 337 | 338 | /* Begin XCConfigurationList section */ 339 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFileSelector" */ = { 340 | isa = XCConfigurationList; 341 | buildConfigurations = ( 342 | 58B511ED1A9E6C8500147676 /* Debug */, 343 | 58B511EE1A9E6C8500147676 /* Release */, 344 | ); 345 | defaultConfigurationIsVisible = 0; 346 | defaultConfigurationName = Release; 347 | }; 348 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFileSelector" */ = { 349 | isa = XCConfigurationList; 350 | buildConfigurations = ( 351 | 58B511F01A9E6C8500147676 /* Debug */, 352 | 58B511F11A9E6C8500147676 /* Release */, 353 | ); 354 | defaultConfigurationIsVisible = 0; 355 | defaultConfigurationName = Release; 356 | }; 357 | /* End XCConfigurationList section */ 358 | }; 359 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 360 | } 361 | -------------------------------------------------------------------------------- /ios/RNFileSelector.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-file-selector", 3 | "version": "1.0.2", 4 | "description": "React Native: Native File Selector", 5 | "main": "RNFileSelector.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native" 11 | ], 12 | "author": "Pranav Raj Singh Chauhan", 13 | "license": "Apache License", 14 | "homepage": "https://github.com/prscX/react-native-file-selector.git", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/prscX/react-native-file-selector.git" 18 | }, 19 | "dependencies": { 20 | }, 21 | "devDependencies": { 22 | "prettier-pack": "0.0.11" 23 | }, 24 | "peerDependencies": {} 25 | } 26 | --------------------------------------------------------------------------------