├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .husky ├── .npmignore ├── commit-msg └── pre-commit ├── .yarnrc ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android.gif ├── babel.config.js ├── demo.gif ├── example ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Gemfile ├── Gemfile.lock ├── __tests__ │ └── App-test.js ├── _bundle │ └── config ├── _ruby-version ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── 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.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m ├── metro.config.js ├── package.json └── yarn.lock ├── ios.gif ├── package.json ├── scripts └── bootstrap.js ├── src ├── __tests__ │ └── index.test.tsx └── index.tsx ├── tsconfig.build.json └── tsconfig.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | executors: 4 | default: 5 | docker: 6 | - image: circleci/node:10 7 | working_directory: ~/project 8 | 9 | commands: 10 | attach_project: 11 | steps: 12 | - attach_workspace: 13 | at: ~/project 14 | 15 | jobs: 16 | install-dependencies: 17 | executor: default 18 | steps: 19 | - checkout 20 | - attach_project 21 | - restore_cache: 22 | keys: 23 | - dependencies-{{ checksum "package.json" }} 24 | - dependencies- 25 | - restore_cache: 26 | keys: 27 | - dependencies-example-{{ checksum "example/package.json" }} 28 | - dependencies-example- 29 | - run: 30 | name: Install dependencies 31 | command: | 32 | yarn install --cwd example --frozen-lockfile 33 | yarn install --frozen-lockfile 34 | - save_cache: 35 | key: dependencies-{{ checksum "package.json" }} 36 | paths: node_modules 37 | - save_cache: 38 | key: dependencies-example-{{ checksum "example/package.json" }} 39 | paths: example/node_modules 40 | - persist_to_workspace: 41 | root: . 42 | paths: . 43 | 44 | lint: 45 | executor: default 46 | steps: 47 | - attach_project 48 | - run: 49 | name: Lint files 50 | command: | 51 | yarn lint 52 | 53 | typescript: 54 | executor: default 55 | steps: 56 | - attach_project 57 | - run: 58 | name: Typecheck files 59 | command: | 60 | yarn typescript 61 | 62 | unit-tests: 63 | executor: default 64 | steps: 65 | - attach_project 66 | - run: 67 | name: Run unit tests 68 | command: | 69 | yarn test --coverage 70 | - store_artifacts: 71 | path: coverage 72 | destination: coverage 73 | 74 | build-package: 75 | executor: default 76 | steps: 77 | - attach_project 78 | - run: 79 | name: Build package 80 | command: | 81 | yarn prepare 82 | 83 | workflows: 84 | build-and-test: 85 | jobs: 86 | - install-dependencies 87 | - lint: 88 | requires: 89 | - install-dependencies 90 | - typescript: 91 | requires: 92 | - install-dependencies 93 | - unit-tests: 94 | requires: 95 | - install-dependencies 96 | - build-package: 97 | requires: 98 | - install-dependencies 99 | -------------------------------------------------------------------------------- /.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/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: fakeheal 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.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 | /yarn.lock 66 | -------------------------------------------------------------------------------- /.husky/.npmignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint -E HUSKY_GIT_PARAMS 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint && yarn typescript 5 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # Override Yarn command so we can automatically setup the repo on running `yarn` 2 | 3 | yarn-path "scripts/bootstrap.js" 4 | -------------------------------------------------------------------------------- /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 | To run the example app on Web: 36 | 37 | ```sh 38 | yarn example web 39 | ``` 40 | 41 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 42 | 43 | ```sh 44 | yarn typescript 45 | yarn lint 46 | ``` 47 | 48 | To fix formatting errors, run the following: 49 | 50 | ```sh 51 | yarn lint --fix 52 | ``` 53 | 54 | Remember to add tests for your change if possible. Run the unit tests by: 55 | 56 | ```sh 57 | yarn test 58 | ``` 59 | 60 | ### Commit message convention 61 | 62 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 63 | 64 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 65 | - `feat`: new features, e.g. add new method to the module. 66 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 67 | - `docs`: changes into documentation, e.g. add usage example for the module.. 68 | - `test`: adding or updating tests, e.g. add integration tests using detox. 69 | - `chore`: tooling changes, e.g. change CI config. 70 | 71 | Our pre-commit hooks verify that your commit message matches this format when committing. 72 | 73 | ### Linting and tests 74 | 75 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 76 | 77 | 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. 78 | 79 | Our pre-commit hooks verify that the linter and tests pass when committing. 80 | 81 | ### Publishing to npm 82 | 83 | 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. 84 | 85 | To publish new versions, run the following: 86 | 87 | ```sh 88 | yarn release 89 | ``` 90 | 91 | ### Scripts 92 | 93 | The `package.json` file contains various scripts for common tasks: 94 | 95 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 96 | - `yarn typescript`: type-check files with TypeScript. 97 | - `yarn lint`: lint files with ESLint. 98 | - `yarn test`: run unit tests with Jest. 99 | - `yarn example start`: start the Metro server for the example app. 100 | - `yarn example android`: run the example app on Android. 101 | - `yarn example ios`: run the example app on iOS. 102 | 103 | ### Sending a pull request 104 | 105 | > **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). 106 | 107 | When you're sending a pull request: 108 | 109 | - Prefer small pull requests focused on one change. 110 | - Verify that linters and tests are passing. 111 | - Review the documentation to make sure it looks good. 112 | - Follow the pull request template when opening a pull request. 113 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 114 | 115 | ## Code of Conduct 116 | 117 | ### Our Pledge 118 | 119 | 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. 120 | 121 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 122 | 123 | ### Our Standards 124 | 125 | Examples of behavior that contributes to a positive environment for our community include: 126 | 127 | - Demonstrating empathy and kindness toward other people 128 | - Being respectful of differing opinions, viewpoints, and experiences 129 | - Giving and gracefully accepting constructive feedback 130 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 131 | - Focusing on what is best not just for us as individuals, but for the overall community 132 | 133 | Examples of unacceptable behavior include: 134 | 135 | - The use of sexualized language or imagery, and sexual attention or 136 | advances of any kind 137 | - Trolling, insulting or derogatory comments, and personal or political attacks 138 | - Public or private harassment 139 | - Publishing others' private information, such as a physical or email 140 | address, without their explicit permission 141 | - Other conduct which could reasonably be considered inappropriate in a 142 | professional setting 143 | 144 | ### Enforcement Responsibilities 145 | 146 | 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. 147 | 148 | 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. 149 | 150 | ### Scope 151 | 152 | 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. 153 | 154 | ### Enforcement 155 | 156 | 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. 157 | 158 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 159 | 160 | ### Enforcement Guidelines 161 | 162 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 163 | 164 | #### 1. Correction 165 | 166 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 167 | 168 | **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. 169 | 170 | #### 2. Warning 171 | 172 | **Community Impact**: A violation through a single incident or series of actions. 173 | 174 | **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. 175 | 176 | #### 3. Temporary Ban 177 | 178 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 179 | 180 | **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. 181 | 182 | #### 4. Permanent Ban 183 | 184 | **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. 185 | 186 | **Consequence**: A permanent ban from any sort of public interaction within the community. 187 | 188 | ### Attribution 189 | 190 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 191 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 192 | 193 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 194 | 195 | [homepage]: https://www.contributor-covenant.org 196 | 197 | For answers to common questions about this code of conduct, see the FAQ at 198 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 199 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ivanka Todorova 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 | 2 |

3 | Demo in action 4 |

5 | 6 |

React Native Intl Phone Field

7 |

8 | 9 | npm (scoped) 10 | 11 |

12 | 13 |

14 | 15 | Try the Expo Snack 👏 16 | 17 |
18 |

