├── .all-contributorsrc ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── release.yml ├── .gitignore ├── .husky ├── .npmignore ├── commit-msg └── pre-commit ├── .lintstagedrc.json ├── .npmignore ├── .releaserc.json ├── .yarnrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactnativefileutils │ ├── FileUtilsModule.java │ └── FileUtilsPackage.java ├── babel.config.js ├── commitlint.config.js ├── example ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativefileutils │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── reactnativefileutils │ │ │ │ ├── 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 │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.tsx ├── ios │ ├── File.swift │ ├── FileUtilsExample-Bridging-Header.h │ ├── FileUtilsExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── FileUtilsExample.xcscheme │ ├── FileUtilsExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── FileUtilsExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ ├── Podfile │ ├── Podfile.lock │ └── SharePhoto │ │ ├── Base.lproj │ │ └── MainInterface.storyboard │ │ ├── Info.plist │ │ ├── ShareViewController.h │ │ └── ShareViewController.m ├── metro.config.js ├── package.json ├── src │ └── App.tsx └── yarn.lock ├── ios ├── FileUtils.h ├── FileUtils.m └── FileUtils.xcodeproj │ └── project.pbxproj ├── package-lock.json ├── package.json ├── react-native-file-utils.podspec ├── scripts └── bootstrap.js ├── src ├── __tests__ │ └── index.test.tsx ├── index.tsx ├── types │ └── MediaSize.ts └── utils │ └── get-react-rative-image-size.ts ├── tsconfig.build.json └── tsconfig.json /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "lukebrandonfarrell", 10 | "name": "Luke Brandon Farrell", 11 | "avatar_url": "https://avatars3.githubusercontent.com/u/18139277?v=4", 12 | "profile": "http://www.lukebrandonfarrell.com", 13 | "contributions": [ 14 | "code", 15 | "doc", 16 | "infra" 17 | ] 18 | }, 19 | { 20 | "login": "tdbrian", 21 | "name": "Thomas Brian", 22 | "avatar_url": "https://avatars.githubusercontent.com/u/1131354?s=96&v=4", 23 | "profile": "https://www.linkedin.com/in/thomas-brian", 24 | "contributions": [ 25 | "code", 26 | "doc", 27 | "infra" 28 | ] 29 | } 30 | ], 31 | "contributorsPerLine": 7, 32 | "projectName": "@qeepsake/react-native-file-utils", 33 | "projectOwner": "qeepsake", 34 | "repoType": "github", 35 | "repoHost": "https://github.com", 36 | "skipCi": true 37 | } 38 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | push: 4 | branches: 5 | - master 6 | - main 7 | jobs: 8 | release: 9 | name: Release 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v1 14 | - name: Setup Node.js 15 | uses: actions/setup-node@v1 16 | with: 17 | node-version: 14 18 | - name: Install dependencies 19 | run: npm ci 20 | - name: Release 21 | run: npm run prepare 22 | - name: Release 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 26 | run: npx semantic-release 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # node.js 48 | # 49 | node_modules/ 50 | npm-debug.log 51 | yarn-debug.log 52 | yarn-error.log 53 | 54 | # BUCK 55 | buck-out/ 56 | \.buckd/ 57 | android/app/libs 58 | android/keystores/debug.keystore 59 | 60 | # Expo 61 | .expo/* 62 | 63 | # generated by bob 64 | lib/ 65 | -------------------------------------------------------------------------------- /.husky/.npmignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint && yarn typescript 5 | npm run pre-commit 6 | -------------------------------------------------------------------------------- /.lintstagedrc.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ 4 | "prettier --write", 5 | "git add ." 6 | ] 7 | } 8 | 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | ./example -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "branches": ["master", "main", "next"] 4 | } 5 | 6 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # Override Yarn command so we can automatically setup the repo on running `yarn` 2 | 3 | yarn-path "scripts/bootstrap.js" 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.0 (December 2021) 2 | 3 | Alpha release: 4 | 5 | - Initial setup 6 | - Add API interface 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. 4 | 5 | ## Development workflow 6 | 7 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 8 | 9 | ```sh 10 | yarn 11 | ``` 12 | 13 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development. 14 | 15 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app. 16 | 17 | To start the packager: 18 | 19 | ```sh 20 | yarn example start 21 | ``` 22 | 23 | To run the example app on Android: 24 | 25 | ```sh 26 | yarn example android 27 | ``` 28 | 29 | To run the example app on iOS: 30 | 31 | ```sh 32 | yarn example ios 33 | ``` 34 | 35 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 36 | 37 | ```sh 38 | yarn typescript 39 | yarn lint 40 | ``` 41 | 42 | To fix formatting errors, run the following: 43 | 44 | ```sh 45 | yarn lint --fix 46 | ``` 47 | 48 | Remember to add tests for your change if possible. Run the unit tests by: 49 | 50 | ```sh 51 | yarn test 52 | ``` 53 | 54 | To edit the Objective-C files, open `example/ios/FileUtilsExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-file-utils`. 55 | 56 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativefileutils` under `Android`. 57 | 58 | ### Commit message convention 59 | 60 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 61 | 62 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 63 | - `feat`: new features, e.g. add new method to the module. 64 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 65 | - `docs`: changes into documentation, e.g. add usage example for the module.. 66 | - `test`: adding or updating tests, e.g. add integration tests using detox. 67 | - `chore`: tooling changes, e.g. change CI config. 68 | 69 | Our pre-commit hooks verify that your commit message matches this format when committing. 70 | 71 | ### Linting and tests 72 | 73 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 74 | 75 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 76 | 77 | Our pre-commit hooks verify that the linter and tests pass when committing. 78 | 79 | ### Publishing to npm 80 | 81 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. 82 | 83 | To publish new versions, run the following: 84 | 85 | ```sh 86 | yarn release 87 | ``` 88 | 89 | ### Scripts 90 | 91 | The `package.json` file contains various scripts for common tasks: 92 | 93 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 94 | - `yarn typescript`: type-check files with TypeScript. 95 | - `yarn lint`: lint files with ESLint. 96 | - `yarn test`: run unit tests with Jest. 97 | - `yarn example start`: start the Metro server for the example app. 98 | - `yarn example android`: run the example app on Android. 99 | - `yarn example ios`: run the example app on iOS. 100 | 101 | ### Sending a pull request 102 | 103 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). 104 | 105 | When you're sending a pull request: 106 | 107 | - Prefer small pull requests focused on one change. 108 | - Verify that linters and tests are passing. 109 | - Review the documentation to make sure it looks good. 110 | - Follow the pull request template when opening a pull request. 111 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 112 | 113 | ## Code of Conduct 114 | 115 | ### Our Pledge 116 | 117 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 118 | 119 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 120 | 121 | ### Our Standards 122 | 123 | Examples of behavior that contributes to a positive environment for our community include: 124 | 125 | - Demonstrating empathy and kindness toward other people 126 | - Being respectful of differing opinions, viewpoints, and experiences 127 | - Giving and gracefully accepting constructive feedback 128 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 129 | - Focusing on what is best not just for us as individuals, but for the overall community 130 | 131 | Examples of unacceptable behavior include: 132 | 133 | - The use of sexualized language or imagery, and sexual attention or 134 | advances of any kind 135 | - Trolling, insulting or derogatory comments, and personal or political attacks 136 | - Public or private harassment 137 | - Publishing others' private information, such as a physical or email 138 | address, without their explicit permission 139 | - Other conduct which could reasonably be considered inappropriate in a 140 | professional setting 141 | 142 | ### Enforcement Responsibilities 143 | 144 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 145 | 146 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 147 | 148 | ### Scope 149 | 150 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 151 | 152 | ### Enforcement 153 | 154 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. 155 | 156 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 157 | 158 | ### Enforcement Guidelines 159 | 160 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 161 | 162 | #### 1. Correction 163 | 164 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 165 | 166 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 167 | 168 | #### 2. Warning 169 | 170 | **Community Impact**: A violation through a single incident or series of actions. 171 | 172 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 173 | 174 | #### 3. Temporary Ban 175 | 176 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 177 | 178 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 179 | 180 | #### 4. Permanent Ban 181 | 182 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 183 | 184 | **Consequence**: A permanent ban from any sort of public interaction within the community. 185 | 186 | ### Attribution 187 | 188 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 189 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 190 | 191 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 192 | 193 | [homepage]: https://www.contributor-covenant.org 194 | 195 | For answers to common questions about this code of conduct, see the FAQ at 196 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 197 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-present Qeepsake, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Qeepsake React Native File Utils 2 | 3 | Extracts information from image and video files including MIME type, duration (video), dimensions, and timestamp. The library work on iOS and Android and uses Java and Obj-C native library (not Node). 4 | 5 | ## Installation 6 | 7 | ```sh 8 | npm install @qeepsake/react-native-file-utils 9 | ``` 10 | 11 | ## Usage 12 | 13 | ### Get the duration of video file 14 | 15 | Gets the duration of the video in seconds. 16 | 17 | ```js 18 | import { getVideoDuration } from '@qeepsake/react-native-file-utils'; 19 | 20 | const durationMs = await getVideoDuration('file://'); 21 | ``` 22 | 23 | ### Get the media file dimensions in pixels 24 | 25 | Gets the horizontal (x) and vertical (y) pixels of the media item, either image or video. The returned media dimensions includes an object with both the horizontal (x) length in pixels and vertical (y) length in pixels. 26 | 27 | ```js 28 | import { getDimensions } from '@qeepsake/react-native-file-utils'; 29 | 30 | const mediaDimensions = await getDimensions('file://', 'video'); 31 | ``` 32 | 33 | ### Get the MIME type of a media item file 34 | 35 | Gets the MIME type of the media file at the passed Uri. 36 | 37 | ```js 38 | import { getMimeType } from '@qeepsake/react-native-file-utils'; 39 | 40 | const mimeType = await getMimeType('file://'); 41 | ``` 42 | 43 | ### Get the timestamp of a media item file 44 | 45 | Gets the string timestamp of the media file from the passed Uri. The timestamp is usually a date retrieved 46 | from either the Exif date if the original datetime of the media is available or by the creation/last modified 47 | timestamp from the file itself. 48 | 49 | ```js 50 | import { getTimestamp } from '@qeepsake/react-native-file-utils'; 51 | 52 | const timestamp = await getTimestamp('file://', 'video'); 53 | ``` 54 | 55 | ## Supported Schemes 56 | 57 | In this table, you can see what type of URI can be handled by each method. 58 | 59 | | Method Name | iOS | Android | 60 | | ----------- | ---------------------- | ---------- | 61 | | getTimestamp | `file://`, `assets-library://` | `file://`, `content://` 62 | | getVideoDuration | `file://` | `file://` 63 | | getMimeType | `file://`, `ph://` | `file://`, `content://` 64 | | getDimensions | `file://`, | `file://` 65 | ## Contributing 66 | 67 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 68 | 69 | ## License 70 | 71 | MIT 72 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | if (project == rootProject) { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | jcenter() 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.5.3' 11 | } 12 | } 13 | } 14 | 15 | apply plugin: 'com.android.library' 16 | 17 | def safeExtGet(prop, fallback) { 18 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 19 | } 20 | 21 | android { 22 | compileSdkVersion safeExtGet('FileUtils_compileSdkVersion', 33) 23 | defaultConfig { 24 | minSdkVersion safeExtGet('FileUtils_minSdkVersion', 21) 25 | targetSdkVersion safeExtGet('FileUtils_targetSdkVersion', 33) 26 | versionCode 1 27 | versionName "1.0" 28 | 29 | } 30 | 31 | buildTypes { 32 | release { 33 | minifyEnabled false 34 | } 35 | } 36 | lintOptions { 37 | disable 'GradleCompatible' 38 | } 39 | compileOptions { 40 | sourceCompatibility JavaVersion.VERSION_1_8 41 | targetCompatibility JavaVersion.VERSION_1_8 42 | } 43 | } 44 | 45 | repositories { 46 | mavenLocal() 47 | maven { 48 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 49 | url("$rootDir/../node_modules/react-native/android") 50 | } 51 | google() 52 | mavenCentral() 53 | jcenter() 54 | } 55 | 56 | dependencies { 57 | //noinspection GradleDynamicVersion 58 | implementation "com.facebook.react:react-native:+" // From node_modules 59 | } 60 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativefileutils/FileUtilsModule.java: -------------------------------------------------------------------------------- 1 | package com.reactnativefileutils; 2 | 3 | import android.content.ContentResolver; 4 | import android.media.ExifInterface; 5 | import android.media.MediaMetadataRetriever; 6 | import android.net.Uri; 7 | import android.util.Log; 8 | import android.webkit.MimeTypeMap; 9 | import android.webkit.URLUtil; 10 | 11 | import androidx.annotation.NonNull; 12 | 13 | import com.facebook.react.bridge.Arguments; 14 | import com.facebook.react.bridge.Promise; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 17 | import com.facebook.react.bridge.ReactMethod; 18 | import com.facebook.react.bridge.WritableMap; 19 | import com.facebook.react.module.annotations.ReactModule; 20 | 21 | import java.io.FileDescriptor; 22 | import java.io.FileNotFoundException; 23 | import java.io.InputStream; 24 | import java.text.SimpleDateFormat; 25 | import java.util.Date; 26 | import java.util.Locale; 27 | 28 | @ReactModule(name = FileUtilsModule.NAME) 29 | public class FileUtilsModule extends ReactContextBaseJavaModule { 30 | public static final String NAME = "FileUtils"; 31 | public ReactApplicationContext mContext; 32 | 33 | public FileUtilsModule(ReactApplicationContext reactContext) { 34 | super(reactContext); 35 | mContext = reactContext; 36 | } 37 | 38 | @Override 39 | @NonNull 40 | public String getName() { 41 | return NAME; 42 | } 43 | 44 | /** 45 | * Gets the duration of a video in seconds. 46 | * 47 | * @param uri - The video file path to get the duration of. 48 | * @returns The duration in seconds of the video file. 49 | */ 50 | @ReactMethod 51 | public void getDuration(String uri, Promise promise) { 52 | try { 53 | Uri fileUri = Uri.parse(uri); 54 | MediaMetadataRetriever retriever = GetMediaMetadataRetriever(fileUri); 55 | String time = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); 56 | float durationInSeconds = Float.parseFloat(time) / 1000; 57 | retriever.release(); 58 | 59 | promise.resolve(String.valueOf(durationInSeconds)); 60 | } catch (Exception e) { 61 | promise.reject("Error getting duration of video", e); 62 | } 63 | } 64 | 65 | /** 66 | * Gets the pixel dimensions, height and width (x,y), of the video file based on the 67 | * file path passed in. 68 | * 69 | * @param uri - The video file path to get the dimensions of. 70 | * @returns The height and width (x,y), of the video in pixels. 71 | */ 72 | @ReactMethod 73 | public void getVideoDimensions(String uri, Promise promise) { 74 | Uri fileUri = Uri.parse(uri); 75 | try { 76 | MediaMetadataRetriever retriever = GetMediaMetadataRetriever(fileUri); 77 | String height = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH); 78 | String width = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT); 79 | retriever.release(); 80 | 81 | WritableMap map = Arguments.createMap(); 82 | map.putString("height", height); 83 | map.putString("width", width); 84 | promise.resolve(map); 85 | } catch (Exception e) { 86 | promise.reject("Error getting dimensions", e); 87 | } 88 | } 89 | 90 | /** 91 | * Gets the MIME type of the file from the passed in URL. The file passed in can be a video or image file format. 92 | * 93 | * @param uri - The video or image file path to get the MIME type of. 94 | * @returns The MIME type string of the file from the passed URL. 95 | */ 96 | @ReactMethod 97 | public void getMimeType(String uri, Promise promise) { 98 | if(URLUtil.isContentUrl(uri)) { 99 | Uri contentUri = Uri.parse(uri); 100 | ContentResolver contentResolver = mContext.getContentResolver(); 101 | String mimeType = contentResolver.getType(contentUri); 102 | promise.resolve(mimeType); 103 | } else if(URLUtil.isFileUrl(uri)) { 104 | String type = null; 105 | String extension = MimeTypeMap.getFileExtensionFromUrl(uri); 106 | 107 | // Typically images do have an extension at this point while videos on Android from the picker 108 | // do not have an extension. If there's no extension, try to get the extension from the 109 | // contents as the file is likely a video. 110 | if (extension != null && !extension.isEmpty()) { 111 | type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); 112 | promise.resolve(type); 113 | return; 114 | } 115 | 116 | try { 117 | Uri fileUri = Uri.parse(uri); 118 | MediaMetadataRetriever retriever = GetMediaMetadataRetriever(fileUri); 119 | String mimeType = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_MIMETYPE); 120 | retriever.release(); 121 | 122 | promise.resolve(mimeType); 123 | return; 124 | } catch (Exception e) { 125 | promise.reject("Error getting mime type", e); 126 | } 127 | } 128 | } 129 | 130 | /** 131 | * Gets the original date time of the video or image file based on the path passed in. The 132 | * ISO datetime is retrieved from the Exif data on the image or video file. 133 | * 134 | * @param uri - The video or image file path to get the timestamp of. 135 | * @param mediaType - Either 'video' or 'image' so the method knows how to process the media file. 136 | * @returns String ISO datetime of the image or video file from the file's Exif data. 137 | */ 138 | @ReactMethod 139 | public void getTimestamp(String uri, String mediaType, Promise promise) { 140 | try { 141 | Uri fileUri = Uri.parse(uri); 142 | 143 | // Handle getting mime type for images 144 | if (mediaType.equalsIgnoreCase("image")) { 145 | InputStream inputStream = mContext.getContentResolver().openInputStream(fileUri); 146 | 147 | if(inputStream != null) { 148 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { 149 | ExifInterface exif = new ExifInterface(inputStream); 150 | String timestamp = exif.getAttribute(ExifInterface.TAG_DATETIME); 151 | 152 | // Timestamp can't be found in file 153 | if(timestamp != null) { 154 | Date date = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.US).parse(timestamp); 155 | 156 | if (date != null) { 157 | String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US).format(date); 158 | promise.resolve(formattedDate); 159 | } else { 160 | promise.resolve(null); 161 | } 162 | } else { 163 | promise.resolve(null); 164 | } 165 | } else { 166 | promise.reject("VERSION_NOT_SUPPORTED", "Android version must be above: " + android.os.Build.VERSION_CODES.N); 167 | } 168 | } else { 169 | promise.reject("PATH_NOT_SUPPORTED", "File path not supported: " + uri); 170 | } 171 | // Handle getting mime type for videos 172 | } else { 173 | MediaMetadataRetriever retriever = GetMediaMetadataRetriever(fileUri); 174 | String timestamp = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE); 175 | Date date = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.US).parse(timestamp); 176 | 177 | if(date != null) { 178 | String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US).format(date); 179 | retriever.release(); 180 | promise.resolve(formattedDate); 181 | } else { 182 | promise.resolve(null); 183 | } 184 | } 185 | } catch (Exception e) { 186 | promise.reject("Error getting timestamp of media file", e); 187 | } 188 | } 189 | 190 | private MediaMetadataRetriever GetMediaMetadataRetriever(Uri fileUri) throws FileNotFoundException { 191 | try { 192 | FileDescriptor fileDescriptor = getReactApplicationContext().getContentResolver().openAssetFileDescriptor(fileUri, "r").getFileDescriptor(); 193 | MediaMetadataRetriever retriever = new MediaMetadataRetriever(); 194 | retriever.setDataSource(fileDescriptor); 195 | return retriever; 196 | } catch (FileNotFoundException e) { 197 | throw e; 198 | } 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativefileutils/FileUtilsPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactnativefileutils; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.facebook.react.ReactPackage; 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.ArrayList; 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | public class FileUtilsPackage implements ReactPackage { 15 | @NonNull 16 | @Override 17 | public List createNativeModules(@NonNull ReactApplicationContext reactContext) { 18 | List modules = new ArrayList<>(); 19 | modules.add(new FileUtilsModule(reactContext)); 20 | return modules; 21 | } 22 | 23 | @NonNull 24 | @Override 25 | public List createViewManagers(@NonNull ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /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 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for FileUtilsExample: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for FileUtilsExample, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | enableHermes: false, // clean and rebuild if changing 80 | entryFile: "index.tsx", 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | /** 86 | * Set this to true to create two separate APKs instead of one: 87 | * - An APK that only works on ARM devices 88 | * - An APK that only works on x86 devices 89 | * The advantage is the size of the APK is reduced by about 4MB. 90 | * Upload all the APKs to the Play Store and people will download 91 | * the correct one based on the CPU architecture of their device. 92 | */ 93 | def enableSeparateBuildPerCPUArchitecture = false 94 | 95 | /** 96 | * Run Proguard to shrink the Java bytecode in release builds. 97 | */ 98 | def enableProguardInReleaseBuilds = false 99 | 100 | /** 101 | * The preferred build flavor of JavaScriptCore. 102 | * 103 | * For FileUtilsExample, to use the international variant, you can use: 104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 105 | * 106 | * The international variant includes ICU i18n library and necessary data 107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 108 | * give correct results when using with locales other than en-US. Note that 109 | * this variant is about 6MiB larger per architecture than default. 110 | */ 111 | def jscFlavor = 'org.webkit:android-jsc:+' 112 | 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | 125 | compileOptions { 126 | sourceCompatibility JavaVersion.VERSION_1_8 127 | targetCompatibility JavaVersion.VERSION_1_8 128 | } 129 | 130 | defaultConfig { 131 | applicationId "com.example.reactnativefileutils" 132 | minSdkVersion rootProject.ext.minSdkVersion 133 | targetSdkVersion rootProject.ext.targetSdkVersion 134 | versionCode 1 135 | versionName "1.0" 136 | } 137 | splits { 138 | abi { 139 | reset() 140 | enable enableSeparateBuildPerCPUArchitecture 141 | universalApk false // If true, also generate a universal APK 142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 143 | } 144 | } 145 | signingConfigs { 146 | debug { 147 | storeFile file('debug.keystore') 148 | storePassword 'android' 149 | keyAlias 'androiddebugkey' 150 | keyPassword 'android' 151 | } 152 | } 153 | buildTypes { 154 | debug { 155 | signingConfig signingConfigs.debug 156 | } 157 | release { 158 | // Caution! In production, you need to generate your own keystore file. 159 | // see https://reactnative.dev/docs/signed-apk-android. 160 | signingConfig signingConfigs.debug 161 | minifyEnabled enableProguardInReleaseBuilds 162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 163 | } 164 | } 165 | // applicationVariants are e.g. debug, release 166 | applicationVariants.all { variant -> 167 | variant.outputs.each { output -> 168 | // For each separate APK per architecture, set a unique version code as described here: 169 | // https://developer.android.com/studio/build/configure-apk-splits.html 170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 171 | def abi = output.getFilter(OutputFile.ABI) 172 | if (abi != null) { // null for the universal-debug, universal-release variants 173 | output.versionCodeOverride = 174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 175 | } 176 | 177 | } 178 | } 179 | } 180 | 181 | dependencies { 182 | implementation fileTree(dir: "libs", include: ["*.jar"]) 183 | //noinspection GradleDynamicVersion 184 | implementation "com.facebook.react:react-native:+" // From node_modules 185 | 186 | 187 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 189 | exclude group:'com.facebook.fbjni' 190 | } 191 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 192 | exclude group:'com.facebook.flipper' 193 | exclude group:'com.squareup.okhttp3', module:'okhttp' 194 | } 195 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 196 | exclude group:'com.facebook.flipper' 197 | } 198 | 199 | if (enableHermes) { 200 | def hermesPath = "../../node_modules/hermes-engine/android/"; 201 | debugImplementation files(hermesPath + "hermes-debug.aar") 202 | releaseImplementation files(hermesPath + "hermes-release.aar") 203 | } else { 204 | implementation jscFlavor 205 | } 206 | 207 | implementation project(':reactnativefileutils') 208 | } 209 | 210 | // Run this once to be able to run the application with BUCK 211 | // puts all compile dependencies into folder libs for BUCK to use 212 | task copyDownloadableDepsToLibs(type: Copy) { 213 | from configurations.compile 214 | into 'libs' 215 | } 216 | 217 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 218 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/reactnativefileutils/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.example.reactnativefileutils; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 32 | client.addPlugin(new ReactFlipperPlugin()); 33 | client.addPlugin(new DatabasesFlipperPlugin(context)); 34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 35 | client.addPlugin(CrashReporterPlugin.getInstance()); 36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 37 | NetworkingModule.setCustomClientBuilder( 38 | new NetworkingModule.CustomClientBuilder() { 39 | @Override 40 | public void apply(OkHttpClient.Builder builder) { 41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 42 | } 43 | }); 44 | client.addPlugin(networkFlipperPlugin); 45 | client.start(); 46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 47 | // Hence we run if after all native modules have been initialized 48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 49 | if (reactContext == null) { 50 | reactInstanceManager.addReactInstanceEventListener( 51 | new ReactInstanceManager.ReactInstanceEventListener() { 52 | @Override 53 | public void onReactContextInitialized(ReactContext reactContext) { 54 | reactInstanceManager.removeReactInstanceEventListener(this); 55 | reactContext.runOnNativeModulesQueueThread( 56 | new Runnable() { 57 | @Override 58 | public void run() { 59 | client.addPlugin(new FrescoFlipperPlugin()); 60 | } 61 | }); 62 | } 63 | }); 64 | } else { 65 | client.addPlugin(new FrescoFlipperPlugin()); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/reactnativefileutils/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativefileutils; 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 "FileUtilsExample"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/reactnativefileutils/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.reactnativefileutils; 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.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactInstanceManager; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | import com.reactnativefileutils.FileUtilsPackage; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = 18 | new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | @SuppressWarnings("UnnecessaryLocalVariable") 27 | List packages = new PackageList(this).getPackages(); 28 | // Packages that cannot be autolinked yet can be added manually here, for FileUtilsExample: 29 | // packages.add(new MyReactNativePackage()); 30 | packages.add(new FileUtilsPackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | @Override 41 | public ReactNativeHost getReactNativeHost() { 42 | return mReactNativeHost; 43 | } 44 | 45 | @Override 46 | public void onCreate() { 47 | super.onCreate(); 48 | SoLoader.init(this, /* native exopackage */ false); 49 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled 50 | } 51 | 52 | /** 53 | * Loads Flipper in React Native templates. 54 | * 55 | * @param context 56 | */ 57 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 58 | if (BuildConfig.DEBUG) { 59 | try { 60 | /* 61 | We use reflection here to pick up the class that initializes Flipper, 62 | since Flipper library is not available in release mode 63 | */ 64 | Class aClass = Class.forName("com.example.reactnativefileutils.ReactNativeFlipper"); 65 | aClass 66 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 67 | .invoke(null, context, reactInstanceManager); 68 | } catch (ClassNotFoundException e) { 69 | e.printStackTrace(); 70 | } catch (NoSuchMethodException e) { 71 | e.printStackTrace(); 72 | } catch (IllegalAccessException e) { 73 | e.printStackTrace(); 74 | } catch (InvocationTargetException e) { 75 | e.printStackTrace(); 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FileUtils 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 | minSdkVersion = 21 6 | compileSdkVersion = 29 7 | targetSdkVersion = 29 8 | } 9 | repositories { 10 | google() 11 | mavenCentral() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.5.3") 16 | 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 | mavenCentral() 36 | jcenter() 37 | maven { url 'https://www.jitpack.io' } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | FLIPPER_VERSION=0.54.0 23 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qeepsake/react-native-file-utils/637be5d505a41b3096f7992462d73e2f7dbdabba/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.2-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 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /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 http://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 init 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 init 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 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'FileUtilsExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | 5 | include ':reactnativefileutils' 6 | project(':reactnativefileutils').projectDir = new File(rootProject.projectDir, '../../android') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FileUtilsExample", 3 | "displayName": "FileUtils Example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const pak = require('../package.json'); 3 | 4 | module.exports = { 5 | presets: ['module:metro-react-native-babel-preset'], 6 | plugins: [ 7 | [ 8 | 'module-resolver', 9 | { 10 | extensions: ['.tsx', '.ts', '.js', '.json'], 11 | alias: { 12 | [pak.name]: path.join(__dirname, '..', pak.source), 13 | }, 14 | }, 15 | ], 16 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // FileUtilsExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* FileUtilsExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* FileUtilsExampleTests.m */; }; 11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | 1D0ECCC1276B9A770034E647 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0ECCC0276B9A770034E647 /* ShareViewController.m */; }; 15 | 1D0ECCC4276B9A770034E647 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D0ECCC2276B9A770034E647 /* MainInterface.storyboard */; }; 16 | 1D0ECCC8276B9A770034E647 /* SharePhoto.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 1D0ECCBD276B9A770034E647 /* SharePhoto.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 17 | 4C39C56BAD484C67AA576FFA /* libPods-FileUtilsExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-FileUtilsExample.a */; }; 18 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 27 | remoteInfo = FileUtilsExample; 28 | }; 29 | 1D0ECCC6276B9A770034E647 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 1D0ECCBC276B9A770034E647; 34 | remoteInfo = SharePhoto; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXCopyFilesBuildPhase section */ 39 | 1D0ECCCC276B9A780034E647 /* Embed App Extensions */ = { 40 | isa = PBXCopyFilesBuildPhase; 41 | buildActionMask = 2147483647; 42 | dstPath = ""; 43 | dstSubfolderSpec = 13; 44 | files = ( 45 | 1D0ECCC8276B9A770034E647 /* SharePhoto.appex in Embed App Extensions */, 46 | ); 47 | name = "Embed App Extensions"; 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXCopyFilesBuildPhase section */ 51 | 52 | /* Begin PBXFileReference section */ 53 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 54 | 00E356EE1AD99517003FC87E /* FileUtilsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileUtilsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 00E356F21AD99517003FC87E /* FileUtilsExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FileUtilsExampleTests.m; sourceTree = ""; }; 57 | 13B07F961A680F5B00A75B9A /* FileUtilsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FileUtilsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = FileUtilsExample/AppDelegate.h; sourceTree = ""; }; 59 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = FileUtilsExample/AppDelegate.m; sourceTree = ""; }; 60 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = FileUtilsExample/Images.xcassets; sourceTree = ""; }; 61 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = FileUtilsExample/Info.plist; sourceTree = ""; }; 62 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FileUtilsExample/main.m; sourceTree = ""; }; 63 | 1D0ECCBD276B9A770034E647 /* SharePhoto.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SharePhoto.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 1D0ECCBF276B9A770034E647 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = ""; }; 65 | 1D0ECCC0276B9A770034E647 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = ""; }; 66 | 1D0ECCC3276B9A770034E647 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; 67 | 1D0ECCC5276B9A770034E647 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | 47F7ED3B7971BE374F7B8635 /* Pods-FileUtilsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FileUtilsExample.debug.xcconfig"; path = "Target Support Files/Pods-FileUtilsExample/Pods-FileUtilsExample.debug.xcconfig"; sourceTree = ""; }; 69 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = FileUtilsExample/LaunchScreen.storyboard; sourceTree = ""; }; 70 | CA3E69C5B9553B26FBA2DF04 /* libPods-FileUtilsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FileUtilsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | E00ACF0FDA8BF921659E2F9A /* Pods-FileUtilsExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FileUtilsExample.release.xcconfig"; path = "Target Support Files/Pods-FileUtilsExample/Pods-FileUtilsExample.release.xcconfig"; sourceTree = ""; }; 72 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 73 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 74 | /* End PBXFileReference section */ 75 | 76 | /* Begin PBXFrameworksBuildPhase section */ 77 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 4C39C56BAD484C67AA576FFA /* libPods-FileUtilsExample.a in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | 1D0ECCBA276B9A770034E647 /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | /* End PBXFrameworksBuildPhase section */ 100 | 101 | /* Begin PBXGroup section */ 102 | 00E356EF1AD99517003FC87E /* FileUtilsExampleTests */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 00E356F21AD99517003FC87E /* FileUtilsExampleTests.m */, 106 | 00E356F01AD99517003FC87E /* Supporting Files */, 107 | ); 108 | path = FileUtilsExampleTests; 109 | sourceTree = ""; 110 | }; 111 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 00E356F11AD99517003FC87E /* Info.plist */, 115 | ); 116 | name = "Supporting Files"; 117 | sourceTree = ""; 118 | }; 119 | 13B07FAE1A68108700A75B9A /* FileUtilsExample */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 123 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 124 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 125 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 126 | 13B07FB61A68108700A75B9A /* Info.plist */, 127 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 128 | 13B07FB71A68108700A75B9A /* main.m */, 129 | ); 130 | name = FileUtilsExample; 131 | sourceTree = ""; 132 | }; 133 | 1D0ECCBE276B9A770034E647 /* SharePhoto */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 1D0ECCBF276B9A770034E647 /* ShareViewController.h */, 137 | 1D0ECCC0276B9A770034E647 /* ShareViewController.m */, 138 | 1D0ECCC2276B9A770034E647 /* MainInterface.storyboard */, 139 | 1D0ECCC5276B9A770034E647 /* Info.plist */, 140 | ); 141 | path = SharePhoto; 142 | sourceTree = ""; 143 | }; 144 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 148 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 149 | CA3E69C5B9553B26FBA2DF04 /* libPods-FileUtilsExample.a */, 150 | ); 151 | name = Frameworks; 152 | sourceTree = ""; 153 | }; 154 | 6B9684456A2045ADE5A6E47E /* Pods */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 47F7ED3B7971BE374F7B8635 /* Pods-FileUtilsExample.debug.xcconfig */, 158 | E00ACF0FDA8BF921659E2F9A /* Pods-FileUtilsExample.release.xcconfig */, 159 | ); 160 | path = Pods; 161 | sourceTree = ""; 162 | }; 163 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | ); 167 | name = Libraries; 168 | sourceTree = ""; 169 | }; 170 | 83CBB9F61A601CBA00E9B192 = { 171 | isa = PBXGroup; 172 | children = ( 173 | 13B07FAE1A68108700A75B9A /* FileUtilsExample */, 174 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 175 | 00E356EF1AD99517003FC87E /* FileUtilsExampleTests */, 176 | 1D0ECCBE276B9A770034E647 /* SharePhoto */, 177 | 83CBBA001A601CBA00E9B192 /* Products */, 178 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 179 | 6B9684456A2045ADE5A6E47E /* Pods */, 180 | ); 181 | indentWidth = 2; 182 | sourceTree = ""; 183 | tabWidth = 2; 184 | usesTabs = 0; 185 | }; 186 | 83CBBA001A601CBA00E9B192 /* Products */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | 13B07F961A680F5B00A75B9A /* FileUtilsExample.app */, 190 | 00E356EE1AD99517003FC87E /* FileUtilsExampleTests.xctest */, 191 | 1D0ECCBD276B9A770034E647 /* SharePhoto.appex */, 192 | ); 193 | name = Products; 194 | sourceTree = ""; 195 | }; 196 | /* End PBXGroup section */ 197 | 198 | /* Begin PBXNativeTarget section */ 199 | 00E356ED1AD99517003FC87E /* FileUtilsExampleTests */ = { 200 | isa = PBXNativeTarget; 201 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "FileUtilsExampleTests" */; 202 | buildPhases = ( 203 | 00E356EA1AD99517003FC87E /* Sources */, 204 | 00E356EB1AD99517003FC87E /* Frameworks */, 205 | 00E356EC1AD99517003FC87E /* Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 211 | ); 212 | name = FileUtilsExampleTests; 213 | productName = FileUtilsExampleTests; 214 | productReference = 00E356EE1AD99517003FC87E /* FileUtilsExampleTests.xctest */; 215 | productType = "com.apple.product-type.bundle.unit-test"; 216 | }; 217 | 13B07F861A680F5B00A75B9A /* FileUtilsExample */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FileUtilsExample" */; 220 | buildPhases = ( 221 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */, 222 | FD10A7F022414F080027D42C /* Start Packager */, 223 | 13B07F871A680F5B00A75B9A /* Sources */, 224 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 225 | 13B07F8E1A680F5B00A75B9A /* Resources */, 226 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 227 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */, 228 | 1D0ECCCC276B9A780034E647 /* Embed App Extensions */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 1D0ECCC7276B9A770034E647 /* PBXTargetDependency */, 234 | ); 235 | name = FileUtilsExample; 236 | productName = FileUtilsExample; 237 | productReference = 13B07F961A680F5B00A75B9A /* FileUtilsExample.app */; 238 | productType = "com.apple.product-type.application"; 239 | }; 240 | 1D0ECCBC276B9A770034E647 /* SharePhoto */ = { 241 | isa = PBXNativeTarget; 242 | buildConfigurationList = 1D0ECCC9276B9A780034E647 /* Build configuration list for PBXNativeTarget "SharePhoto" */; 243 | buildPhases = ( 244 | 1D0ECCB9276B9A770034E647 /* Sources */, 245 | 1D0ECCBA276B9A770034E647 /* Frameworks */, 246 | 1D0ECCBB276B9A770034E647 /* Resources */, 247 | ); 248 | buildRules = ( 249 | ); 250 | dependencies = ( 251 | ); 252 | name = SharePhoto; 253 | productName = SharePhoto; 254 | productReference = 1D0ECCBD276B9A770034E647 /* SharePhoto.appex */; 255 | productType = "com.apple.product-type.app-extension"; 256 | }; 257 | /* End PBXNativeTarget section */ 258 | 259 | /* Begin PBXProject section */ 260 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 261 | isa = PBXProject; 262 | attributes = { 263 | LastUpgradeCheck = 1130; 264 | TargetAttributes = { 265 | 00E356ED1AD99517003FC87E = { 266 | CreatedOnToolsVersion = 6.2; 267 | TestTargetID = 13B07F861A680F5B00A75B9A; 268 | }; 269 | 13B07F861A680F5B00A75B9A = { 270 | DevelopmentTeam = FSFTG8H38A; 271 | LastSwiftMigration = 1120; 272 | ProvisioningStyle = Automatic; 273 | }; 274 | 1D0ECCBC276B9A770034E647 = { 275 | CreatedOnToolsVersion = 13.2; 276 | DevelopmentTeam = FSFTG8H38A; 277 | ProvisioningStyle = Automatic; 278 | }; 279 | }; 280 | }; 281 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FileUtilsExample" */; 282 | compatibilityVersion = "Xcode 3.2"; 283 | developmentRegion = en; 284 | hasScannedForEncodings = 0; 285 | knownRegions = ( 286 | en, 287 | Base, 288 | ); 289 | mainGroup = 83CBB9F61A601CBA00E9B192; 290 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 291 | projectDirPath = ""; 292 | projectRoot = ""; 293 | targets = ( 294 | 13B07F861A680F5B00A75B9A /* FileUtilsExample */, 295 | 00E356ED1AD99517003FC87E /* FileUtilsExampleTests */, 296 | 1D0ECCBC276B9A770034E647 /* SharePhoto */, 297 | ); 298 | }; 299 | /* End PBXProject section */ 300 | 301 | /* Begin PBXResourcesBuildPhase section */ 302 | 00E356EC1AD99517003FC87E /* Resources */ = { 303 | isa = PBXResourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | }; 309 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 310 | isa = PBXResourcesBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 314 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | 1D0ECCBB276B9A770034E647 /* Resources */ = { 319 | isa = PBXResourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | 1D0ECCC4276B9A770034E647 /* MainInterface.storyboard in Resources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | /* End PBXResourcesBuildPhase section */ 327 | 328 | /* Begin PBXShellScriptBuildPhase section */ 329 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 330 | isa = PBXShellScriptBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | inputPaths = ( 335 | ); 336 | name = "Bundle React Native code and images"; 337 | outputPaths = ( 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | shellPath = /bin/sh; 341 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 342 | }; 343 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */ = { 344 | isa = PBXShellScriptBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | ); 348 | inputFileListPaths = ( 349 | ); 350 | inputPaths = ( 351 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 352 | "${PODS_ROOT}/Manifest.lock", 353 | ); 354 | name = "[CP] Check Pods Manifest.lock"; 355 | outputFileListPaths = ( 356 | ); 357 | outputPaths = ( 358 | "$(DERIVED_FILE_DIR)/Pods-FileUtilsExample-checkManifestLockResult.txt", 359 | ); 360 | runOnlyForDeploymentPostprocessing = 0; 361 | shellPath = /bin/sh; 362 | 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"; 363 | showEnvVarsInLog = 0; 364 | }; 365 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */ = { 366 | isa = PBXShellScriptBuildPhase; 367 | buildActionMask = 2147483647; 368 | files = ( 369 | ); 370 | inputPaths = ( 371 | "${PODS_ROOT}/Target Support Files/Pods-FileUtilsExample/Pods-FileUtilsExample-resources.sh", 372 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", 373 | ); 374 | name = "[CP] Copy Pods Resources"; 375 | outputPaths = ( 376 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | shellPath = /bin/sh; 380 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FileUtilsExample/Pods-FileUtilsExample-resources.sh\"\n"; 381 | showEnvVarsInLog = 0; 382 | }; 383 | FD10A7F022414F080027D42C /* Start Packager */ = { 384 | isa = PBXShellScriptBuildPhase; 385 | buildActionMask = 2147483647; 386 | files = ( 387 | ); 388 | inputFileListPaths = ( 389 | ); 390 | inputPaths = ( 391 | ); 392 | name = "Start Packager"; 393 | outputFileListPaths = ( 394 | ); 395 | outputPaths = ( 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | shellPath = /bin/sh; 399 | 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"; 400 | showEnvVarsInLog = 0; 401 | }; 402 | /* End PBXShellScriptBuildPhase section */ 403 | 404 | /* Begin PBXSourcesBuildPhase section */ 405 | 00E356EA1AD99517003FC87E /* Sources */ = { 406 | isa = PBXSourcesBuildPhase; 407 | buildActionMask = 2147483647; 408 | files = ( 409 | 00E356F31AD99517003FC87E /* FileUtilsExampleTests.m in Sources */, 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | 13B07F871A680F5B00A75B9A /* Sources */ = { 414 | isa = PBXSourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 418 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 419 | ); 420 | runOnlyForDeploymentPostprocessing = 0; 421 | }; 422 | 1D0ECCB9276B9A770034E647 /* Sources */ = { 423 | isa = PBXSourcesBuildPhase; 424 | buildActionMask = 2147483647; 425 | files = ( 426 | 1D0ECCC1276B9A770034E647 /* ShareViewController.m in Sources */, 427 | ); 428 | runOnlyForDeploymentPostprocessing = 0; 429 | }; 430 | /* End PBXSourcesBuildPhase section */ 431 | 432 | /* Begin PBXTargetDependency section */ 433 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 434 | isa = PBXTargetDependency; 435 | target = 13B07F861A680F5B00A75B9A /* FileUtilsExample */; 436 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 437 | }; 438 | 1D0ECCC7276B9A770034E647 /* PBXTargetDependency */ = { 439 | isa = PBXTargetDependency; 440 | target = 1D0ECCBC276B9A770034E647 /* SharePhoto */; 441 | targetProxy = 1D0ECCC6276B9A770034E647 /* PBXContainerItemProxy */; 442 | }; 443 | /* End PBXTargetDependency section */ 444 | 445 | /* Begin PBXVariantGroup section */ 446 | 1D0ECCC2276B9A770034E647 /* MainInterface.storyboard */ = { 447 | isa = PBXVariantGroup; 448 | children = ( 449 | 1D0ECCC3276B9A770034E647 /* Base */, 450 | ); 451 | name = MainInterface.storyboard; 452 | sourceTree = ""; 453 | }; 454 | /* End PBXVariantGroup section */ 455 | 456 | /* Begin XCBuildConfiguration section */ 457 | 00E356F61AD99517003FC87E /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | BUNDLE_LOADER = "$(TEST_HOST)"; 461 | GCC_PREPROCESSOR_DEFINITIONS = ( 462 | "DEBUG=1", 463 | "$(inherited)", 464 | ); 465 | INFOPLIST_FILE = FileUtilsExampleTests/Info.plist; 466 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | OTHER_LDFLAGS = ( 469 | "-ObjC", 470 | "-lc++", 471 | "$(inherited)", 472 | ); 473 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils; 474 | PRODUCT_NAME = "$(TARGET_NAME)"; 475 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FileUtilsExample.app/FileUtilsExample"; 476 | }; 477 | name = Debug; 478 | }; 479 | 00E356F71AD99517003FC87E /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | BUNDLE_LOADER = "$(TEST_HOST)"; 483 | COPY_PHASE_STRIP = NO; 484 | INFOPLIST_FILE = FileUtilsExampleTests/Info.plist; 485 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 487 | OTHER_LDFLAGS = ( 488 | "-ObjC", 489 | "-lc++", 490 | "$(inherited)", 491 | ); 492 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FileUtilsExample.app/FileUtilsExample"; 495 | }; 496 | name = Release; 497 | }; 498 | 13B07F941A680F5B00A75B9A /* Debug */ = { 499 | isa = XCBuildConfiguration; 500 | baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-FileUtilsExample.debug.xcconfig */; 501 | buildSettings = { 502 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 503 | CLANG_ENABLE_MODULES = YES; 504 | CODE_SIGN_IDENTITY = "Apple Development"; 505 | CODE_SIGN_STYLE = Automatic; 506 | CURRENT_PROJECT_VERSION = 1; 507 | DEVELOPMENT_TEAM = FSFTG8H38A; 508 | ENABLE_BITCODE = NO; 509 | INFOPLIST_FILE = FileUtilsExample/Info.plist; 510 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 511 | OTHER_LDFLAGS = ( 512 | "$(inherited)", 513 | "-ObjC", 514 | "-lc++", 515 | ); 516 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils; 517 | PRODUCT_NAME = FileUtilsExample; 518 | PROVISIONING_PROFILE_SPECIFIER = ""; 519 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 520 | SWIFT_VERSION = 5.0; 521 | VERSIONING_SYSTEM = "apple-generic"; 522 | }; 523 | name = Debug; 524 | }; 525 | 13B07F951A680F5B00A75B9A /* Release */ = { 526 | isa = XCBuildConfiguration; 527 | baseConfigurationReference = E00ACF0FDA8BF921659E2F9A /* Pods-FileUtilsExample.release.xcconfig */; 528 | buildSettings = { 529 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 530 | CLANG_ENABLE_MODULES = YES; 531 | CODE_SIGN_IDENTITY = "Apple Development"; 532 | CODE_SIGN_STYLE = Automatic; 533 | CURRENT_PROJECT_VERSION = 1; 534 | DEVELOPMENT_TEAM = FSFTG8H38A; 535 | INFOPLIST_FILE = FileUtilsExample/Info.plist; 536 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 537 | OTHER_LDFLAGS = ( 538 | "$(inherited)", 539 | "-ObjC", 540 | "-lc++", 541 | ); 542 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils; 543 | PRODUCT_NAME = FileUtilsExample; 544 | PROVISIONING_PROFILE_SPECIFIER = ""; 545 | SWIFT_VERSION = 5.0; 546 | VERSIONING_SYSTEM = "apple-generic"; 547 | }; 548 | name = Release; 549 | }; 550 | 1D0ECCCA276B9A780034E647 /* Debug */ = { 551 | isa = XCBuildConfiguration; 552 | buildSettings = { 553 | CLANG_ANALYZER_NONNULL = YES; 554 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 555 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 556 | CLANG_ENABLE_OBJC_WEAK = YES; 557 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 558 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 559 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 560 | CODE_SIGN_IDENTITY = "Apple Development"; 561 | CODE_SIGN_STYLE = Automatic; 562 | CURRENT_PROJECT_VERSION = 1; 563 | DEBUG_INFORMATION_FORMAT = dwarf; 564 | DEVELOPMENT_TEAM = FSFTG8H38A; 565 | GCC_C_LANGUAGE_STANDARD = gnu11; 566 | GENERATE_INFOPLIST_FILE = YES; 567 | INFOPLIST_FILE = SharePhoto/Info.plist; 568 | INFOPLIST_KEY_CFBundleDisplayName = SharePhoto; 569 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 570 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 571 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 572 | MARKETING_VERSION = 1.0; 573 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 574 | MTL_FAST_MATH = YES; 575 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils.SharePhoto; 576 | PRODUCT_NAME = "$(TARGET_NAME)"; 577 | SKIP_INSTALL = YES; 578 | SWIFT_EMIT_LOC_STRINGS = YES; 579 | TARGETED_DEVICE_FAMILY = "1,2"; 580 | }; 581 | name = Debug; 582 | }; 583 | 1D0ECCCB276B9A780034E647 /* Release */ = { 584 | isa = XCBuildConfiguration; 585 | buildSettings = { 586 | CLANG_ANALYZER_NONNULL = YES; 587 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 588 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 589 | CLANG_ENABLE_OBJC_WEAK = YES; 590 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 591 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 592 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 593 | CODE_SIGN_IDENTITY = "Apple Development"; 594 | CODE_SIGN_STYLE = Automatic; 595 | COPY_PHASE_STRIP = NO; 596 | CURRENT_PROJECT_VERSION = 1; 597 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 598 | DEVELOPMENT_TEAM = FSFTG8H38A; 599 | GCC_C_LANGUAGE_STANDARD = gnu11; 600 | GENERATE_INFOPLIST_FILE = YES; 601 | INFOPLIST_FILE = SharePhoto/Info.plist; 602 | INFOPLIST_KEY_CFBundleDisplayName = SharePhoto; 603 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 604 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 605 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 606 | MARKETING_VERSION = 1.0; 607 | MTL_FAST_MATH = YES; 608 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativefileutils.SharePhoto; 609 | PRODUCT_NAME = "$(TARGET_NAME)"; 610 | SKIP_INSTALL = YES; 611 | SWIFT_EMIT_LOC_STRINGS = YES; 612 | TARGETED_DEVICE_FAMILY = "1,2"; 613 | }; 614 | name = Release; 615 | }; 616 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 617 | isa = XCBuildConfiguration; 618 | buildSettings = { 619 | ALWAYS_SEARCH_USER_PATHS = NO; 620 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 621 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 622 | CLANG_CXX_LIBRARY = "libc++"; 623 | CLANG_ENABLE_MODULES = YES; 624 | CLANG_ENABLE_OBJC_ARC = YES; 625 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 626 | CLANG_WARN_BOOL_CONVERSION = YES; 627 | CLANG_WARN_COMMA = YES; 628 | CLANG_WARN_CONSTANT_CONVERSION = YES; 629 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 630 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 631 | CLANG_WARN_EMPTY_BODY = YES; 632 | CLANG_WARN_ENUM_CONVERSION = YES; 633 | CLANG_WARN_INFINITE_RECURSION = YES; 634 | CLANG_WARN_INT_CONVERSION = YES; 635 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 636 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 637 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 638 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 639 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 640 | CLANG_WARN_STRICT_PROTOTYPES = YES; 641 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 642 | CLANG_WARN_UNREACHABLE_CODE = YES; 643 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 644 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 645 | COPY_PHASE_STRIP = NO; 646 | ENABLE_STRICT_OBJC_MSGSEND = YES; 647 | ENABLE_TESTABILITY = YES; 648 | GCC_C_LANGUAGE_STANDARD = gnu99; 649 | GCC_DYNAMIC_NO_PIC = NO; 650 | GCC_NO_COMMON_BLOCKS = YES; 651 | GCC_OPTIMIZATION_LEVEL = 0; 652 | GCC_PREPROCESSOR_DEFINITIONS = ( 653 | "DEBUG=1", 654 | "$(inherited)", 655 | ); 656 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 657 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 658 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 659 | GCC_WARN_UNDECLARED_SELECTOR = YES; 660 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 661 | GCC_WARN_UNUSED_FUNCTION = YES; 662 | GCC_WARN_UNUSED_VARIABLE = YES; 663 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 664 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 665 | LIBRARY_SEARCH_PATHS = ( 666 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 667 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 668 | "\"$(inherited)\"", 669 | ); 670 | MTL_ENABLE_DEBUG_INFO = YES; 671 | ONLY_ACTIVE_ARCH = YES; 672 | SDKROOT = iphoneos; 673 | }; 674 | name = Debug; 675 | }; 676 | 83CBBA211A601CBA00E9B192 /* Release */ = { 677 | isa = XCBuildConfiguration; 678 | buildSettings = { 679 | ALWAYS_SEARCH_USER_PATHS = NO; 680 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 681 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 682 | CLANG_CXX_LIBRARY = "libc++"; 683 | CLANG_ENABLE_MODULES = YES; 684 | CLANG_ENABLE_OBJC_ARC = YES; 685 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 686 | CLANG_WARN_BOOL_CONVERSION = YES; 687 | CLANG_WARN_COMMA = YES; 688 | CLANG_WARN_CONSTANT_CONVERSION = YES; 689 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 690 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 691 | CLANG_WARN_EMPTY_BODY = YES; 692 | CLANG_WARN_ENUM_CONVERSION = YES; 693 | CLANG_WARN_INFINITE_RECURSION = YES; 694 | CLANG_WARN_INT_CONVERSION = YES; 695 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 696 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 697 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 698 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 699 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 700 | CLANG_WARN_STRICT_PROTOTYPES = YES; 701 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 702 | CLANG_WARN_UNREACHABLE_CODE = YES; 703 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 704 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 705 | COPY_PHASE_STRIP = YES; 706 | ENABLE_NS_ASSERTIONS = NO; 707 | ENABLE_STRICT_OBJC_MSGSEND = YES; 708 | GCC_C_LANGUAGE_STANDARD = gnu99; 709 | GCC_NO_COMMON_BLOCKS = YES; 710 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 711 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 712 | GCC_WARN_UNDECLARED_SELECTOR = YES; 713 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 714 | GCC_WARN_UNUSED_FUNCTION = YES; 715 | GCC_WARN_UNUSED_VARIABLE = YES; 716 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 717 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 718 | LIBRARY_SEARCH_PATHS = ( 719 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 720 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 721 | "\"$(inherited)\"", 722 | ); 723 | MTL_ENABLE_DEBUG_INFO = NO; 724 | SDKROOT = iphoneos; 725 | VALIDATE_PRODUCT = YES; 726 | }; 727 | name = Release; 728 | }; 729 | /* End XCBuildConfiguration section */ 730 | 731 | /* Begin XCConfigurationList section */ 732 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "FileUtilsExampleTests" */ = { 733 | isa = XCConfigurationList; 734 | buildConfigurations = ( 735 | 00E356F61AD99517003FC87E /* Debug */, 736 | 00E356F71AD99517003FC87E /* Release */, 737 | ); 738 | defaultConfigurationIsVisible = 0; 739 | defaultConfigurationName = Release; 740 | }; 741 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FileUtilsExample" */ = { 742 | isa = XCConfigurationList; 743 | buildConfigurations = ( 744 | 13B07F941A680F5B00A75B9A /* Debug */, 745 | 13B07F951A680F5B00A75B9A /* Release */, 746 | ); 747 | defaultConfigurationIsVisible = 0; 748 | defaultConfigurationName = Release; 749 | }; 750 | 1D0ECCC9276B9A780034E647 /* Build configuration list for PBXNativeTarget "SharePhoto" */ = { 751 | isa = XCConfigurationList; 752 | buildConfigurations = ( 753 | 1D0ECCCA276B9A780034E647 /* Debug */, 754 | 1D0ECCCB276B9A780034E647 /* Release */, 755 | ); 756 | defaultConfigurationIsVisible = 0; 757 | defaultConfigurationName = Release; 758 | }; 759 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FileUtilsExample" */ = { 760 | isa = XCConfigurationList; 761 | buildConfigurations = ( 762 | 83CBBA201A601CBA00E9B192 /* Debug */, 763 | 83CBBA211A601CBA00E9B192 /* Release */, 764 | ); 765 | defaultConfigurationIsVisible = 0; 766 | defaultConfigurationName = Release; 767 | }; 768 | /* End XCConfigurationList section */ 769 | }; 770 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 771 | } 772 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample.xcodeproj/xcshareddata/xcschemes/FileUtilsExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 76 | 78 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | #ifdef FB_SONARKIT_ENABLED 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | static void InitializeFlipper(UIApplication *application) { 22 | FlipperClient *client = [FlipperClient sharedClient]; 23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 26 | [client addPlugin:[FlipperKitReactPlugin new]]; 27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 28 | [client start]; 29 | } 30 | #endif 31 | 32 | @implementation AppDelegate 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 35 | { 36 | #ifdef FB_SONARKIT_ENABLED 37 | InitializeFlipper(application); 38 | #endif 39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 41 | moduleName:@"FileUtilsExample" 42 | initialProperties:nil]; 43 | 44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 45 | 46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 47 | UIViewController *rootViewController = [UIViewController new]; 48 | rootViewController.view = rootView; 49 | self.window.rootViewController = rootViewController; 50 | [self.window makeKeyAndVisible]; 51 | return YES; 52 | } 53 | 54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 55 | { 56 | #if DEBUG 57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 58 | #else 59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 60 | #endif 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppleMusicUsageDescription 6 | test 7 | NSPhotoLibraryUsageDescription 8 | test 9 | NSPhotoLibraryAddUsageDescription 10 | Get Photos 11 | CFBundleDevelopmentRegion 12 | en 13 | CFBundleDisplayName 14 | FileUtils Example 15 | CFBundleExecutable 16 | $(EXECUTABLE_NAME) 17 | CFBundleIdentifier 18 | $(PRODUCT_BUNDLE_IDENTIFIER) 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | $(PRODUCT_NAME) 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | 1.0 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | 1 31 | LSRequiresIPhoneOS 32 | 33 | NSAppTransportSecurity 34 | 35 | NSAllowsArbitraryLoads 36 | 37 | NSExceptionDomains 38 | 39 | localhost 40 | 41 | NSExceptionAllowsInsecureHTTPLoads 42 | 43 | 44 | 45 | 46 | NSLocationWhenInUseUsageDescription 47 | 48 | UILaunchStoryboardName 49 | LaunchScreen 50 | UIRequiredDeviceCapabilities 51 | 52 | armv7 53 | 54 | UISupportedInterfaceOrientations 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationLandscapeLeft 58 | UIInterfaceOrientationLandscapeRight 59 | 60 | UIViewControllerBasedStatusBarAppearance 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /example/ios/FileUtilsExample/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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 'FileUtilsExample' do 7 | config = use_native_modules! 8 | 9 | use_react_native!(:path => config["reactNativePath"]) 10 | 11 | pod 'react-native-file-utils', :path => '../..' 12 | 13 | # Enables Flipper. 14 | # 15 | # Note that if you have use_frameworks! enabled, Flipper will not work and 16 | # you should disable these next few lines. 17 | # use_flipper!({ 'Flipper' => '0.87.0' }) 18 | # post_install do |installer| 19 | # flipper_post_install(installer) 20 | # end 21 | end 22 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.63.4) 5 | - FBReactNativeSpec (0.63.4): 6 | - Folly (= 2020.01.13.00) 7 | - RCTRequired (= 0.63.4) 8 | - RCTTypeSafety (= 0.63.4) 9 | - React-Core (= 0.63.4) 10 | - React-jsi (= 0.63.4) 11 | - ReactCommon/turbomodule/core (= 0.63.4) 12 | - Folly (2020.01.13.00): 13 | - boost-for-react-native 14 | - DoubleConversion 15 | - Folly/Default (= 2020.01.13.00) 16 | - glog 17 | - Folly/Default (2020.01.13.00): 18 | - boost-for-react-native 19 | - DoubleConversion 20 | - glog 21 | - glog (0.3.5) 22 | - RCTRequired (0.63.4) 23 | - RCTTypeSafety (0.63.4): 24 | - FBLazyVector (= 0.63.4) 25 | - Folly (= 2020.01.13.00) 26 | - RCTRequired (= 0.63.4) 27 | - React-Core (= 0.63.4) 28 | - React (0.63.4): 29 | - React-Core (= 0.63.4) 30 | - React-Core/DevSupport (= 0.63.4) 31 | - React-Core/RCTWebSocket (= 0.63.4) 32 | - React-RCTActionSheet (= 0.63.4) 33 | - React-RCTAnimation (= 0.63.4) 34 | - React-RCTBlob (= 0.63.4) 35 | - React-RCTImage (= 0.63.4) 36 | - React-RCTLinking (= 0.63.4) 37 | - React-RCTNetwork (= 0.63.4) 38 | - React-RCTSettings (= 0.63.4) 39 | - React-RCTText (= 0.63.4) 40 | - React-RCTVibration (= 0.63.4) 41 | - React-callinvoker (0.63.4) 42 | - React-Core (0.63.4): 43 | - Folly (= 2020.01.13.00) 44 | - glog 45 | - React-Core/Default (= 0.63.4) 46 | - React-cxxreact (= 0.63.4) 47 | - React-jsi (= 0.63.4) 48 | - React-jsiexecutor (= 0.63.4) 49 | - Yoga 50 | - React-Core/CoreModulesHeaders (0.63.4): 51 | - Folly (= 2020.01.13.00) 52 | - glog 53 | - React-Core/Default 54 | - React-cxxreact (= 0.63.4) 55 | - React-jsi (= 0.63.4) 56 | - React-jsiexecutor (= 0.63.4) 57 | - Yoga 58 | - React-Core/Default (0.63.4): 59 | - Folly (= 2020.01.13.00) 60 | - glog 61 | - React-cxxreact (= 0.63.4) 62 | - React-jsi (= 0.63.4) 63 | - React-jsiexecutor (= 0.63.4) 64 | - Yoga 65 | - React-Core/DevSupport (0.63.4): 66 | - Folly (= 2020.01.13.00) 67 | - glog 68 | - React-Core/Default (= 0.63.4) 69 | - React-Core/RCTWebSocket (= 0.63.4) 70 | - React-cxxreact (= 0.63.4) 71 | - React-jsi (= 0.63.4) 72 | - React-jsiexecutor (= 0.63.4) 73 | - React-jsinspector (= 0.63.4) 74 | - Yoga 75 | - React-Core/RCTActionSheetHeaders (0.63.4): 76 | - Folly (= 2020.01.13.00) 77 | - glog 78 | - React-Core/Default 79 | - React-cxxreact (= 0.63.4) 80 | - React-jsi (= 0.63.4) 81 | - React-jsiexecutor (= 0.63.4) 82 | - Yoga 83 | - React-Core/RCTAnimationHeaders (0.63.4): 84 | - Folly (= 2020.01.13.00) 85 | - glog 86 | - React-Core/Default 87 | - React-cxxreact (= 0.63.4) 88 | - React-jsi (= 0.63.4) 89 | - React-jsiexecutor (= 0.63.4) 90 | - Yoga 91 | - React-Core/RCTBlobHeaders (0.63.4): 92 | - Folly (= 2020.01.13.00) 93 | - glog 94 | - React-Core/Default 95 | - React-cxxreact (= 0.63.4) 96 | - React-jsi (= 0.63.4) 97 | - React-jsiexecutor (= 0.63.4) 98 | - Yoga 99 | - React-Core/RCTImageHeaders (0.63.4): 100 | - Folly (= 2020.01.13.00) 101 | - glog 102 | - React-Core/Default 103 | - React-cxxreact (= 0.63.4) 104 | - React-jsi (= 0.63.4) 105 | - React-jsiexecutor (= 0.63.4) 106 | - Yoga 107 | - React-Core/RCTLinkingHeaders (0.63.4): 108 | - Folly (= 2020.01.13.00) 109 | - glog 110 | - React-Core/Default 111 | - React-cxxreact (= 0.63.4) 112 | - React-jsi (= 0.63.4) 113 | - React-jsiexecutor (= 0.63.4) 114 | - Yoga 115 | - React-Core/RCTNetworkHeaders (0.63.4): 116 | - Folly (= 2020.01.13.00) 117 | - glog 118 | - React-Core/Default 119 | - React-cxxreact (= 0.63.4) 120 | - React-jsi (= 0.63.4) 121 | - React-jsiexecutor (= 0.63.4) 122 | - Yoga 123 | - React-Core/RCTSettingsHeaders (0.63.4): 124 | - Folly (= 2020.01.13.00) 125 | - glog 126 | - React-Core/Default 127 | - React-cxxreact (= 0.63.4) 128 | - React-jsi (= 0.63.4) 129 | - React-jsiexecutor (= 0.63.4) 130 | - Yoga 131 | - React-Core/RCTTextHeaders (0.63.4): 132 | - Folly (= 2020.01.13.00) 133 | - glog 134 | - React-Core/Default 135 | - React-cxxreact (= 0.63.4) 136 | - React-jsi (= 0.63.4) 137 | - React-jsiexecutor (= 0.63.4) 138 | - Yoga 139 | - React-Core/RCTVibrationHeaders (0.63.4): 140 | - Folly (= 2020.01.13.00) 141 | - glog 142 | - React-Core/Default 143 | - React-cxxreact (= 0.63.4) 144 | - React-jsi (= 0.63.4) 145 | - React-jsiexecutor (= 0.63.4) 146 | - Yoga 147 | - React-Core/RCTWebSocket (0.63.4): 148 | - Folly (= 2020.01.13.00) 149 | - glog 150 | - React-Core/Default (= 0.63.4) 151 | - React-cxxreact (= 0.63.4) 152 | - React-jsi (= 0.63.4) 153 | - React-jsiexecutor (= 0.63.4) 154 | - Yoga 155 | - React-CoreModules (0.63.4): 156 | - FBReactNativeSpec (= 0.63.4) 157 | - Folly (= 2020.01.13.00) 158 | - RCTTypeSafety (= 0.63.4) 159 | - React-Core/CoreModulesHeaders (= 0.63.4) 160 | - React-jsi (= 0.63.4) 161 | - React-RCTImage (= 0.63.4) 162 | - ReactCommon/turbomodule/core (= 0.63.4) 163 | - React-cxxreact (0.63.4): 164 | - boost-for-react-native (= 1.63.0) 165 | - DoubleConversion 166 | - Folly (= 2020.01.13.00) 167 | - glog 168 | - React-callinvoker (= 0.63.4) 169 | - React-jsinspector (= 0.63.4) 170 | - React-jsi (0.63.4): 171 | - boost-for-react-native (= 1.63.0) 172 | - DoubleConversion 173 | - Folly (= 2020.01.13.00) 174 | - glog 175 | - React-jsi/Default (= 0.63.4) 176 | - React-jsi/Default (0.63.4): 177 | - boost-for-react-native (= 1.63.0) 178 | - DoubleConversion 179 | - Folly (= 2020.01.13.00) 180 | - glog 181 | - React-jsiexecutor (0.63.4): 182 | - DoubleConversion 183 | - Folly (= 2020.01.13.00) 184 | - glog 185 | - React-cxxreact (= 0.63.4) 186 | - React-jsi (= 0.63.4) 187 | - React-jsinspector (0.63.4) 188 | - react-native-file-utils (1.0.5): 189 | - React-Core 190 | - react-native-image-picker (4.6.0): 191 | - React-Core 192 | - React-RCTActionSheet (0.63.4): 193 | - React-Core/RCTActionSheetHeaders (= 0.63.4) 194 | - React-RCTAnimation (0.63.4): 195 | - FBReactNativeSpec (= 0.63.4) 196 | - Folly (= 2020.01.13.00) 197 | - RCTTypeSafety (= 0.63.4) 198 | - React-Core/RCTAnimationHeaders (= 0.63.4) 199 | - React-jsi (= 0.63.4) 200 | - ReactCommon/turbomodule/core (= 0.63.4) 201 | - React-RCTBlob (0.63.4): 202 | - FBReactNativeSpec (= 0.63.4) 203 | - Folly (= 2020.01.13.00) 204 | - React-Core/RCTBlobHeaders (= 0.63.4) 205 | - React-Core/RCTWebSocket (= 0.63.4) 206 | - React-jsi (= 0.63.4) 207 | - React-RCTNetwork (= 0.63.4) 208 | - ReactCommon/turbomodule/core (= 0.63.4) 209 | - React-RCTImage (0.63.4): 210 | - FBReactNativeSpec (= 0.63.4) 211 | - Folly (= 2020.01.13.00) 212 | - RCTTypeSafety (= 0.63.4) 213 | - React-Core/RCTImageHeaders (= 0.63.4) 214 | - React-jsi (= 0.63.4) 215 | - React-RCTNetwork (= 0.63.4) 216 | - ReactCommon/turbomodule/core (= 0.63.4) 217 | - React-RCTLinking (0.63.4): 218 | - FBReactNativeSpec (= 0.63.4) 219 | - React-Core/RCTLinkingHeaders (= 0.63.4) 220 | - React-jsi (= 0.63.4) 221 | - ReactCommon/turbomodule/core (= 0.63.4) 222 | - React-RCTNetwork (0.63.4): 223 | - FBReactNativeSpec (= 0.63.4) 224 | - Folly (= 2020.01.13.00) 225 | - RCTTypeSafety (= 0.63.4) 226 | - React-Core/RCTNetworkHeaders (= 0.63.4) 227 | - React-jsi (= 0.63.4) 228 | - ReactCommon/turbomodule/core (= 0.63.4) 229 | - React-RCTSettings (0.63.4): 230 | - FBReactNativeSpec (= 0.63.4) 231 | - Folly (= 2020.01.13.00) 232 | - RCTTypeSafety (= 0.63.4) 233 | - React-Core/RCTSettingsHeaders (= 0.63.4) 234 | - React-jsi (= 0.63.4) 235 | - ReactCommon/turbomodule/core (= 0.63.4) 236 | - React-RCTText (0.63.4): 237 | - React-Core/RCTTextHeaders (= 0.63.4) 238 | - React-RCTVibration (0.63.4): 239 | - FBReactNativeSpec (= 0.63.4) 240 | - Folly (= 2020.01.13.00) 241 | - React-Core/RCTVibrationHeaders (= 0.63.4) 242 | - React-jsi (= 0.63.4) 243 | - ReactCommon/turbomodule/core (= 0.63.4) 244 | - ReactCommon/turbomodule/core (0.63.4): 245 | - DoubleConversion 246 | - Folly (= 2020.01.13.00) 247 | - glog 248 | - React-callinvoker (= 0.63.4) 249 | - React-Core (= 0.63.4) 250 | - React-cxxreact (= 0.63.4) 251 | - React-jsi (= 0.63.4) 252 | - Yoga (1.14.0) 253 | 254 | DEPENDENCIES: 255 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 256 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 257 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 258 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 259 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 260 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 261 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 262 | - React (from `../node_modules/react-native/`) 263 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 264 | - React-Core (from `../node_modules/react-native/`) 265 | - React-Core/DevSupport (from `../node_modules/react-native/`) 266 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 267 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 268 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 269 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 270 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 271 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 272 | - react-native-file-utils (from `../..`) 273 | - react-native-image-picker (from `../node_modules/react-native-image-picker`) 274 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 275 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 276 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 277 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 278 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 279 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 280 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 281 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 282 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 283 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 284 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 285 | 286 | SPEC REPOS: 287 | trunk: 288 | - boost-for-react-native 289 | 290 | EXTERNAL SOURCES: 291 | DoubleConversion: 292 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 293 | FBLazyVector: 294 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 295 | FBReactNativeSpec: 296 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 297 | Folly: 298 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 299 | glog: 300 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 301 | RCTRequired: 302 | :path: "../node_modules/react-native/Libraries/RCTRequired" 303 | RCTTypeSafety: 304 | :path: "../node_modules/react-native/Libraries/TypeSafety" 305 | React: 306 | :path: "../node_modules/react-native/" 307 | React-callinvoker: 308 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 309 | React-Core: 310 | :path: "../node_modules/react-native/" 311 | React-CoreModules: 312 | :path: "../node_modules/react-native/React/CoreModules" 313 | React-cxxreact: 314 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 315 | React-jsi: 316 | :path: "../node_modules/react-native/ReactCommon/jsi" 317 | React-jsiexecutor: 318 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 319 | React-jsinspector: 320 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 321 | react-native-file-utils: 322 | :path: "../.." 323 | react-native-image-picker: 324 | :path: "../node_modules/react-native-image-picker" 325 | React-RCTActionSheet: 326 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 327 | React-RCTAnimation: 328 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 329 | React-RCTBlob: 330 | :path: "../node_modules/react-native/Libraries/Blob" 331 | React-RCTImage: 332 | :path: "../node_modules/react-native/Libraries/Image" 333 | React-RCTLinking: 334 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 335 | React-RCTNetwork: 336 | :path: "../node_modules/react-native/Libraries/Network" 337 | React-RCTSettings: 338 | :path: "../node_modules/react-native/Libraries/Settings" 339 | React-RCTText: 340 | :path: "../node_modules/react-native/Libraries/Text" 341 | React-RCTVibration: 342 | :path: "../node_modules/react-native/Libraries/Vibration" 343 | ReactCommon: 344 | :path: "../node_modules/react-native/ReactCommon" 345 | Yoga: 346 | :path: "../node_modules/react-native/ReactCommon/yoga" 347 | 348 | SPEC CHECKSUMS: 349 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 350 | DoubleConversion: cde416483dac037923206447da6e1454df403714 351 | FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e 352 | FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e 353 | Folly: b73c3869541e86821df3c387eb0af5f65addfab4 354 | glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 355 | RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e 356 | RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b 357 | React: b0a957a2c44da4113b0c4c9853d8387f8e64e615 358 | React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe 359 | React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b 360 | React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60 361 | React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3 362 | React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 363 | React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 364 | React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a 365 | react-native-file-utils: e11f0eabd3f4c0c0a6d87edbf26fad497f255f09 366 | react-native-image-picker: 8c83c5c7d137e866bcb9a2db93f1e1ca866fddbf 367 | React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336 368 | React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b 369 | React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0 370 | React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0 371 | React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2 372 | React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae 373 | React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a 374 | React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c 375 | React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d 376 | ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b 377 | Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6 378 | 379 | PODFILE CHECKSUM: 113a73dc7c88d6794df3f24160371c05e108d78a 380 | 381 | COCOAPODS: 1.11.2 382 | -------------------------------------------------------------------------------- /example/ios/SharePhoto/Base.lproj/MainInterface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/SharePhoto/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSExtension 6 | 7 | NSExtensionAttributes 8 | 9 | NSExtensionActivationRule 10 | TRUEPREDICATE 11 | 12 | NSExtensionMainStoryboard 13 | MainInterface 14 | NSExtensionPointIdentifier 15 | com.apple.share-services 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/ios/SharePhoto/ShareViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShareViewController.h 3 | // SharePhoto 4 | // 5 | // Created by Thomas Brian on 12/16/21. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface ShareViewController : SLComposeServiceViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/SharePhoto/ShareViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShareViewController.m 3 | // SharePhoto 4 | // 5 | // Created by Thomas Brian on 12/16/21. 6 | // 7 | 8 | #import "ShareViewController.h" 9 | 10 | @interface ShareViewController () 11 | 12 | @end 13 | 14 | @implementation ShareViewController 15 | 16 | - (BOOL)isContentValid { 17 | // Do validation of contentText and/or NSExtensionContext attachments here 18 | return YES; 19 | } 20 | 21 | - (void)didSelectPost { 22 | // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments. 23 | 24 | // Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context. 25 | [self.extensionContext completeRequestReturningItems:@[] completionHandler:nil]; 26 | } 27 | 28 | - (NSArray *)configurationItems { 29 | // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here. 30 | return @[]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const blacklist = require('metro-config/src/defaults/blacklist'); 3 | const escape = require('escape-string-regexp'); 4 | const pak = require('../package.json'); 5 | 6 | const root = path.resolve(__dirname, '..'); 7 | 8 | const modules = Object.keys({ 9 | ...pak.peerDependencies, 10 | }); 11 | 12 | module.exports = { 13 | projectRoot: __dirname, 14 | watchFolders: [root], 15 | 16 | // We need to make sure that only one version is loaded for peerDependencies 17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules 18 | resolver: { 19 | blacklistRE: blacklist( 20 | modules.map( 21 | (m) => 22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`) 23 | ) 24 | ), 25 | 26 | extraNodeModules: modules.reduce((acc, name) => { 27 | acc[name] = path.join(__dirname, 'node_modules', name); 28 | return acc; 29 | }, {}), 30 | }, 31 | 32 | transformer: { 33 | getTransformOptions: async () => ({ 34 | transform: { 35 | experimentalImportSupport: false, 36 | inlineRequires: true, 37 | }, 38 | }), 39 | }, 40 | }; 41 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-file-utils-example", 3 | "description": "Example app for react-native-file-utils", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "android": "react-native run-android", 8 | "ios": "react-native run-ios", 9 | "start": "react-native start" 10 | }, 11 | "dependencies": { 12 | "react": "16.13.1", 13 | "react-native": "0.63.4", 14 | "react-native-image-picker": "^4.6.0" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.12.10", 18 | "@babel/runtime": "^7.12.5", 19 | "babel-plugin-module-resolver": "^4.0.0", 20 | "metro-react-native-babel-preset": "^0.64.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { StyleSheet, View, Text, Button } from 'react-native'; 4 | import { 5 | getVideoDuration, 6 | getDimensions, 7 | getMimeType, 8 | getTimestamp, 9 | } from '@qeepsake/react-native-file-utils'; 10 | import { launchImageLibrary } from 'react-native-image-picker'; 11 | 12 | export default function App() { 13 | const [result, setResult] = React.useState(); 14 | 15 | React.useEffect(() => { 16 | // getDuration('file://test').then(setResult); 17 | }, []); 18 | 19 | const launchPicker = async (pickUsing: 'id' | 'file path') => { 20 | try { 21 | const pickerResult = await launchImageLibrary({ 22 | includeExtra: true, 23 | mediaType: 'mixed', 24 | }); 25 | 26 | setResult(0); 27 | console.dir(pickerResult); 28 | 29 | const asset = pickerResult.assets; 30 | if (!asset) return; 31 | 32 | const firstAsset = asset[0]; 33 | const uri = firstAsset.uri; 34 | if (!uri) return; 35 | 36 | const mediaType = firstAsset.type?.includes('image') ? 'image' : 'video'; 37 | 38 | console.log(uri); 39 | 40 | console.log('Results from @qeepsake/react-native-file-utils:'); 41 | console.log('-------------'); 42 | 43 | const duration = await getVideoDuration(uri); 44 | console.log('duration:'); 45 | console.log(duration); 46 | 47 | const dimensions = await getDimensions(uri, mediaType); 48 | console.log('dimensions:'); 49 | console.dir(dimensions); 50 | 51 | const mimeType = await getMimeType(uri); 52 | console.log('mimeType:'); 53 | console.dir(mimeType); 54 | 55 | if (pickUsing === 'file path') { 56 | const timestamp = await getTimestamp(uri, mediaType); 57 | console.log('timestamp:'); 58 | console.dir(timestamp); 59 | } else { 60 | const timestamp = await getTimestamp(firstAsset.id!, mediaType); 61 | console.log('timestamp:'); 62 | console.dir(timestamp); 63 | } 64 | } catch (error) { 65 | console.error(error); 66 | } 67 | }; 68 | 69 | return ( 70 | 71 | Result: {result} 72 |