19 | 20 | ## 🕹️ Demo 21 | 22 | It's a javascript-only (no native code) component that can run in iOS, Android, Expo & React Native Web. Below you can gifs of the demo app that showcases the component in action. 23 | 24 | 25 | iOS Example App Gif 26 | 27 | 28 | 29 | Android Example App Gif 30 | 31 | 32 | _Click on the image to see it in a larger size_. 33 | ## 👋 Introduction 34 | 35 | A simple `` that validates and formats international phone numbers using Google's library [libphonenumber](https://github.com/google/libphonenumber) and [phonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js). Works with pre-propulated data and displays an emoji flag if country code is derived from the number. Additionally, adds a `+` sign infront of the number, so it's considered international. 36 | 37 | ## ⚙️ Installation 38 | 39 | ```sh 40 | yarn add react-native-intl-phone-field 41 | ``` 42 | 43 | ## ✂️ Usage 44 | 45 | ```js 46 | import IntlPhoneField from 'react-native-intl-phone-field'; 47 | 48 | console.log(result)} 50 | onValidation={(isValid) => console.log(isValid)} 51 | defaultCountry="BG" 52 | defaultPrefix="+359" 53 | defaultFlag="🇧🇬" 54 | /> 55 | ``` 56 | 57 | For more detailed example, take a look at the demo app inside [example/](./example). 58 | 59 | ## ⚪ Props 60 | 61 | | Property | Type | Default | Description | 62 | |-------------------|------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 63 | | flagUndetermined | string? | `❓` | Displayed when country code cannot be derived from current phone number. | 64 | | onEndEditing | `function` | undefined | Callback that is called when text input ends [ text input ends](https://reactnative.dev/docs/textinput#onendediting).
It receives [`result`](.src/index.ts#L124). | 65 | | onValidation | `function` | undefined | Callback that is called each time the validation status changes. | 66 | | onValueUpdate | `function` | undefined | Callback that is called each time the underlying `value` changes. | 67 | | defaultCountry | `string` | undefined | Two letter code for default country, eg. `BG` | 68 | | defaultPrefix | `string` | undefined | Default number prefix, eg. `+359` | 69 | | defaultValue | `string` | undefined | Default value for the `TextInput`, if you want to pre-populate it. | 70 | | defaultFlag | `string` | undefined | Emoji for the default flag, eg. `🇧🇬` | 71 | | containerStyle | `object` | undefined | Styles for the component's wrapper `` | 72 | | flagContainerStyle | `object` | undefined | Styles for the flag emoji wrapper `` | 73 | | flagTextStyle | `object` | undefined | Styles for the flag emoji `` | 74 | | textInputStyle | `object` | undefined | Styles for the underlying `` | 75 | | textInputProps | `object` | undefined | [Additional props](https://reactnative.dev/docs/textinput#props) for the underlying `` | 76 | 77 | ## Contributing 78 | 79 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 80 | 81 | ## License 82 | 83 | MIT 84 | -------------------------------------------------------------------------------- /android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/android.gif -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/demo.gif -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | exact_by_default=true 27 | 28 | format.bracket_spacing=false 29 | 30 | module.file_ext=.js 31 | module.file_ext=.json 32 | module.file_ext=.ios.js 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 37 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 38 | 39 | suppress_type=$FlowIssue 40 | suppress_type=$FlowFixMe 41 | suppress_type=$FlowFixMeProps 42 | suppress_type=$FlowFixMeState 43 | 44 | [lints] 45 | sketchy-null-number=warn 46 | sketchy-null-mixed=warn 47 | sketchy-number=warn 48 | untyped-type-import=warn 49 | nonstrict-import=warn 50 | deprecated-type=warn 51 | unsafe-getters-setters=warn 52 | unnecessary-invariant=warn 53 | signature-verification-failure=warn 54 | 55 | [strict] 56 | deprecated-type 57 | nonstrict-import 58 | sketchy-null 59 | unclear-type 60 | unsafe-getters-setters 61 | untyped-import 62 | untyped-type-import 63 | 64 | [version] 65 | ^0.162.0 66 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | *.hprof 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | !debug.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # CocoaPods 60 | /ios/Pods/ 61 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {useState, useCallback} from 'react'; 3 | 4 | import { 5 | KeyboardAvoidingView, 6 | Keyboard, 7 | SafeAreaView, 8 | StyleSheet, 9 | Text, 10 | View, 11 | Pressable, 12 | StatusBar, 13 | ScrollView, 14 | } from 'react-native'; 15 | import IntlPhoneField from 'react-native-intl-phone-field'; 16 | 17 | const DEFAULT_STATE = { 18 | isValid: null, 19 | countryCode: null, 20 | }; 21 | 22 | export default function App() { 23 | const [minimal, setMinimal] = useState(DEFAULT_STATE); 24 | const [defaultCountry, setDefaultCountry] = useState(DEFAULT_STATE); 25 | const [filled, setFilled] = useState(DEFAULT_STATE); 26 | const [realTimeValidation, setRealTimeValidation] = useState(false); 27 | const [trackingValue, setTrackingValue] = useState(''); 28 | 29 | const onEndEditingMinimal = useCallback( 30 | ({isValid, countryCode, value, formatted, flag}) => { 31 | console.log( 32 | 'onEndEditingMinimal', 33 | isValid, 34 | countryCode, 35 | value, 36 | formatted, 37 | flag, 38 | ); 39 | 40 | setMinimal({isValid, countryCode}); 41 | }, 42 | [], 43 | ); 44 | 45 | const onEndEditingDefaultCountry = useCallback( 46 | ({isValid, countryCode, value, formatted, flag}) => { 47 | console.log( 48 | 'onEndEditingDefaultCountry', 49 | isValid, 50 | countryCode, 51 | value, 52 | formatted, 53 | flag, 54 | ); 55 | setDefaultCountry({isValid, countryCode}); 56 | }, 57 | [], 58 | ); 59 | 60 | const onEndEditingFilled = useCallback( 61 | ({isValid, countryCode, value, formatted, flag}) => { 62 | console.log( 63 | 'onEndEditingFilled', 64 | isValid, 65 | countryCode, 66 | value, 67 | formatted, 68 | flag, 69 | ); 70 | setFilled({isValid, countryCode}); 71 | }, 72 | [], 73 | ); 74 | 75 | const onValidationFilled = useCallback( 76 | isValid => setRealTimeValidation(isValid), 77 | [], 78 | ); 79 | 80 | return ( 81 | 82 | 83 | 84 | Keyboard.dismiss()} style={{flex: 1}}> 85 | 86 | 87 | 88 | Minimal 89 | 90 | 91 | 92 | Valid? 93 | 94 | {minimal.isValid ? 'Valid' : 'Invalid'} 95 | 96 | 97 | 98 | Country Code 99 | 100 | {minimal.countryCode ? minimal.countryCode : 'Undefined'} 101 | 102 | 103 | 104 | 105 | 106 | 107 | Default Country + Prefix 108 | 109 | 115 | 116 | 117 | Valid? 118 | 119 | {defaultCountry.isValid ? 'Valid' : 'Invalid'} 120 | 121 | 122 | 123 | Country Code 124 | 125 | {defaultCountry.countryCode 126 | ? defaultCountry.countryCode 127 | : 'Undefined'} 128 | 129 | 130 | 131 | 132 | 133 | Filled + Styles 134 | 145 | 146 | 147 | Valid? 148 | 149 | {filled.isValid ? 'Valid' : 'Invalid'} 150 | 151 | 152 | 153 | Country Code 154 | 155 | {filled.countryCode ? filled.countryCode : 'Undefined'} 156 | 157 | 158 | 159 | 160 | 161 | Tracking Value 162 | { 166 | setTrackingValue(result.formatted); 167 | }} 168 | /> 169 | 170 | 171 | Tracking Value: 172 | {trackingValue} 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | ); 182 | } 183 | 184 | const styles = StyleSheet.create({ 185 | container: { 186 | padding: 20, 187 | justifyContent: 'center', 188 | backgroundColor: '#fff', 189 | }, 190 | example: { 191 | marginBottom: 20, 192 | paddingBottom: 20, 193 | borderBottomColor: 'lightgrey', 194 | borderBottomWidth: 1, 195 | }, 196 | exampleTitle: { 197 | fontSize: 18, 198 | marginBottom: 15, 199 | fontWeight: 'bold', 200 | }, 201 | valid: { 202 | borderBottomColor: 'green', 203 | }, 204 | invalid: { 205 | borderBottomColor: 'red', 206 | }, 207 | output: { 208 | marginTop: 20, 209 | }, 210 | outputRow: { 211 | flexDirection: 'row', 212 | justifyContent: 'space-between', 213 | }, 214 | outputLabel: {}, 215 | outputText: { 216 | fontWeight: 'bold', 217 | }, 218 | }); 219 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.4' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /example/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.5) 5 | rexml 6 | activesupport (6.1.4.6) 7 | concurrent-ruby (~> 1.0, >= 1.0.2) 8 | i18n (>= 1.6, < 2) 9 | minitest (>= 5.1) 10 | tzinfo (~> 2.0) 11 | zeitwerk (~> 2.3) 12 | addressable (2.8.0) 13 | public_suffix (>= 2.0.2, < 5.0) 14 | algoliasearch (1.27.5) 15 | httpclient (~> 2.8, >= 2.8.3) 16 | json (>= 1.5.1) 17 | atomos (0.1.3) 18 | claide (1.1.0) 19 | cocoapods (1.11.2) 20 | addressable (~> 2.8) 21 | claide (>= 1.0.2, < 2.0) 22 | cocoapods-core (= 1.11.2) 23 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 24 | cocoapods-downloader (>= 1.4.0, < 2.0) 25 | cocoapods-plugins (>= 1.0.0, < 2.0) 26 | cocoapods-search (>= 1.0.0, < 2.0) 27 | cocoapods-trunk (>= 1.4.0, < 2.0) 28 | cocoapods-try (>= 1.1.0, < 2.0) 29 | colored2 (~> 3.1) 30 | escape (~> 0.0.4) 31 | fourflusher (>= 2.3.0, < 3.0) 32 | gh_inspector (~> 1.0) 33 | molinillo (~> 0.8.0) 34 | nap (~> 1.0) 35 | ruby-macho (>= 1.0, < 3.0) 36 | xcodeproj (>= 1.21.0, < 2.0) 37 | cocoapods-core (1.11.2) 38 | activesupport (>= 5.0, < 7) 39 | addressable (~> 2.8) 40 | algoliasearch (~> 1.0) 41 | concurrent-ruby (~> 1.1) 42 | fuzzy_match (~> 2.0.4) 43 | nap (~> 1.0) 44 | netrc (~> 0.11) 45 | public_suffix (~> 4.0) 46 | typhoeus (~> 1.0) 47 | cocoapods-deintegrate (1.0.5) 48 | cocoapods-downloader (1.5.1) 49 | cocoapods-plugins (1.0.0) 50 | nap 51 | cocoapods-search (1.0.1) 52 | cocoapods-trunk (1.6.0) 53 | nap (>= 0.8, < 2.0) 54 | netrc (~> 0.11) 55 | cocoapods-try (1.2.0) 56 | colored2 (3.1.2) 57 | concurrent-ruby (1.1.9) 58 | escape (0.0.4) 59 | ethon (0.15.0) 60 | ffi (>= 1.15.0) 61 | ffi (1.15.5) 62 | fourflusher (2.3.1) 63 | fuzzy_match (2.0.4) 64 | gh_inspector (1.1.3) 65 | httpclient (2.8.3) 66 | i18n (1.10.0) 67 | concurrent-ruby (~> 1.0) 68 | json (2.6.1) 69 | minitest (5.15.0) 70 | molinillo (0.8.0) 71 | nanaimo (0.3.0) 72 | nap (1.1.0) 73 | netrc (0.11.0) 74 | public_suffix (4.0.6) 75 | rexml (3.2.5) 76 | ruby-macho (2.5.1) 77 | typhoeus (1.4.0) 78 | ethon (>= 0.9.0) 79 | tzinfo (2.0.4) 80 | concurrent-ruby (~> 1.0) 81 | xcodeproj (1.21.0) 82 | CFPropertyList (>= 2.3.3, < 4.0) 83 | atomos (~> 0.1.3) 84 | claide (>= 1.0.2, < 2.0) 85 | colored2 (~> 3.1) 86 | nanaimo (~> 0.3.0) 87 | rexml (~> 3.2.4) 88 | zeitwerk (2.5.4) 89 | 90 | PLATFORMS 91 | ruby 92 | 93 | DEPENDENCIES 94 | cocoapods (~> 1.11, >= 1.11.2) 95 | 96 | RUBY VERSION 97 | ruby 2.7.4p191 98 | 99 | BUNDLED WITH 100 | 2.2.27 101 | -------------------------------------------------------------------------------- /example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /example/_bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/_ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.4 2 | -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and that value will be read here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | /** 124 | * Architectures to build native code for in debug. 125 | */ 126 | def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") 127 | 128 | android { 129 | ndkVersion rootProject.ext.ndkVersion 130 | 131 | compileSdkVersion rootProject.ext.compileSdkVersion 132 | 133 | defaultConfig { 134 | applicationId "com.example" 135 | minSdkVersion rootProject.ext.minSdkVersion 136 | targetSdkVersion rootProject.ext.targetSdkVersion 137 | versionCode 1 138 | versionName "1.0" 139 | } 140 | splits { 141 | abi { 142 | reset() 143 | enable enableSeparateBuildPerCPUArchitecture 144 | universalApk false // If true, also generate a universal APK 145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 146 | } 147 | } 148 | signingConfigs { 149 | debug { 150 | storeFile file('debug.keystore') 151 | storePassword 'android' 152 | keyAlias 'androiddebugkey' 153 | keyPassword 'android' 154 | } 155 | } 156 | buildTypes { 157 | debug { 158 | signingConfig signingConfigs.debug 159 | if (nativeArchitectures) { 160 | ndk { 161 | abiFilters nativeArchitectures.split(',') 162 | } 163 | } 164 | } 165 | release { 166 | // Caution! In production, you need to generate your own keystore file. 167 | // see https://reactnative.dev/docs/signed-apk-android. 168 | signingConfig signingConfigs.debug 169 | minifyEnabled enableProguardInReleaseBuilds 170 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 171 | } 172 | } 173 | 174 | // applicationVariants are e.g. debug, release 175 | applicationVariants.all { variant -> 176 | variant.outputs.each { output -> 177 | // For each separate APK per architecture, set a unique version code as described here: 178 | // https://developer.android.com/studio/build/configure-apk-splits.html 179 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 180 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 181 | def abi = output.getFilter(OutputFile.ABI) 182 | if (abi != null) { // null for the universal-debug, universal-release variants 183 | output.versionCodeOverride = 184 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 185 | } 186 | 187 | } 188 | } 189 | } 190 | 191 | dependencies { 192 | implementation fileTree(dir: "libs", include: ["*.jar"]) 193 | //noinspection GradleDynamicVersion 194 | implementation "com.facebook.react:react-native:+" // From node_modules 195 | 196 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 197 | 198 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 199 | exclude group:'com.facebook.fbjni' 200 | } 201 | 202 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 203 | exclude group:'com.facebook.flipper' 204 | exclude group:'com.squareup.okhttp3', module:'okhttp' 205 | } 206 | 207 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 208 | exclude group:'com.facebook.flipper' 209 | } 210 | 211 | if (enableHermes) { 212 | def hermesPath = "../../node_modules/hermes-engine/android/"; 213 | debugImplementation files(hermesPath + "hermes-debug.aar") 214 | releaseImplementation files(hermesPath + "hermes-release.aar") 215 | } else { 216 | implementation jscFlavor 217 | } 218 | } 219 | 220 | // Run this once to be able to run the application with BUCK 221 | // puts all compile dependencies into folder libs for BUCK to use 222 | task copyDownloadableDepsToLibs(type: Copy) { 223 | from configurations.implementation 224 | into 'libs' 225 | } 226 | 227 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 228 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/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; 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 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.example.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "21.4.7075529" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.2.2") 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 | maven { 25 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 26 | url("$rootDir/../node_modules/react-native/android") 27 | } 28 | maven { 29 | // Android JSC is installed from npm 30 | url("$rootDir/../node_modules/jsc-android/dist") 31 | } 32 | mavenCentral { 33 | // We don't want to fetch react-native from Maven Central as there are 34 | // older versions over there. 35 | content { 36 | excludeGroup "com.facebook.react" 37 | } 38 | } 39 | google() 40 | maven { url 'https://www.jitpack.io' } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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: -Xmx1024m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.99.0 29 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/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-7.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 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/ios/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, '11.0' 5 | 6 | target 'example' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | target 'exampleTests' do 16 | inherit! :complete 17 | # Pods for testing 18 | end 19 | 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | use_flipper!() 25 | 26 | post_install do |installer| 27 | react_native_post_install(installer) 28 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.67.3) 6 | - FBReactNativeSpec (0.67.3): 7 | - RCT-Folly (= 2021.06.28.00-v2) 8 | - RCTRequired (= 0.67.3) 9 | - RCTTypeSafety (= 0.67.3) 10 | - React-Core (= 0.67.3) 11 | - React-jsi (= 0.67.3) 12 | - ReactCommon/turbomodule/core (= 0.67.3) 13 | - Flipper (0.99.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.1.7) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.7): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.180) 26 | - Flipper-Glog (0.3.6) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.99.0): 31 | - FlipperKit/Core (= 0.99.0) 32 | - FlipperKit/Core (0.99.0): 33 | - Flipper (~> 0.99.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - FlipperKit/CppBridge (0.99.0): 39 | - Flipper (~> 0.99.0) 40 | - FlipperKit/FBCxxFollyDynamicConvert (0.99.0): 41 | - Flipper-Folly (~> 2.6) 42 | - FlipperKit/FBDefines (0.99.0) 43 | - FlipperKit/FKPortForwarding (0.99.0): 44 | - CocoaAsyncSocket (~> 7.6) 45 | - Flipper-PeerTalk (~> 0.0.4) 46 | - FlipperKit/FlipperKitHighlightOverlay (0.99.0) 47 | - FlipperKit/FlipperKitLayoutHelpers (0.99.0): 48 | - FlipperKit/Core 49 | - FlipperKit/FlipperKitHighlightOverlay 50 | - FlipperKit/FlipperKitLayoutTextSearchable 51 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.99.0): 52 | - FlipperKit/Core 53 | - FlipperKit/FlipperKitHighlightOverlay 54 | - FlipperKit/FlipperKitLayoutHelpers 55 | - YogaKit (~> 1.18) 56 | - FlipperKit/FlipperKitLayoutPlugin (0.99.0): 57 | - FlipperKit/Core 58 | - FlipperKit/FlipperKitHighlightOverlay 59 | - FlipperKit/FlipperKitLayoutHelpers 60 | - FlipperKit/FlipperKitLayoutIOSDescriptors 61 | - FlipperKit/FlipperKitLayoutTextSearchable 62 | - YogaKit (~> 1.18) 63 | - FlipperKit/FlipperKitLayoutTextSearchable (0.99.0) 64 | - FlipperKit/FlipperKitNetworkPlugin (0.99.0): 65 | - FlipperKit/Core 66 | - FlipperKit/FlipperKitReactPlugin (0.99.0): 67 | - FlipperKit/Core 68 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.99.0): 69 | - FlipperKit/Core 70 | - FlipperKit/SKIOSNetworkPlugin (0.99.0): 71 | - FlipperKit/Core 72 | - FlipperKit/FlipperKitNetworkPlugin 73 | - fmt (6.2.1) 74 | - glog (0.3.5) 75 | - libevent (2.1.12) 76 | - OpenSSL-Universal (1.1.180) 77 | - RCT-Folly (2021.06.28.00-v2): 78 | - boost 79 | - DoubleConversion 80 | - fmt (~> 6.2.1) 81 | - glog 82 | - RCT-Folly/Default (= 2021.06.28.00-v2) 83 | - RCT-Folly/Default (2021.06.28.00-v2): 84 | - boost 85 | - DoubleConversion 86 | - fmt (~> 6.2.1) 87 | - glog 88 | - RCTRequired (0.67.3) 89 | - RCTTypeSafety (0.67.3): 90 | - FBLazyVector (= 0.67.3) 91 | - RCT-Folly (= 2021.06.28.00-v2) 92 | - RCTRequired (= 0.67.3) 93 | - React-Core (= 0.67.3) 94 | - React (0.67.3): 95 | - React-Core (= 0.67.3) 96 | - React-Core/DevSupport (= 0.67.3) 97 | - React-Core/RCTWebSocket (= 0.67.3) 98 | - React-RCTActionSheet (= 0.67.3) 99 | - React-RCTAnimation (= 0.67.3) 100 | - React-RCTBlob (= 0.67.3) 101 | - React-RCTImage (= 0.67.3) 102 | - React-RCTLinking (= 0.67.3) 103 | - React-RCTNetwork (= 0.67.3) 104 | - React-RCTSettings (= 0.67.3) 105 | - React-RCTText (= 0.67.3) 106 | - React-RCTVibration (= 0.67.3) 107 | - React-callinvoker (0.67.3) 108 | - React-Core (0.67.3): 109 | - glog 110 | - RCT-Folly (= 2021.06.28.00-v2) 111 | - React-Core/Default (= 0.67.3) 112 | - React-cxxreact (= 0.67.3) 113 | - React-jsi (= 0.67.3) 114 | - React-jsiexecutor (= 0.67.3) 115 | - React-perflogger (= 0.67.3) 116 | - Yoga 117 | - React-Core/CoreModulesHeaders (0.67.3): 118 | - glog 119 | - RCT-Folly (= 2021.06.28.00-v2) 120 | - React-Core/Default 121 | - React-cxxreact (= 0.67.3) 122 | - React-jsi (= 0.67.3) 123 | - React-jsiexecutor (= 0.67.3) 124 | - React-perflogger (= 0.67.3) 125 | - Yoga 126 | - React-Core/Default (0.67.3): 127 | - glog 128 | - RCT-Folly (= 2021.06.28.00-v2) 129 | - React-cxxreact (= 0.67.3) 130 | - React-jsi (= 0.67.3) 131 | - React-jsiexecutor (= 0.67.3) 132 | - React-perflogger (= 0.67.3) 133 | - Yoga 134 | - React-Core/DevSupport (0.67.3): 135 | - glog 136 | - RCT-Folly (= 2021.06.28.00-v2) 137 | - React-Core/Default (= 0.67.3) 138 | - React-Core/RCTWebSocket (= 0.67.3) 139 | - React-cxxreact (= 0.67.3) 140 | - React-jsi (= 0.67.3) 141 | - React-jsiexecutor (= 0.67.3) 142 | - React-jsinspector (= 0.67.3) 143 | - React-perflogger (= 0.67.3) 144 | - Yoga 145 | - React-Core/RCTActionSheetHeaders (0.67.3): 146 | - glog 147 | - RCT-Folly (= 2021.06.28.00-v2) 148 | - React-Core/Default 149 | - React-cxxreact (= 0.67.3) 150 | - React-jsi (= 0.67.3) 151 | - React-jsiexecutor (= 0.67.3) 152 | - React-perflogger (= 0.67.3) 153 | - Yoga 154 | - React-Core/RCTAnimationHeaders (0.67.3): 155 | - glog 156 | - RCT-Folly (= 2021.06.28.00-v2) 157 | - React-Core/Default 158 | - React-cxxreact (= 0.67.3) 159 | - React-jsi (= 0.67.3) 160 | - React-jsiexecutor (= 0.67.3) 161 | - React-perflogger (= 0.67.3) 162 | - Yoga 163 | - React-Core/RCTBlobHeaders (0.67.3): 164 | - glog 165 | - RCT-Folly (= 2021.06.28.00-v2) 166 | - React-Core/Default 167 | - React-cxxreact (= 0.67.3) 168 | - React-jsi (= 0.67.3) 169 | - React-jsiexecutor (= 0.67.3) 170 | - React-perflogger (= 0.67.3) 171 | - Yoga 172 | - React-Core/RCTImageHeaders (0.67.3): 173 | - glog 174 | - RCT-Folly (= 2021.06.28.00-v2) 175 | - React-Core/Default 176 | - React-cxxreact (= 0.67.3) 177 | - React-jsi (= 0.67.3) 178 | - React-jsiexecutor (= 0.67.3) 179 | - React-perflogger (= 0.67.3) 180 | - Yoga 181 | - React-Core/RCTLinkingHeaders (0.67.3): 182 | - glog 183 | - RCT-Folly (= 2021.06.28.00-v2) 184 | - React-Core/Default 185 | - React-cxxreact (= 0.67.3) 186 | - React-jsi (= 0.67.3) 187 | - React-jsiexecutor (= 0.67.3) 188 | - React-perflogger (= 0.67.3) 189 | - Yoga 190 | - React-Core/RCTNetworkHeaders (0.67.3): 191 | - glog 192 | - RCT-Folly (= 2021.06.28.00-v2) 193 | - React-Core/Default 194 | - React-cxxreact (= 0.67.3) 195 | - React-jsi (= 0.67.3) 196 | - React-jsiexecutor (= 0.67.3) 197 | - React-perflogger (= 0.67.3) 198 | - Yoga 199 | - React-Core/RCTSettingsHeaders (0.67.3): 200 | - glog 201 | - RCT-Folly (= 2021.06.28.00-v2) 202 | - React-Core/Default 203 | - React-cxxreact (= 0.67.3) 204 | - React-jsi (= 0.67.3) 205 | - React-jsiexecutor (= 0.67.3) 206 | - React-perflogger (= 0.67.3) 207 | - Yoga 208 | - React-Core/RCTTextHeaders (0.67.3): 209 | - glog 210 | - RCT-Folly (= 2021.06.28.00-v2) 211 | - React-Core/Default 212 | - React-cxxreact (= 0.67.3) 213 | - React-jsi (= 0.67.3) 214 | - React-jsiexecutor (= 0.67.3) 215 | - React-perflogger (= 0.67.3) 216 | - Yoga 217 | - React-Core/RCTVibrationHeaders (0.67.3): 218 | - glog 219 | - RCT-Folly (= 2021.06.28.00-v2) 220 | - React-Core/Default 221 | - React-cxxreact (= 0.67.3) 222 | - React-jsi (= 0.67.3) 223 | - React-jsiexecutor (= 0.67.3) 224 | - React-perflogger (= 0.67.3) 225 | - Yoga 226 | - React-Core/RCTWebSocket (0.67.3): 227 | - glog 228 | - RCT-Folly (= 2021.06.28.00-v2) 229 | - React-Core/Default (= 0.67.3) 230 | - React-cxxreact (= 0.67.3) 231 | - React-jsi (= 0.67.3) 232 | - React-jsiexecutor (= 0.67.3) 233 | - React-perflogger (= 0.67.3) 234 | - Yoga 235 | - React-CoreModules (0.67.3): 236 | - FBReactNativeSpec (= 0.67.3) 237 | - RCT-Folly (= 2021.06.28.00-v2) 238 | - RCTTypeSafety (= 0.67.3) 239 | - React-Core/CoreModulesHeaders (= 0.67.3) 240 | - React-jsi (= 0.67.3) 241 | - React-RCTImage (= 0.67.3) 242 | - ReactCommon/turbomodule/core (= 0.67.3) 243 | - React-cxxreact (0.67.3): 244 | - boost (= 1.76.0) 245 | - DoubleConversion 246 | - glog 247 | - RCT-Folly (= 2021.06.28.00-v2) 248 | - React-callinvoker (= 0.67.3) 249 | - React-jsi (= 0.67.3) 250 | - React-jsinspector (= 0.67.3) 251 | - React-logger (= 0.67.3) 252 | - React-perflogger (= 0.67.3) 253 | - React-runtimeexecutor (= 0.67.3) 254 | - React-jsi (0.67.3): 255 | - boost (= 1.76.0) 256 | - DoubleConversion 257 | - glog 258 | - RCT-Folly (= 2021.06.28.00-v2) 259 | - React-jsi/Default (= 0.67.3) 260 | - React-jsi/Default (0.67.3): 261 | - boost (= 1.76.0) 262 | - DoubleConversion 263 | - glog 264 | - RCT-Folly (= 2021.06.28.00-v2) 265 | - React-jsiexecutor (0.67.3): 266 | - DoubleConversion 267 | - glog 268 | - RCT-Folly (= 2021.06.28.00-v2) 269 | - React-cxxreact (= 0.67.3) 270 | - React-jsi (= 0.67.3) 271 | - React-perflogger (= 0.67.3) 272 | - React-jsinspector (0.67.3) 273 | - React-logger (0.67.3): 274 | - glog 275 | - React-perflogger (0.67.3) 276 | - React-RCTActionSheet (0.67.3): 277 | - React-Core/RCTActionSheetHeaders (= 0.67.3) 278 | - React-RCTAnimation (0.67.3): 279 | - FBReactNativeSpec (= 0.67.3) 280 | - RCT-Folly (= 2021.06.28.00-v2) 281 | - RCTTypeSafety (= 0.67.3) 282 | - React-Core/RCTAnimationHeaders (= 0.67.3) 283 | - React-jsi (= 0.67.3) 284 | - ReactCommon/turbomodule/core (= 0.67.3) 285 | - React-RCTBlob (0.67.3): 286 | - FBReactNativeSpec (= 0.67.3) 287 | - RCT-Folly (= 2021.06.28.00-v2) 288 | - React-Core/RCTBlobHeaders (= 0.67.3) 289 | - React-Core/RCTWebSocket (= 0.67.3) 290 | - React-jsi (= 0.67.3) 291 | - React-RCTNetwork (= 0.67.3) 292 | - ReactCommon/turbomodule/core (= 0.67.3) 293 | - React-RCTImage (0.67.3): 294 | - FBReactNativeSpec (= 0.67.3) 295 | - RCT-Folly (= 2021.06.28.00-v2) 296 | - RCTTypeSafety (= 0.67.3) 297 | - React-Core/RCTImageHeaders (= 0.67.3) 298 | - React-jsi (= 0.67.3) 299 | - React-RCTNetwork (= 0.67.3) 300 | - ReactCommon/turbomodule/core (= 0.67.3) 301 | - React-RCTLinking (0.67.3): 302 | - FBReactNativeSpec (= 0.67.3) 303 | - React-Core/RCTLinkingHeaders (= 0.67.3) 304 | - React-jsi (= 0.67.3) 305 | - ReactCommon/turbomodule/core (= 0.67.3) 306 | - React-RCTNetwork (0.67.3): 307 | - FBReactNativeSpec (= 0.67.3) 308 | - RCT-Folly (= 2021.06.28.00-v2) 309 | - RCTTypeSafety (= 0.67.3) 310 | - React-Core/RCTNetworkHeaders (= 0.67.3) 311 | - React-jsi (= 0.67.3) 312 | - ReactCommon/turbomodule/core (= 0.67.3) 313 | - React-RCTSettings (0.67.3): 314 | - FBReactNativeSpec (= 0.67.3) 315 | - RCT-Folly (= 2021.06.28.00-v2) 316 | - RCTTypeSafety (= 0.67.3) 317 | - React-Core/RCTSettingsHeaders (= 0.67.3) 318 | - React-jsi (= 0.67.3) 319 | - ReactCommon/turbomodule/core (= 0.67.3) 320 | - React-RCTText (0.67.3): 321 | - React-Core/RCTTextHeaders (= 0.67.3) 322 | - React-RCTVibration (0.67.3): 323 | - FBReactNativeSpec (= 0.67.3) 324 | - RCT-Folly (= 2021.06.28.00-v2) 325 | - React-Core/RCTVibrationHeaders (= 0.67.3) 326 | - React-jsi (= 0.67.3) 327 | - ReactCommon/turbomodule/core (= 0.67.3) 328 | - React-runtimeexecutor (0.67.3): 329 | - React-jsi (= 0.67.3) 330 | - ReactCommon/turbomodule/core (0.67.3): 331 | - DoubleConversion 332 | - glog 333 | - RCT-Folly (= 2021.06.28.00-v2) 334 | - React-callinvoker (= 0.67.3) 335 | - React-Core (= 0.67.3) 336 | - React-cxxreact (= 0.67.3) 337 | - React-jsi (= 0.67.3) 338 | - React-logger (= 0.67.3) 339 | - React-perflogger (= 0.67.3) 340 | - Yoga (1.14.0) 341 | - YogaKit (1.18.1): 342 | - Yoga (~> 1.14) 343 | 344 | DEPENDENCIES: 345 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 346 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 347 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 348 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 349 | - Flipper (= 0.99.0) 350 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 351 | - Flipper-DoubleConversion (= 3.1.7) 352 | - Flipper-Fmt (= 7.1.7) 353 | - Flipper-Folly (= 2.6.7) 354 | - Flipper-Glog (= 0.3.6) 355 | - Flipper-PeerTalk (= 0.0.4) 356 | - Flipper-RSocket (= 1.4.3) 357 | - FlipperKit (= 0.99.0) 358 | - FlipperKit/Core (= 0.99.0) 359 | - FlipperKit/CppBridge (= 0.99.0) 360 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.99.0) 361 | - FlipperKit/FBDefines (= 0.99.0) 362 | - FlipperKit/FKPortForwarding (= 0.99.0) 363 | - FlipperKit/FlipperKitHighlightOverlay (= 0.99.0) 364 | - FlipperKit/FlipperKitLayoutPlugin (= 0.99.0) 365 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.99.0) 366 | - FlipperKit/FlipperKitNetworkPlugin (= 0.99.0) 367 | - FlipperKit/FlipperKitReactPlugin (= 0.99.0) 368 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.99.0) 369 | - FlipperKit/SKIOSNetworkPlugin (= 0.99.0) 370 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 371 | - OpenSSL-Universal (= 1.1.180) 372 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 373 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 374 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 375 | - React (from `../node_modules/react-native/`) 376 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 377 | - React-Core (from `../node_modules/react-native/`) 378 | - React-Core/DevSupport (from `../node_modules/react-native/`) 379 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 380 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 381 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 382 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 383 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 384 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 385 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 386 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 387 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 388 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 389 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 390 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 391 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 392 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 393 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 394 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 395 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 396 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 397 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 398 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 399 | 400 | SPEC REPOS: 401 | trunk: 402 | - CocoaAsyncSocket 403 | - Flipper 404 | - Flipper-Boost-iOSX 405 | - Flipper-DoubleConversion 406 | - Flipper-Fmt 407 | - Flipper-Folly 408 | - Flipper-Glog 409 | - Flipper-PeerTalk 410 | - Flipper-RSocket 411 | - FlipperKit 412 | - fmt 413 | - libevent 414 | - OpenSSL-Universal 415 | - YogaKit 416 | 417 | EXTERNAL SOURCES: 418 | boost: 419 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 420 | DoubleConversion: 421 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 422 | FBLazyVector: 423 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 424 | FBReactNativeSpec: 425 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 426 | glog: 427 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 428 | RCT-Folly: 429 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 430 | RCTRequired: 431 | :path: "../node_modules/react-native/Libraries/RCTRequired" 432 | RCTTypeSafety: 433 | :path: "../node_modules/react-native/Libraries/TypeSafety" 434 | React: 435 | :path: "../node_modules/react-native/" 436 | React-callinvoker: 437 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 438 | React-Core: 439 | :path: "../node_modules/react-native/" 440 | React-CoreModules: 441 | :path: "../node_modules/react-native/React/CoreModules" 442 | React-cxxreact: 443 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 444 | React-jsi: 445 | :path: "../node_modules/react-native/ReactCommon/jsi" 446 | React-jsiexecutor: 447 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 448 | React-jsinspector: 449 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 450 | React-logger: 451 | :path: "../node_modules/react-native/ReactCommon/logger" 452 | React-perflogger: 453 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 454 | React-RCTActionSheet: 455 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 456 | React-RCTAnimation: 457 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 458 | React-RCTBlob: 459 | :path: "../node_modules/react-native/Libraries/Blob" 460 | React-RCTImage: 461 | :path: "../node_modules/react-native/Libraries/Image" 462 | React-RCTLinking: 463 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 464 | React-RCTNetwork: 465 | :path: "../node_modules/react-native/Libraries/Network" 466 | React-RCTSettings: 467 | :path: "../node_modules/react-native/Libraries/Settings" 468 | React-RCTText: 469 | :path: "../node_modules/react-native/Libraries/Text" 470 | React-RCTVibration: 471 | :path: "../node_modules/react-native/Libraries/Vibration" 472 | React-runtimeexecutor: 473 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 474 | ReactCommon: 475 | :path: "../node_modules/react-native/ReactCommon" 476 | Yoga: 477 | :path: "../node_modules/react-native/ReactCommon/yoga" 478 | 479 | SPEC CHECKSUMS: 480 | boost: a7c83b31436843459a1961bfd74b96033dc77234 481 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 482 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 483 | FBLazyVector: 808f741ddb0896a20e5b98cc665f5b3413b072e2 484 | FBReactNativeSpec: 94473205b8741b61402e8c51716dea34aa3f5b2f 485 | Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733 486 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 487 | Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c 488 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 489 | Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a 490 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 491 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 492 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 493 | FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9 494 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 495 | glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85 496 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 497 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b 498 | RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685 499 | RCTRequired: 3c77b683474faf23920fbefc71c4e13af21470c0 500 | RCTTypeSafety: 720b1841260dac692444c2822b27403178da8b28 501 | React: 25970dd74abbdac449ca66dec4107652cacc606d 502 | React-callinvoker: 2d158700bc27b3d49c3c95721d288ed6c1a489ef 503 | React-Core: 306cfdc1393bcf9481cc5de9807608db7661817b 504 | React-CoreModules: 2576a88d630899f3fcdf2cb79fcc0454d7b2a8bb 505 | React-cxxreact: a492f0de07d875419dcb9f463c63c22fe51c433b 506 | React-jsi: bca092b0c38d5e3fd60bb491d4994ab4a8ac2ad3 507 | React-jsiexecutor: 15ea57ead631a11fad57634ff69f78e797113a39 508 | React-jsinspector: 1e1e03345cf6d47779e2061d679d0a87d9ae73d8 509 | React-logger: 1e10789cb84f99288479ba5f20822ce43ced6ffe 510 | React-perflogger: 93d3f142d6d9a46e635f09ba0518027215a41098 511 | React-RCTActionSheet: 87327c3722203cc79cf79d02fb83e7332aeedd18 512 | React-RCTAnimation: 009c87c018d50e0b38692699405ebe631ff4872d 513 | React-RCTBlob: 9e30308cc1b127af11c8f858514d2d8638ce36d7 514 | React-RCTImage: b9460cb8e3acc51410735a234a9dffbf4964f540 515 | React-RCTLinking: 73ecf0b87b515383a08ebbf07f558c48de1f0027 516 | React-RCTNetwork: 8f63119f2da99a94515ad0e0d0a13f9b3f6fe89d 517 | React-RCTSettings: b827282b1ac2bd98515c0c09f5cbc5062ebd83b0 518 | React-RCTText: 6d09140f514e1f60aff255e0acdf16e3b486ba4c 519 | React-RCTVibration: d0361f15ea978958fab7ffb6960f475b5063d83f 520 | React-runtimeexecutor: af1946623656f9c5fd64ca6f36f3863516193446 521 | ReactCommon: 650e33cde4fb7d36781cd3143f5276da0abb2f96 522 | Yoga: 90dcd029e45d8a7c1ff059e8b3c6612ff409061a 523 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 524 | 525 | PODFILE CHECKSUM: b238204fde808b9d15816fe170aa2c48b884b8b0 526 | 527 | COCOAPODS: 1.11.2 528 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.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 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 15 | B8F4F7CF6553F3BD7F14D28C /* libPods-example-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CBE4CE7329D36069CA087B0A /* libPods-example-exampleTests.a */; }; 16 | F2D80E3364E5192659DB320E /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70B19742E8CE7DDE078C7B70 /* libPods-example.a */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 25 | remoteInfo = example; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 33 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 35 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 39 | 32F06A00884D82D505551AA2 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; 40 | 70B19742E8CE7DDE078C7B70 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = ""; }; 42 | C3BAC700E8434F67DDA0D25A /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; 43 | C6165F2009DA005BC8AC97BD /* Pods-example-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.debug.xcconfig"; sourceTree = ""; }; 44 | CA7F925503E13BAF47E3F620 /* Pods-example-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.release.xcconfig"; sourceTree = ""; }; 45 | CBE4CE7329D36069CA087B0A /* libPods-example-exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | B8F4F7CF6553F3BD7F14D28C /* libPods-example-exampleTests.a in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | F2D80E3364E5192659DB320E /* libPods-example.a in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 00E356EF1AD99517003FC87E /* exampleTests */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 00E356F21AD99517003FC87E /* exampleTests.m */, 73 | 00E356F01AD99517003FC87E /* Supporting Files */, 74 | ); 75 | path = exampleTests; 76 | sourceTree = ""; 77 | }; 78 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 00E356F11AD99517003FC87E /* Info.plist */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 13B07FAE1A68108700A75B9A /* example */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 90 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 91 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 92 | 13B07FB61A68108700A75B9A /* Info.plist */, 93 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 94 | 13B07FB71A68108700A75B9A /* main.m */, 95 | ); 96 | name = example; 97 | sourceTree = ""; 98 | }; 99 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 103 | 70B19742E8CE7DDE078C7B70 /* libPods-example.a */, 104 | CBE4CE7329D36069CA087B0A /* libPods-example-exampleTests.a */, 105 | ); 106 | name = Frameworks; 107 | sourceTree = ""; 108 | }; 109 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | ); 113 | name = Libraries; 114 | sourceTree = ""; 115 | }; 116 | 83CBB9F61A601CBA00E9B192 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 13B07FAE1A68108700A75B9A /* example */, 120 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 121 | 00E356EF1AD99517003FC87E /* exampleTests */, 122 | 83CBBA001A601CBA00E9B192 /* Products */, 123 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 124 | CFC79C11D2245B07CF42192F /* Pods */, 125 | ); 126 | indentWidth = 2; 127 | sourceTree = ""; 128 | tabWidth = 2; 129 | usesTabs = 0; 130 | }; 131 | 83CBBA001A601CBA00E9B192 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 13B07F961A680F5B00A75B9A /* example.app */, 135 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | CFC79C11D2245B07CF42192F /* Pods */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 32F06A00884D82D505551AA2 /* Pods-example.debug.xcconfig */, 144 | C3BAC700E8434F67DDA0D25A /* Pods-example.release.xcconfig */, 145 | C6165F2009DA005BC8AC97BD /* Pods-example-exampleTests.debug.xcconfig */, 146 | CA7F925503E13BAF47E3F620 /* Pods-example-exampleTests.release.xcconfig */, 147 | ); 148 | path = Pods; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 00E356ED1AD99517003FC87E /* exampleTests */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; 157 | buildPhases = ( 158 | A2FED1169D1C831873AE5E8A /* [CP] Check Pods Manifest.lock */, 159 | 00E356EA1AD99517003FC87E /* Sources */, 160 | 00E356EB1AD99517003FC87E /* Frameworks */, 161 | 00E356EC1AD99517003FC87E /* Resources */, 162 | 8067C5FBD651CBE3F22B82C9 /* [CP] Embed Pods Frameworks */, 163 | 8EEDF0F49C5B6DA21EC911BA /* [CP] Copy Pods Resources */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 169 | ); 170 | name = exampleTests; 171 | productName = exampleTests; 172 | productReference = 00E356EE1AD99517003FC87E /* exampleTests.xctest */; 173 | productType = "com.apple.product-type.bundle.unit-test"; 174 | }; 175 | 13B07F861A680F5B00A75B9A /* example */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 178 | buildPhases = ( 179 | F1737ACE5BC5EC9B7CECC7A5 /* [CP] Check Pods Manifest.lock */, 180 | FD10A7F022414F080027D42C /* Start Packager */, 181 | 13B07F871A680F5B00A75B9A /* Sources */, 182 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 183 | 13B07F8E1A680F5B00A75B9A /* Resources */, 184 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 185 | 9B258D90FFFEBAF294A5D103 /* [CP] Embed Pods Frameworks */, 186 | 8DB4B7D4A97FA8D86DE64B60 /* [CP] Copy Pods Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = example; 193 | productName = example; 194 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | /* End PBXNativeTarget section */ 198 | 199 | /* Begin PBXProject section */ 200 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 201 | isa = PBXProject; 202 | attributes = { 203 | LastUpgradeCheck = 1210; 204 | TargetAttributes = { 205 | 00E356ED1AD99517003FC87E = { 206 | CreatedOnToolsVersion = 6.2; 207 | TestTargetID = 13B07F861A680F5B00A75B9A; 208 | }; 209 | 13B07F861A680F5B00A75B9A = { 210 | LastSwiftMigration = 1120; 211 | }; 212 | }; 213 | }; 214 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 215 | compatibilityVersion = "Xcode 12.0"; 216 | developmentRegion = en; 217 | hasScannedForEncodings = 0; 218 | knownRegions = ( 219 | en, 220 | Base, 221 | ); 222 | mainGroup = 83CBB9F61A601CBA00E9B192; 223 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 224 | projectDirPath = ""; 225 | projectRoot = ""; 226 | targets = ( 227 | 13B07F861A680F5B00A75B9A /* example */, 228 | 00E356ED1AD99517003FC87E /* exampleTests */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXResourcesBuildPhase section */ 234 | 00E356EC1AD99517003FC87E /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 246 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXShellScriptBuildPhase section */ 253 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | ); 260 | name = "Bundle React Native code and images"; 261 | outputPaths = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 266 | }; 267 | 8067C5FBD651CBE3F22B82C9 /* [CP] Embed Pods Frameworks */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputFileListPaths = ( 273 | "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 274 | ); 275 | name = "[CP] Embed Pods Frameworks"; 276 | outputFileListPaths = ( 277 | "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | shellPath = /bin/sh; 281 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh\"\n"; 282 | showEnvVarsInLog = 0; 283 | }; 284 | 8DB4B7D4A97FA8D86DE64B60 /* [CP] Copy Pods Resources */ = { 285 | isa = PBXShellScriptBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | inputFileListPaths = ( 290 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", 291 | ); 292 | name = "[CP] Copy Pods Resources"; 293 | outputFileListPaths = ( 294 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | shellPath = /bin/sh; 298 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; 299 | showEnvVarsInLog = 0; 300 | }; 301 | 8EEDF0F49C5B6DA21EC911BA /* [CP] Copy Pods Resources */ = { 302 | isa = PBXShellScriptBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | ); 306 | inputFileListPaths = ( 307 | "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", 308 | ); 309 | name = "[CP] Copy Pods Resources"; 310 | outputFileListPaths = ( 311 | "${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | shellPath = /bin/sh; 315 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh\"\n"; 316 | showEnvVarsInLog = 0; 317 | }; 318 | 9B258D90FFFEBAF294A5D103 /* [CP] Embed Pods Frameworks */ = { 319 | isa = PBXShellScriptBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | ); 323 | inputFileListPaths = ( 324 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 325 | ); 326 | name = "[CP] Embed Pods Frameworks"; 327 | outputFileListPaths = ( 328 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | shellPath = /bin/sh; 332 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; 333 | showEnvVarsInLog = 0; 334 | }; 335 | A2FED1169D1C831873AE5E8A /* [CP] Check Pods Manifest.lock */ = { 336 | isa = PBXShellScriptBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | ); 340 | inputFileListPaths = ( 341 | ); 342 | inputPaths = ( 343 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 344 | "${PODS_ROOT}/Manifest.lock", 345 | ); 346 | name = "[CP] Check Pods Manifest.lock"; 347 | outputFileListPaths = ( 348 | ); 349 | outputPaths = ( 350 | "$(DERIVED_FILE_DIR)/Pods-example-exampleTests-checkManifestLockResult.txt", 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | shellPath = /bin/sh; 354 | 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"; 355 | showEnvVarsInLog = 0; 356 | }; 357 | F1737ACE5BC5EC9B7CECC7A5 /* [CP] Check Pods Manifest.lock */ = { 358 | isa = PBXShellScriptBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | ); 362 | inputFileListPaths = ( 363 | ); 364 | inputPaths = ( 365 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 366 | "${PODS_ROOT}/Manifest.lock", 367 | ); 368 | name = "[CP] Check Pods Manifest.lock"; 369 | outputFileListPaths = ( 370 | ); 371 | outputPaths = ( 372 | "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", 373 | ); 374 | runOnlyForDeploymentPostprocessing = 0; 375 | shellPath = /bin/sh; 376 | 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"; 377 | showEnvVarsInLog = 0; 378 | }; 379 | FD10A7F022414F080027D42C /* Start Packager */ = { 380 | isa = PBXShellScriptBuildPhase; 381 | buildActionMask = 2147483647; 382 | files = ( 383 | ); 384 | inputFileListPaths = ( 385 | ); 386 | inputPaths = ( 387 | ); 388 | name = "Start Packager"; 389 | outputFileListPaths = ( 390 | ); 391 | outputPaths = ( 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | shellPath = /bin/sh; 395 | 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"; 396 | showEnvVarsInLog = 0; 397 | }; 398 | /* End PBXShellScriptBuildPhase section */ 399 | 400 | /* Begin PBXSourcesBuildPhase section */ 401 | 00E356EA1AD99517003FC87E /* Sources */ = { 402 | isa = PBXSourcesBuildPhase; 403 | buildActionMask = 2147483647; 404 | files = ( 405 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */, 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | }; 409 | 13B07F871A680F5B00A75B9A /* Sources */ = { 410 | isa = PBXSourcesBuildPhase; 411 | buildActionMask = 2147483647; 412 | files = ( 413 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 414 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 415 | ); 416 | runOnlyForDeploymentPostprocessing = 0; 417 | }; 418 | /* End PBXSourcesBuildPhase section */ 419 | 420 | /* Begin PBXTargetDependency section */ 421 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 422 | isa = PBXTargetDependency; 423 | target = 13B07F861A680F5B00A75B9A /* example */; 424 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 425 | }; 426 | /* End PBXTargetDependency section */ 427 | 428 | /* Begin XCBuildConfiguration section */ 429 | 00E356F61AD99517003FC87E /* Debug */ = { 430 | isa = XCBuildConfiguration; 431 | baseConfigurationReference = C6165F2009DA005BC8AC97BD /* Pods-example-exampleTests.debug.xcconfig */; 432 | buildSettings = { 433 | BUNDLE_LOADER = "$(TEST_HOST)"; 434 | GCC_PREPROCESSOR_DEFINITIONS = ( 435 | "DEBUG=1", 436 | "$(inherited)", 437 | ); 438 | INFOPLIST_FILE = exampleTests/Info.plist; 439 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 440 | LD_RUNPATH_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "@executable_path/Frameworks", 443 | "@loader_path/Frameworks", 444 | ); 445 | OTHER_LDFLAGS = ( 446 | "-ObjC", 447 | "-lc++", 448 | "$(inherited)", 449 | ); 450 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 453 | }; 454 | name = Debug; 455 | }; 456 | 00E356F71AD99517003FC87E /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = CA7F925503E13BAF47E3F620 /* Pods-example-exampleTests.release.xcconfig */; 459 | buildSettings = { 460 | BUNDLE_LOADER = "$(TEST_HOST)"; 461 | COPY_PHASE_STRIP = NO; 462 | INFOPLIST_FILE = exampleTests/Info.plist; 463 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 464 | LD_RUNPATH_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "@executable_path/Frameworks", 467 | "@loader_path/Frameworks", 468 | ); 469 | OTHER_LDFLAGS = ( 470 | "-ObjC", 471 | "-lc++", 472 | "$(inherited)", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 477 | }; 478 | name = Release; 479 | }; 480 | 13B07F941A680F5B00A75B9A /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | baseConfigurationReference = 32F06A00884D82D505551AA2 /* Pods-example.debug.xcconfig */; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | CLANG_ENABLE_MODULES = YES; 486 | CURRENT_PROJECT_VERSION = 1; 487 | DEVELOPMENT_TEAM = 8HPN4GAMVR; 488 | ENABLE_BITCODE = NO; 489 | INFOPLIST_FILE = example/Info.plist; 490 | LD_RUNPATH_SEARCH_PATHS = ( 491 | "$(inherited)", 492 | "@executable_path/Frameworks", 493 | ); 494 | OTHER_LDFLAGS = ( 495 | "$(inherited)", 496 | "-ObjC", 497 | "-lc++", 498 | ); 499 | PRODUCT_BUNDLE_IDENTIFIER = "dev.itodorova.react-native-intl-phone-field-example"; 500 | PRODUCT_NAME = example; 501 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 502 | SWIFT_VERSION = 5.0; 503 | VERSIONING_SYSTEM = "apple-generic"; 504 | }; 505 | name = Debug; 506 | }; 507 | 13B07F951A680F5B00A75B9A /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | baseConfigurationReference = C3BAC700E8434F67DDA0D25A /* Pods-example.release.xcconfig */; 510 | buildSettings = { 511 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 512 | CLANG_ENABLE_MODULES = YES; 513 | CURRENT_PROJECT_VERSION = 1; 514 | DEVELOPMENT_TEAM = 8HPN4GAMVR; 515 | INFOPLIST_FILE = example/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = ( 517 | "$(inherited)", 518 | "@executable_path/Frameworks", 519 | ); 520 | OTHER_LDFLAGS = ( 521 | "$(inherited)", 522 | "-ObjC", 523 | "-lc++", 524 | ); 525 | PRODUCT_BUNDLE_IDENTIFIER = "dev.itodorova.react-native-intl-phone-field-example"; 526 | PRODUCT_NAME = example; 527 | SWIFT_VERSION = 5.0; 528 | VERSIONING_SYSTEM = "apple-generic"; 529 | }; 530 | name = Release; 531 | }; 532 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | ALWAYS_SEARCH_USER_PATHS = NO; 536 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 537 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 538 | CLANG_CXX_LIBRARY = "libc++"; 539 | CLANG_ENABLE_MODULES = YES; 540 | CLANG_ENABLE_OBJC_ARC = YES; 541 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 542 | CLANG_WARN_BOOL_CONVERSION = YES; 543 | CLANG_WARN_COMMA = YES; 544 | CLANG_WARN_CONSTANT_CONVERSION = YES; 545 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 546 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 547 | CLANG_WARN_EMPTY_BODY = YES; 548 | CLANG_WARN_ENUM_CONVERSION = YES; 549 | CLANG_WARN_INFINITE_RECURSION = YES; 550 | CLANG_WARN_INT_CONVERSION = YES; 551 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 552 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 553 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 554 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 555 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 556 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 557 | CLANG_WARN_STRICT_PROTOTYPES = YES; 558 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 559 | CLANG_WARN_UNREACHABLE_CODE = YES; 560 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 561 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 562 | COPY_PHASE_STRIP = NO; 563 | ENABLE_STRICT_OBJC_MSGSEND = YES; 564 | ENABLE_TESTABILITY = YES; 565 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 566 | GCC_C_LANGUAGE_STANDARD = gnu99; 567 | GCC_DYNAMIC_NO_PIC = NO; 568 | GCC_NO_COMMON_BLOCKS = YES; 569 | GCC_OPTIMIZATION_LEVEL = 0; 570 | GCC_PREPROCESSOR_DEFINITIONS = ( 571 | "DEBUG=1", 572 | "$(inherited)", 573 | ); 574 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 575 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 576 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 577 | GCC_WARN_UNDECLARED_SELECTOR = YES; 578 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 579 | GCC_WARN_UNUSED_FUNCTION = YES; 580 | GCC_WARN_UNUSED_VARIABLE = YES; 581 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 582 | LD_RUNPATH_SEARCH_PATHS = ( 583 | /usr/lib/swift, 584 | "$(inherited)", 585 | ); 586 | LIBRARY_SEARCH_PATHS = ( 587 | "\"$(SDKROOT)/usr/lib/swift\"", 588 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 589 | "\"$(inherited)\"", 590 | ); 591 | MTL_ENABLE_DEBUG_INFO = YES; 592 | ONLY_ACTIVE_ARCH = YES; 593 | SDKROOT = iphoneos; 594 | }; 595 | name = Debug; 596 | }; 597 | 83CBBA211A601CBA00E9B192 /* Release */ = { 598 | isa = XCBuildConfiguration; 599 | buildSettings = { 600 | ALWAYS_SEARCH_USER_PATHS = NO; 601 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 602 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 603 | CLANG_CXX_LIBRARY = "libc++"; 604 | CLANG_ENABLE_MODULES = YES; 605 | CLANG_ENABLE_OBJC_ARC = YES; 606 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 607 | CLANG_WARN_BOOL_CONVERSION = YES; 608 | CLANG_WARN_COMMA = YES; 609 | CLANG_WARN_CONSTANT_CONVERSION = YES; 610 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 611 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 612 | CLANG_WARN_EMPTY_BODY = YES; 613 | CLANG_WARN_ENUM_CONVERSION = YES; 614 | CLANG_WARN_INFINITE_RECURSION = YES; 615 | CLANG_WARN_INT_CONVERSION = YES; 616 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 617 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 618 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 619 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 620 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 621 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 622 | CLANG_WARN_STRICT_PROTOTYPES = YES; 623 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 624 | CLANG_WARN_UNREACHABLE_CODE = YES; 625 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 626 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 627 | COPY_PHASE_STRIP = YES; 628 | ENABLE_NS_ASSERTIONS = NO; 629 | ENABLE_STRICT_OBJC_MSGSEND = YES; 630 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 631 | GCC_C_LANGUAGE_STANDARD = gnu99; 632 | GCC_NO_COMMON_BLOCKS = YES; 633 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 634 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 635 | GCC_WARN_UNDECLARED_SELECTOR = YES; 636 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 637 | GCC_WARN_UNUSED_FUNCTION = YES; 638 | GCC_WARN_UNUSED_VARIABLE = YES; 639 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 640 | LD_RUNPATH_SEARCH_PATHS = ( 641 | /usr/lib/swift, 642 | "$(inherited)", 643 | ); 644 | LIBRARY_SEARCH_PATHS = ( 645 | "\"$(SDKROOT)/usr/lib/swift\"", 646 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 647 | "\"$(inherited)\"", 648 | ); 649 | MTL_ENABLE_DEBUG_INFO = NO; 650 | SDKROOT = iphoneos; 651 | VALIDATE_PRODUCT = YES; 652 | }; 653 | name = Release; 654 | }; 655 | /* End XCBuildConfiguration section */ 656 | 657 | /* Begin XCConfigurationList section */ 658 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */ = { 659 | isa = XCConfigurationList; 660 | buildConfigurations = ( 661 | 00E356F61AD99517003FC87E /* Debug */, 662 | 00E356F71AD99517003FC87E /* Release */, 663 | ); 664 | defaultConfigurationIsVisible = 0; 665 | defaultConfigurationName = Release; 666 | }; 667 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 668 | isa = XCConfigurationList; 669 | buildConfigurations = ( 670 | 13B07F941A680F5B00A75B9A /* Debug */, 671 | 13B07F951A680F5B00A75B9A /* Release */, 672 | ); 673 | defaultConfigurationIsVisible = 0; 674 | defaultConfigurationName = Release; 675 | }; 676 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 677 | isa = XCConfigurationList; 678 | buildConfigurations = ( 679 | 83CBBA201A601CBA00E9B192 /* Debug */, 680 | 83CBBA211A601CBA00E9B192 /* Release */, 681 | ); 682 | defaultConfigurationIsVisible = 0; 683 | defaultConfigurationName = Release; 684 | }; 685 | /* End XCConfigurationList section */ 686 | }; 687 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 688 | } 689 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"example" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/ios/example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface exampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation exampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /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 => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`), 22 | ), 23 | ), 24 | 25 | extraNodeModules: modules.reduce((acc, name) => { 26 | acc[name] = path.join(__dirname, 'node_modules', name); 27 | return acc; 28 | }, {}), 29 | }, 30 | 31 | transformer: { 32 | getTransformOptions: async () => ({ 33 | transform: { 34 | experimentalImportSupport: false, 35 | inlineRequires: true, 36 | }, 37 | }), 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "react": "17.0.2", 14 | "react-native": "0.67.3" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.12.9", 18 | "@babel/runtime": "^7.12.5", 19 | "@react-native-community/eslint-config": "^2.0.0", 20 | "babel-jest": "^26.6.3", 21 | "eslint": "7.14.0", 22 | "jest": "^26.6.3", 23 | "metro-react-native-babel-preset": "^0.66.2", 24 | "react-test-renderer": "17.0.2" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fakeheal/react-native-intl-phone-field/6bdbfb0f8d895d6e94dc1afb4eae2181be582205/ios.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-intl-phone-field", 3 | "version": "0.3.0", 4 | "description": "React Native input for validating international phone numbers.", 5 | "main": "lib/commonjs/index", 6 | "module": "lib/module/index", 7 | "types": "lib/typescript/index.d.ts", 8 | "react-native": "src/index", 9 | "source": "src/index", 10 | "files": [ 11 | "src", 12 | "lib", 13 | "android", 14 | "ios", 15 | "cpp", 16 | "react-native-intl-phone-field.podspec", 17 | "!lib/typescript/example", 18 | "!android/build", 19 | "!ios/build", 20 | "!**/__tests__", 21 | "!**/__fixtures__", 22 | "!**/__mocks__" 23 | ], 24 | "scripts": { 25 | "test": "jest", 26 | "typescript": "tsc --noEmit", 27 | "lint": "eslint \"**/*.{js,ts,tsx}\"", 28 | "prepare": "bob build", 29 | "release": "release-it", 30 | "example": "yarn --cwd example", 31 | "pods": "cd example && pod-install --quiet", 32 | "bootstrap": "yarn example && yarn && yarn pods" 33 | }, 34 | "keywords": [ 35 | "react-native", 36 | "ios", 37 | "android" 38 | ], 39 | "repository": "https://github.com/fakeheal/react-native-intl-phone-field", 40 | "author": "Ivanka Todorova (https://github.com/fakeheal)", 41 | "license": "MIT", 42 | "bugs": { 43 | "url": "https://github.com/fakeheal/react-native-intl-phone-field/issues" 44 | }, 45 | "homepage": "https://github.com/fakeheal/react-native-intl-phone-field#readme", 46 | "publishConfig": { 47 | "registry": "https://registry.npmjs.org/" 48 | }, 49 | "devDependencies": { 50 | "@commitlint/config-conventional": "^11.0.0", 51 | "@react-native-community/eslint-config": "^2.0.0", 52 | "@release-it/conventional-changelog": "^2.0.0", 53 | "@types/jest": "^26.0.0", 54 | "@types/react": "^16.9.19", 55 | "@types/react-native": "0.62.13", 56 | "commitlint": "^11.0.0", 57 | "eslint": "^7.2.0", 58 | "eslint-config-prettier": "^7.0.0", 59 | "eslint-plugin-prettier": "^3.1.3", 60 | "husky": "^6.0.0", 61 | "jest": "^26.0.1", 62 | "pod-install": "^0.1.0", 63 | "prettier": "^2.0.5", 64 | "react": "16.13.1", 65 | "react-native": "0.63.4", 66 | "react-native-builder-bob": "^0.18.0", 67 | "release-it": "^14.2.2", 68 | "typescript": "^4.1.3" 69 | }, 70 | "peerDependencies": { 71 | "react": "*", 72 | "react-native": "*" 73 | }, 74 | "jest": { 75 | "preset": "react-native", 76 | "modulePathIgnorePatterns": [ 77 | "/example/node_modules", 78 | "/lib/" 79 | ] 80 | }, 81 | "commitlint": { 82 | "extends": [ 83 | "@commitlint/config-conventional" 84 | ] 85 | }, 86 | "release-it": { 87 | "git": { 88 | "commitMessage": "chore: release ${version}", 89 | "tagName": "v${version}" 90 | }, 91 | "npm": { 92 | "publish": true 93 | }, 94 | "github": { 95 | "release": true 96 | }, 97 | "plugins": { 98 | "@release-it/conventional-changelog": { 99 | "preset": "angular" 100 | } 101 | } 102 | }, 103 | "eslintConfig": { 104 | "root": true, 105 | "extends": [ 106 | "@react-native-community", 107 | "prettier" 108 | ], 109 | "rules": { 110 | "prettier/prettier": [ 111 | "error", 112 | { 113 | "quoteProps": "consistent", 114 | "singleQuote": true, 115 | "tabWidth": 2, 116 | "trailingComma": "es5", 117 | "useTabs": false 118 | } 119 | ] 120 | } 121 | }, 122 | "eslintIgnore": [ 123 | "node_modules/", 124 | "lib/" 125 | ], 126 | "prettier": { 127 | "quoteProps": "consistent", 128 | "singleQuote": true, 129 | "tabWidth": 2, 130 | "trailingComma": "es5", 131 | "useTabs": false 132 | }, 133 | "react-native-builder-bob": { 134 | "source": "src", 135 | "output": "lib", 136 | "targets": [ 137 | "commonjs", 138 | "module", 139 | [ 140 | "typescript", 141 | { 142 | "project": "tsconfig.build.json" 143 | } 144 | ] 145 | ] 146 | }, 147 | "dependencies": { 148 | "countries-list": "^2.6.1", 149 | "libphonenumber-js": "^1.9.49" 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /scripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | const os = require('os'); 2 | const path = require('path'); 3 | const child_process = require('child_process'); 4 | 5 | const root = path.resolve(__dirname, '..'); 6 | const args = process.argv.slice(2); 7 | const options = { 8 | cwd: process.cwd(), 9 | env: process.env, 10 | stdio: 'inherit', 11 | encoding: 'utf-8', 12 | }; 13 | 14 | if (os.type() === 'Windows_NT') { 15 | options.shell = true 16 | } 17 | 18 | let result; 19 | 20 | if (process.cwd() !== root || args.length) { 21 | // We're not in the root of the project, or additional arguments were passed 22 | // In this case, forward the command to `yarn` 23 | result = child_process.spawnSync('yarn', args, options); 24 | } else { 25 | // If `yarn` is run without arguments, perform bootstrap 26 | result = child_process.spawnSync('yarn', ['bootstrap'], options); 27 | } 28 | 29 | process.exitCode = result.status; 30 | -------------------------------------------------------------------------------- /src/__tests__/index.test.tsx: -------------------------------------------------------------------------------- 1 | it.todo('write a test'); 2 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import { Platform, StyleSheet, Text, TextInput, View } from 'react-native'; 3 | import { 4 | CountryCode, 5 | parsePhoneNumberWithError, 6 | PhoneNumber, 7 | } from 'libphonenumber-js'; 8 | import { getEmojiFlag } from 'countries-list'; 9 | 10 | const INTL_SYMBOL = '+'; 11 | 12 | export type IntlPhoneFieldProps = { 13 | flagUndetermined?: string; 14 | defaultCountry?: CountryCode; 15 | defaultPrefix?: string; 16 | defaultValue?: string; 17 | defaultFlag?: string; 18 | onEndEditing?: Function; 19 | onValidation?: Function; 20 | onValueUpdate?: Function; 21 | containerStyle?: object; 22 | flagContainerStyle?: object; 23 | flagTextStyle?: object; 24 | textInputStyle?: object; 25 | textInputProps?: object; 26 | }; 27 | 28 | let resolveFlagTimeoutId: NodeJS.Timeout; 29 | 30 | export default function IntlPhoneField({ 31 | flagUndetermined = '❓', 32 | onEndEditing, 33 | onValidation, 34 | onValueUpdate, 35 | defaultCountry, 36 | defaultPrefix, 37 | defaultValue, 38 | defaultFlag, 39 | containerStyle, 40 | flagContainerStyle, 41 | flagTextStyle, 42 | textInputStyle, 43 | textInputProps, 44 | }: IntlPhoneFieldProps) { 45 | const [flag, setFlag] = useState(defaultFlag ?? flagUndetermined); 46 | 47 | const [value, setValue] = useState( 48 | defaultValue ? defaultValue : defaultPrefix ?? '' 49 | ); 50 | const [formatted, setFormatted] = useState(defaultFlag ?? ''); 51 | 52 | const [parsedNumber, setParsedNumber] = useState(null); 53 | const [isValid, setIsValid] = useState(false); 54 | const [countryCode, setCountryCode] = useState(); 55 | 56 | const onChangeText = (text: string) => { 57 | setValue(`${INTL_SYMBOL}${text.split(INTL_SYMBOL).join('')}`); 58 | }; 59 | 60 | useEffect(() => { 61 | try { 62 | setParsedNumber(parsePhoneNumberWithError(value, defaultCountry)); 63 | } catch (e) { 64 | setParsedNumber(null); 65 | } 66 | }, [value, defaultCountry]); 67 | 68 | useEffect(() => { 69 | if (parsedNumber?.isValid()) { 70 | setIsValid(true); 71 | } else { 72 | setIsValid(false); 73 | } 74 | }, [parsedNumber]); 75 | 76 | useEffect(() => { 77 | if (isValid) { 78 | setCountryCode(parsedNumber?.country); 79 | } else { 80 | setCountryCode(undefined); 81 | } 82 | }, [parsedNumber, isValid]); 83 | 84 | useEffect(() => { 85 | if (resolveFlagTimeoutId) { 86 | clearTimeout(resolveFlagTimeoutId); 87 | } 88 | resolveFlagTimeoutId = setTimeout(() => { 89 | if (countryCode) { 90 | setFlag(getEmojiFlag(countryCode)); 91 | } else if (value === defaultPrefix && defaultFlag) { 92 | setFlag(defaultFlag); 93 | } else { 94 | setFlag(flagUndetermined); 95 | } 96 | }, 150); 97 | 98 | return () => clearTimeout(resolveFlagTimeoutId); 99 | }, [countryCode, flagUndetermined, defaultFlag, value, defaultPrefix]); 100 | 101 | useEffect(() => { 102 | if (isValid) { 103 | setFormatted(parsedNumber?.formatInternational() ?? value); 104 | } else { 105 | setFormatted(value); 106 | } 107 | }, [isValid, parsedNumber, value]); 108 | 109 | useEffect(() => { 110 | onValidation && onValidation(isValid); 111 | }, [onValidation, isValid]); 112 | 113 | useEffect(() => { 114 | onValueUpdate && onValueUpdate(value); 115 | }, [value]); 116 | 117 | return ( 118 | 119 | 120 | {flag} 121 | 122 | { 128 | if (onEndEditing && Platform.OS !== 'web') { 129 | onEndEditing({ isValid, countryCode, value, formatted, flag }); 130 | } 131 | }} 132 | onBlur={() => { 133 | if (onEndEditing && Platform.OS === 'web') { 134 | onEndEditing({ isValid, countryCode, value, formatted, flag }); 135 | } 136 | }} 137 | returnKeyType="done" 138 | {...textInputProps} 139 | /> 140 | 141 | ); 142 | } 143 | 144 | const styles = StyleSheet.create({ 145 | container: { 146 | flexDirection: 'row', 147 | alignItems: 'center', 148 | borderBottomWidth: 1, 149 | }, 150 | input: { 151 | flex: 1, 152 | flexGrow: 1, 153 | flexShrink: 1, 154 | paddingVertical: 10, 155 | }, 156 | flag: { 157 | marginRight: 5, 158 | }, 159 | flagText: { 160 | fontSize: 24, 161 | }, 162 | }); 163 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "extends": "./tsconfig", 4 | "exclude": ["example"] 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "paths": { 5 | "react-native-intl-phone-field": ["./src/index"] 6 | }, 7 | "allowUnreachableCode": false, 8 | "allowUnusedLabels": false, 9 | "esModuleInterop": true, 10 | "importsNotUsedAsValues": "error", 11 | "forceConsistentCasingInFileNames": true, 12 | "jsx": "react", 13 | "lib": ["esnext"], 14 | "module": "esnext", 15 | "moduleResolution": "node", 16 | "noFallthroughCasesInSwitch": true, 17 | "noImplicitReturns": true, 18 | "noImplicitUseStrict": false, 19 | "noStrictGenericChecks": false, 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "resolveJsonModule": true, 23 | "skipLibCheck": true, 24 | "strict": true, 25 | "target": "esnext" 26 | } 27 | } 28 | --------------------------------------------------------------------------------