├── .circleci
└── config.yml
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .yarnrc
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── babel.config.js
├── clipboard-toast-icon.png
├── example
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── reactnativeclipboardtoast
│ │ │ │ └── ReactNativeFlipper.java
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── reactnativeclipboardtoast
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── babel.config.js
├── index.tsx
├── ios
│ ├── ClipboardToastExample-Bridging-Header.h
│ ├── ClipboardToastExample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── ClipboardToastExample.xcscheme
│ ├── ClipboardToastExample.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── ClipboardToastExample
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── main.m
│ ├── File.swift
│ ├── Podfile
│ └── Podfile.lock
├── metro.config.js
├── package.json
├── src
│ ├── App.tsx
│ ├── clipboard-toast-icon.png
│ └── svgIcon.ts
└── yarn.lock
├── package.json
├── scripts
└── bootstrap.js
├── src
├── __tests__
│ └── index.test.tsx
├── clipboard-toast.tsx
└── index.ts
├── tsconfig.build.json
├── tsconfig.json
└── yarn.lock
/.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
--------------------------------------------------------------------------------
/.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 | .idea
35 | .gradle
36 | local.properties
37 | android.iml
38 |
39 | # Cocoapods
40 | #
41 | example/ios/Pods
42 |
43 | # node.js
44 | #
45 | node_modules/
46 | npm-debug.log
47 | yarn-debug.log
48 | yarn-error.log
49 |
50 | # BUCK
51 | buck-out/
52 | \.buckd/
53 | android/app/libs
54 | android/keystores/debug.keystore
55 |
56 | # Expo
57 | .expo/*
58 |
59 | # generated by bob
60 | lib/
61 |
--------------------------------------------------------------------------------
/.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 developing, you can run the [example app](/example/) to test your changes.
14 |
15 | To start the packager:
16 |
17 | ```sh
18 | yarn example start
19 | ```
20 |
21 | To run the example app on Android:
22 |
23 | ```sh
24 | yarn example android
25 | ```
26 |
27 | To run the example app on iOS:
28 |
29 | ```sh
30 | yarn example ios
31 | ```
32 |
33 | Make sure your code passes TypeScript and ESLint. Run the following to verify:
34 |
35 | ```sh
36 | yarn typescript
37 | yarn lint
38 | ```
39 |
40 | To fix formatting errors, run the following:
41 |
42 | ```sh
43 | yarn lint --fix
44 | ```
45 |
46 | Remember to add tests for your change if possible. Run the unit tests by:
47 |
48 | ```sh
49 | yarn test
50 | ```
51 |
52 | To edit the Objective-C files, open `example/ios/ClipboardToastExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-clipboard-toast`.
53 |
54 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativeclipboardtoast` under `Android`.
55 |
56 | ### Commit message convention
57 |
58 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
59 |
60 | - `fix`: bug fixes, e.g. fix crash due to deprecated method.
61 | - `feat`: new features, e.g. add new method to the module.
62 | - `refactor`: code refactor, e.g. migrate from class components to hooks.
63 | - `docs`: changes into documentation, e.g. add usage example for the module..
64 | - `test`: adding or updating tests, e.g. add integration tests using detox.
65 | - `chore`: tooling changes, e.g. change CI config.
66 |
67 | Our pre-commit hooks verify that your commit message matches this format when committing.
68 |
69 | ### Linting and tests
70 |
71 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
72 |
73 | 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.
74 |
75 | Our pre-commit hooks verify that the linter and tests pass when committing.
76 |
77 | ### Scripts
78 |
79 | The `package.json` file contains various scripts for common tasks:
80 |
81 | - `yarn bootstrap`: setup project by installing all dependencies and pods.
82 | - `yarn typescript`: type-check files with TypeScript.
83 | - `yarn lint`: lint files with ESLint.
84 | - `yarn test`: run unit tests with Jest.
85 | - `yarn example start`: start the Metro server for the example app.
86 | - `yarn example android`: run the example app on Android.
87 | - `yarn example ios`: run the example app on iOS.
88 |
89 | ### Sending a pull request
90 |
91 | > **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://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
92 |
93 | When you're sending a pull request:
94 |
95 | - Prefer small pull requests focused on one change.
96 | - Verify that linters and tests are passing.
97 | - Review the documentation to make sure it looks good.
98 | - Follow the pull request template when opening a pull request.
99 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
100 |
101 | ## Code of Conduct
102 |
103 | ### Our Pledge
104 |
105 | 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.
106 |
107 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
108 |
109 | ### Our Standards
110 |
111 | Examples of behavior that contributes to a positive environment for our community include:
112 |
113 | - Demonstrating empathy and kindness toward other people
114 | - Being respectful of differing opinions, viewpoints, and experiences
115 | - Giving and gracefully accepting constructive feedback
116 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
117 | - Focusing on what is best not just for us as individuals, but for the overall community
118 |
119 | Examples of unacceptable behavior include:
120 |
121 | - The use of sexualized language or imagery, and sexual attention or
122 | advances of any kind
123 | - Trolling, insulting or derogatory comments, and personal or political attacks
124 | - Public or private harassment
125 | - Publishing others' private information, such as a physical or email
126 | address, without their explicit permission
127 | - Other conduct which could reasonably be considered inappropriate in a
128 | professional setting
129 |
130 | ### Enforcement Responsibilities
131 |
132 | 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.
133 |
134 | 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.
135 |
136 | ### Scope
137 |
138 | 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.
139 |
140 | ### Enforcement
141 |
142 | 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.
143 |
144 | All community leaders are obligated to respect the privacy and security of the reporter of any incident.
145 |
146 | ### Enforcement Guidelines
147 |
148 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
149 |
150 | #### 1. Correction
151 |
152 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
153 |
154 | **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.
155 |
156 | #### 2. Warning
157 |
158 | **Community Impact**: A violation through a single incident or series of actions.
159 |
160 | **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.
161 |
162 | #### 3. Temporary Ban
163 |
164 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
165 |
166 | **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.
167 |
168 | #### 4. Permanent Ban
169 |
170 | **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.
171 |
172 | **Consequence**: A permanent ban from any sort of public interaction within the community.
173 |
174 | ### Attribution
175 |
176 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
177 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
178 |
179 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
180 |
181 | [homepage]: https://www.contributor-covenant.org
182 |
183 | For answers to common questions about this code of conduct, see the FAQ at
184 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
185 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 idan levi
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 |
{console.log('Is Copied')}}
47 | />
48 | ```
49 |
50 | ---
51 |
52 | ## Reference
53 |
54 | ### Props
55 |
56 | Name | Default | Type | Description
57 | --------------------|--------------------------|----------|---------------------------
58 | textToShow | null | String | The text that will show (clickabily)
59 | textToCopy | null | String | The text that will be copied to the clipboard
60 | toastText | 'Text is copied' | String | The text that will show on the toast
61 | containerStyle | null | | Style | Container style
62 | textStyle | null | | Style | Text style
63 | id | 'someKey' | Number/String | Key of element
64 | accessibilityLabel | null | String | Accessibility label text
65 | toastDuration | 750 | Number | The duration of the toast. (milliseconds)
66 | toastPosition | 'bottom' | string | The position of toast showing on screen (there are 3 options - 'bottom, 'center' and 'top')
67 | toastDelay | 0 | Number | The delay duration before toast start showing on screen.
68 | toastAnimation | true | Bool | Should preform an animation on toast showing or disappearing.
69 | toastHideOnPress | true | Bool | Should hide toast that showing by pressing on the toast.
70 | toastBackgroundColor | null | String | The background color of the toast.
71 | toastTextColor | null | String | The text color of the toast.
72 | toastOnShow | null | Function | Callback for toast\`s appear animation start
73 |
74 |
75 | ## License
76 |
77 | This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/idanlevi1/react-native-clipboard-toast/blob/master/LICENSE) file for details
78 |
79 | ## Author
80 |
81 | Made by [Idanlevi1](https://github.com/idanlevi1).
82 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/clipboard-toast-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/clipboard-toast-icon.png
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://reactnative.dev/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for ClipboardToastExample: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for ClipboardToastExample, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | enableHermes: false, // clean and rebuild if changing
80 | entryFile: "index.tsx",
81 | ]
82 |
83 | apply from: "../../node_modules/react-native/react.gradle"
84 |
85 | /**
86 | * Set this to true to create two separate APKs instead of one:
87 | * - An APK that only works on ARM devices
88 | * - An APK that only works on x86 devices
89 | * The advantage is the size of the APK is reduced by about 4MB.
90 | * Upload all the APKs to the Play Store and people will download
91 | * the correct one based on the CPU architecture of their device.
92 | */
93 | def enableSeparateBuildPerCPUArchitecture = false
94 |
95 | /**
96 | * Run Proguard to shrink the Java bytecode in release builds.
97 | */
98 | def enableProguardInReleaseBuilds = false
99 |
100 | /**
101 | * The preferred build flavor of JavaScriptCore.
102 | *
103 | * For ClipboardToastExample, to use the international variant, you can use:
104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105 | *
106 | * The international variant includes ICU i18n library and necessary data
107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108 | * give correct results when using with locales other than en-US. Note that
109 | * this variant is about 6MiB larger per architecture than default.
110 | */
111 | def jscFlavor = 'org.webkit:android-jsc:+'
112 |
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "com.example.reactnativeclipboardtoast"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1
135 | versionName "1.0"
136 | }
137 | splits {
138 | abi {
139 | reset()
140 | enable enableSeparateBuildPerCPUArchitecture
141 | universalApk false // If true, also generate a universal APK
142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
143 | }
144 | }
145 | signingConfigs {
146 | debug {
147 | storeFile file('debug.keystore')
148 | storePassword 'android'
149 | keyAlias 'androiddebugkey'
150 | keyPassword 'android'
151 | }
152 | }
153 | buildTypes {
154 | debug {
155 | signingConfig signingConfigs.debug
156 | }
157 | release {
158 | // Caution! In production, you need to generate your own keystore file.
159 | // see https://reactnative.dev/docs/signed-apk-android.
160 | signingConfig signingConfigs.debug
161 | minifyEnabled enableProguardInReleaseBuilds
162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
163 | }
164 | }
165 | // applicationVariants are e.g. debug, release
166 | applicationVariants.all { variant ->
167 | variant.outputs.each { output ->
168 | // For each separate APK per architecture, set a unique version code as described here:
169 | // https://developer.android.com/studio/build/configure-apk-splits.html
170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
171 | def abi = output.getFilter(OutputFile.ABI)
172 | if (abi != null) { // null for the universal-debug, universal-release variants
173 | output.versionCodeOverride =
174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
175 | }
176 |
177 | }
178 | }
179 | }
180 |
181 | dependencies {
182 | implementation fileTree(dir: "libs", include: ["*.jar"])
183 | //noinspection GradleDynamicVersion
184 | implementation "com.facebook.react:react-native:+" // From node_modules
185 |
186 |
187 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
188 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
189 | exclude group:'com.facebook.fbjni'
190 | }
191 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
192 | exclude group:'com.facebook.flipper'
193 | exclude group:'com.squareup.okhttp3', module:'okhttp'
194 | }
195 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
196 | exclude group:'com.facebook.flipper'
197 | }
198 |
199 | if (enableHermes) {
200 | def hermesPath = "../../node_modules/hermes-engine/android/";
201 | debugImplementation files(hermesPath + "hermes-debug.aar")
202 | releaseImplementation files(hermesPath + "hermes-release.aar")
203 | } else {
204 | implementation jscFlavor
205 | }
206 |
207 | }
208 |
209 | // Run this once to be able to run the application with BUCK
210 | // puts all compile dependencies into folder libs for BUCK to use
211 | task copyDownloadableDepsToLibs(type: Copy) {
212 | from configurations.compile
213 | into 'libs'
214 | }
215 |
216 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
217 |
--------------------------------------------------------------------------------
/example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/example/android/app/debug.keystore
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/example/reactnativeclipboardtoast/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.reactnativeclipboardtoast;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32 | client.addPlugin(new ReactFlipperPlugin());
33 | client.addPlugin(new DatabasesFlipperPlugin(context));
34 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35 | client.addPlugin(CrashReporterPlugin.getInstance());
36 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37 | NetworkingModule.setCustomClientBuilder(
38 | new NetworkingModule.CustomClientBuilder() {
39 | @Override
40 | public void apply(OkHttpClient.Builder builder) {
41 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42 | }
43 | });
44 | client.addPlugin(networkFlipperPlugin);
45 | client.start();
46 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47 | // Hence we run if after all native modules have been initialized
48 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49 | if (reactContext == null) {
50 | reactInstanceManager.addReactInstanceEventListener(
51 | new ReactInstanceManager.ReactInstanceEventListener() {
52 | @Override
53 | public void onReactContextInitialized(ReactContext reactContext) {
54 | reactInstanceManager.removeReactInstanceEventListener(this);
55 | reactContext.runOnNativeModulesQueueThread(
56 | new Runnable() {
57 | @Override
58 | public void run() {
59 | client.addPlugin(new FrescoFlipperPlugin());
60 | }
61 | });
62 | }
63 | });
64 | } else {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
13 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativeclipboardtoast/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativeclipboardtoast;
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 "ClipboardToastExample";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/example/reactnativeclipboardtoast/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.reactnativeclipboardtoast;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.react.ReactInstanceManager;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
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 ClipboardToastExample:
28 | // packages.add(new MyReactNativePackage());
29 |
30 | return packages;
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
49 | }
50 |
51 | /**
52 | * Loads Flipper in React Native templates.
53 | *
54 | * @param context
55 | */
56 | private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
57 | if (BuildConfig.DEBUG) {
58 | try {
59 | /*
60 | We use reflection here to pick up the class that initializes Flipper,
61 | since Flipper library is not available in release mode
62 | */
63 | Class> aClass = Class.forName("com.reactnativeclipboardtoastExample.ReactNativeFlipper");
64 | aClass
65 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
66 | .invoke(null, context, reactInstanceManager);
67 | } catch (ClassNotFoundException e) {
68 | e.printStackTrace();
69 | } catch (NoSuchMethodException e) {
70 | e.printStackTrace();
71 | } catch (IllegalAccessException e) {
72 | e.printStackTrace();
73 | } catch (InvocationTargetException e) {
74 | e.printStackTrace();
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/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/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ClipboardToast Example
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "29.0.2"
6 | minSdkVersion = 16
7 | compileSdkVersion = 29
8 | targetSdkVersion = 29
9 | }
10 | repositories {
11 | google()
12 | jcenter()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle:3.5.3")
16 |
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | google()
35 | jcenter()
36 | maven { url 'https://www.jitpack.io' }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 | FLIPPER_VERSION=0.54.0
23 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin or MSYS, switch paths to Windows format before running java
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=`expr $i + 1`
158 | done
159 | case $i in
160 | 0) set -- ;;
161 | 1) set -- "$args0" ;;
162 | 2) set -- "$args0" "$args1" ;;
163 | 3) set -- "$args0" "$args1" "$args2" ;;
164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=`save "$@"`
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | exec "$JAVACMD" "$@"
184 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto init
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto init
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :init
68 | @rem Get command-line arguments, handling Windows variants
69 |
70 | if not "%OS%" == "Windows_NT" goto win9xME_args
71 |
72 | :win9xME_args
73 | @rem Slurp the command line arguments.
74 | set CMD_LINE_ARGS=
75 | set _SKIP=2
76 |
77 | :win9xME_args_slurp
78 | if "x%~1" == "x" goto execute
79 |
80 | set CMD_LINE_ARGS=%*
81 |
82 | :execute
83 | @rem Setup the command line
84 |
85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
86 |
87 | @rem Execute Gradle
88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
89 |
90 | :end
91 | @rem End local scope for the variables with windows NT shell
92 | if "%ERRORLEVEL%"=="0" goto mainEnd
93 |
94 | :fail
95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
96 | rem the _cmd.exe /c_ return code!
97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
98 | exit /b 1
99 |
100 | :mainEnd
101 | if "%OS%"=="Windows_NT" endlocal
102 |
103 | :omega
104 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'ClipboardToastExample'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
5 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ClipboardToastExample",
3 | "displayName": "ClipboardToast Example"
4 | }
5 |
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const pak = require('../package.json');
3 |
4 | module.exports = {
5 | presets: ['module:metro-react-native-babel-preset'],
6 | plugins: [
7 | [
8 | 'module-resolver',
9 | {
10 | extensions: ['.tsx', '.ts', '.js', '.json'],
11 | alias: {
12 | [pak.name]: path.join(__dirname, '..', pak.source),
13 | },
14 | },
15 | ],
16 | ],
17 | };
18 |
--------------------------------------------------------------------------------
/example/index.tsx:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import App from './src/App';
3 | import { name as appName } from './app.json';
4 |
5 | AppRegistry.registerComponent(appName, () => App);
6 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* ClipboardToastExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ClipboardToastExampleTests.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 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
15 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
16 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
17 | 2DCD954D1E0B4F2C00145EB5 /* ClipboardToastExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ClipboardToastExampleTests.m */; };
18 | 4C39C56BAD484C67AA576FFA /* libPods-ClipboardToastExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-ClipboardToastExample.a */; };
19 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
28 | remoteInfo = ClipboardToastExample;
29 | };
30 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
35 | remoteInfo = "ClipboardToastExample-tvOS";
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
41 | 00E356EE1AD99517003FC87E /* ClipboardToastExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ClipboardToastExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
43 | 00E356F21AD99517003FC87E /* ClipboardToastExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ClipboardToastExampleTests.m; sourceTree = ""; };
44 | 13B07F961A680F5B00A75B9A /* ClipboardToastExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClipboardToastExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
45 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ClipboardToastExample/AppDelegate.h; sourceTree = ""; };
46 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ClipboardToastExample/AppDelegate.m; sourceTree = ""; };
47 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ClipboardToastExample/Images.xcassets; sourceTree = ""; };
48 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ClipboardToastExample/Info.plist; sourceTree = ""; };
49 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ClipboardToastExample/main.m; sourceTree = ""; };
50 | 2D02E47B1E0B4A5D006451C7 /* ClipboardToastExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ClipboardToastExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 2D02E4901E0B4A5D006451C7 /* ClipboardToastExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ClipboardToastExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 47F7ED3B7971BE374F7B8635 /* Pods-ClipboardToastExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClipboardToastExample.debug.xcconfig"; path = "Target Support Files/Pods-ClipboardToastExample/Pods-ClipboardToastExample.debug.xcconfig"; sourceTree = ""; };
53 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ClipboardToastExample/LaunchScreen.storyboard; sourceTree = ""; };
54 | CA3E69C5B9553B26FBA2DF04 /* libPods-ClipboardToastExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ClipboardToastExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
55 | E00ACF0FDA8BF921659E2F9A /* Pods-ClipboardToastExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ClipboardToastExample.release.xcconfig"; path = "Target Support Files/Pods-ClipboardToastExample/Pods-ClipboardToastExample.release.xcconfig"; sourceTree = ""; };
56 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
57 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | );
66 | runOnlyForDeploymentPostprocessing = 0;
67 | };
68 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
69 | isa = PBXFrameworksBuildPhase;
70 | buildActionMask = 2147483647;
71 | files = (
72 | 4C39C56BAD484C67AA576FFA /* libPods-ClipboardToastExample.a in Frameworks */,
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
84 | isa = PBXFrameworksBuildPhase;
85 | buildActionMask = 2147483647;
86 | files = (
87 | );
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | /* End PBXFrameworksBuildPhase section */
91 |
92 | /* Begin PBXGroup section */
93 | 00E356EF1AD99517003FC87E /* ClipboardToastExampleTests */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 00E356F21AD99517003FC87E /* ClipboardToastExampleTests.m */,
97 | 00E356F01AD99517003FC87E /* Supporting Files */,
98 | );
99 | path = ClipboardToastExampleTests;
100 | sourceTree = "";
101 | };
102 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 00E356F11AD99517003FC87E /* Info.plist */,
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | 13B07FAE1A68108700A75B9A /* ClipboardToastExample */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
114 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
115 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
116 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
117 | 13B07FB61A68108700A75B9A /* Info.plist */,
118 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
119 | 13B07FB71A68108700A75B9A /* main.m */,
120 | );
121 | name = ClipboardToastExample;
122 | sourceTree = "";
123 | };
124 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
125 | isa = PBXGroup;
126 | children = (
127 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
128 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
129 | CA3E69C5B9553B26FBA2DF04 /* libPods-ClipboardToastExample.a */,
130 | );
131 | name = Frameworks;
132 | sourceTree = "";
133 | };
134 | 6B9684456A2045ADE5A6E47E /* Pods */ = {
135 | isa = PBXGroup;
136 | children = (
137 | 47F7ED3B7971BE374F7B8635 /* Pods-ClipboardToastExample.debug.xcconfig */,
138 | E00ACF0FDA8BF921659E2F9A /* Pods-ClipboardToastExample.release.xcconfig */,
139 | );
140 | name = Pods;
141 | path = Pods;
142 | sourceTree = "";
143 | };
144 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
145 | isa = PBXGroup;
146 | children = (
147 | );
148 | name = Libraries;
149 | sourceTree = "";
150 | };
151 | 83CBB9F61A601CBA00E9B192 = {
152 | isa = PBXGroup;
153 | children = (
154 | 13B07FAE1A68108700A75B9A /* ClipboardToastExample */,
155 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
156 | 00E356EF1AD99517003FC87E /* ClipboardToastExampleTests */,
157 | 83CBBA001A601CBA00E9B192 /* Products */,
158 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
159 | 6B9684456A2045ADE5A6E47E /* Pods */,
160 | );
161 | indentWidth = 2;
162 | sourceTree = "";
163 | tabWidth = 2;
164 | usesTabs = 0;
165 | };
166 | 83CBBA001A601CBA00E9B192 /* Products */ = {
167 | isa = PBXGroup;
168 | children = (
169 | 13B07F961A680F5B00A75B9A /* ClipboardToastExample.app */,
170 | 00E356EE1AD99517003FC87E /* ClipboardToastExampleTests.xctest */,
171 | 2D02E47B1E0B4A5D006451C7 /* ClipboardToastExample-tvOS.app */,
172 | 2D02E4901E0B4A5D006451C7 /* ClipboardToastExample-tvOSTests.xctest */,
173 | );
174 | name = Products;
175 | sourceTree = "";
176 | };
177 | /* End PBXGroup section */
178 |
179 | /* Begin PBXNativeTarget section */
180 | 00E356ED1AD99517003FC87E /* ClipboardToastExampleTests */ = {
181 | isa = PBXNativeTarget;
182 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ClipboardToastExampleTests" */;
183 | buildPhases = (
184 | 00E356EA1AD99517003FC87E /* Sources */,
185 | 00E356EB1AD99517003FC87E /* Frameworks */,
186 | 00E356EC1AD99517003FC87E /* Resources */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
192 | );
193 | name = ClipboardToastExampleTests;
194 | productName = ClipboardToastExampleTests;
195 | productReference = 00E356EE1AD99517003FC87E /* ClipboardToastExampleTests.xctest */;
196 | productType = "com.apple.product-type.bundle.unit-test";
197 | };
198 | 13B07F861A680F5B00A75B9A /* ClipboardToastExample */ = {
199 | isa = PBXNativeTarget;
200 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ClipboardToastExample" */;
201 | buildPhases = (
202 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */,
203 | FD10A7F022414F080027D42C /* Start Packager */,
204 | 13B07F871A680F5B00A75B9A /* Sources */,
205 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
206 | 13B07F8E1A680F5B00A75B9A /* Resources */,
207 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
208 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */,
209 | );
210 | buildRules = (
211 | );
212 | dependencies = (
213 | );
214 | name = ClipboardToastExample;
215 | productName = ClipboardToastExample;
216 | productReference = 13B07F961A680F5B00A75B9A /* ClipboardToastExample.app */;
217 | productType = "com.apple.product-type.application";
218 | };
219 | 2D02E47A1E0B4A5D006451C7 /* ClipboardToastExample-tvOS */ = {
220 | isa = PBXNativeTarget;
221 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ClipboardToastExample-tvOS" */;
222 | buildPhases = (
223 | FD10A7F122414F3F0027D42C /* Start Packager */,
224 | 2D02E4771E0B4A5D006451C7 /* Sources */,
225 | 2D02E4781E0B4A5D006451C7 /* Frameworks */,
226 | 2D02E4791E0B4A5D006451C7 /* Resources */,
227 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
228 | );
229 | buildRules = (
230 | );
231 | dependencies = (
232 | );
233 | name = "ClipboardToastExample-tvOS";
234 | productName = "ClipboardToastExample-tvOS";
235 | productReference = 2D02E47B1E0B4A5D006451C7 /* ClipboardToastExample-tvOS.app */;
236 | productType = "com.apple.product-type.application";
237 | };
238 | 2D02E48F1E0B4A5D006451C7 /* ClipboardToastExample-tvOSTests */ = {
239 | isa = PBXNativeTarget;
240 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ClipboardToastExample-tvOSTests" */;
241 | buildPhases = (
242 | 2D02E48C1E0B4A5D006451C7 /* Sources */,
243 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */,
244 | 2D02E48E1E0B4A5D006451C7 /* Resources */,
245 | );
246 | buildRules = (
247 | );
248 | dependencies = (
249 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
250 | );
251 | name = "ClipboardToastExample-tvOSTests";
252 | productName = "ClipboardToastExample-tvOSTests";
253 | productReference = 2D02E4901E0B4A5D006451C7 /* ClipboardToastExample-tvOSTests.xctest */;
254 | productType = "com.apple.product-type.bundle.unit-test";
255 | };
256 | /* End PBXNativeTarget section */
257 |
258 | /* Begin PBXProject section */
259 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
260 | isa = PBXProject;
261 | attributes = {
262 | LastUpgradeCheck = 1130;
263 | TargetAttributes = {
264 | 00E356ED1AD99517003FC87E = {
265 | CreatedOnToolsVersion = 6.2;
266 | TestTargetID = 13B07F861A680F5B00A75B9A;
267 | };
268 | 13B07F861A680F5B00A75B9A = {
269 | LastSwiftMigration = 1120;
270 | };
271 | 2D02E47A1E0B4A5D006451C7 = {
272 | CreatedOnToolsVersion = 8.2.1;
273 | ProvisioningStyle = Automatic;
274 | };
275 | 2D02E48F1E0B4A5D006451C7 = {
276 | CreatedOnToolsVersion = 8.2.1;
277 | ProvisioningStyle = Automatic;
278 | TestTargetID = 2D02E47A1E0B4A5D006451C7;
279 | };
280 | };
281 | };
282 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ClipboardToastExample" */;
283 | compatibilityVersion = "Xcode 3.2";
284 | developmentRegion = en;
285 | hasScannedForEncodings = 0;
286 | knownRegions = (
287 | en,
288 | Base,
289 | );
290 | mainGroup = 83CBB9F61A601CBA00E9B192;
291 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
292 | projectDirPath = "";
293 | projectRoot = "";
294 | targets = (
295 | 13B07F861A680F5B00A75B9A /* ClipboardToastExample */,
296 | 00E356ED1AD99517003FC87E /* ClipboardToastExampleTests */,
297 | 2D02E47A1E0B4A5D006451C7 /* ClipboardToastExample-tvOS */,
298 | 2D02E48F1E0B4A5D006451C7 /* ClipboardToastExample-tvOSTests */,
299 | );
300 | };
301 | /* End PBXProject section */
302 |
303 | /* Begin PBXResourcesBuildPhase section */
304 | 00E356EC1AD99517003FC87E /* Resources */ = {
305 | isa = PBXResourcesBuildPhase;
306 | buildActionMask = 2147483647;
307 | files = (
308 | );
309 | runOnlyForDeploymentPostprocessing = 0;
310 | };
311 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
312 | isa = PBXResourcesBuildPhase;
313 | buildActionMask = 2147483647;
314 | files = (
315 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
316 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
317 | );
318 | runOnlyForDeploymentPostprocessing = 0;
319 | };
320 | 2D02E4791E0B4A5D006451C7 /* Resources */ = {
321 | isa = PBXResourcesBuildPhase;
322 | buildActionMask = 2147483647;
323 | files = (
324 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
325 | );
326 | runOnlyForDeploymentPostprocessing = 0;
327 | };
328 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = {
329 | isa = PBXResourcesBuildPhase;
330 | buildActionMask = 2147483647;
331 | files = (
332 | );
333 | runOnlyForDeploymentPostprocessing = 0;
334 | };
335 | /* End PBXResourcesBuildPhase section */
336 |
337 | /* Begin PBXShellScriptBuildPhase section */
338 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
339 | isa = PBXShellScriptBuildPhase;
340 | buildActionMask = 2147483647;
341 | files = (
342 | );
343 | inputPaths = (
344 | );
345 | name = "Bundle React Native code and images";
346 | outputPaths = (
347 | );
348 | runOnlyForDeploymentPostprocessing = 0;
349 | shellPath = /bin/sh;
350 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
351 | };
352 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
353 | isa = PBXShellScriptBuildPhase;
354 | buildActionMask = 2147483647;
355 | files = (
356 | );
357 | inputPaths = (
358 | );
359 | name = "Bundle React Native Code And Images";
360 | outputPaths = (
361 | );
362 | runOnlyForDeploymentPostprocessing = 0;
363 | shellPath = /bin/sh;
364 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
365 | };
366 | 4F0A6FC082772762E3E4C96C /* [CP] Check Pods Manifest.lock */ = {
367 | isa = PBXShellScriptBuildPhase;
368 | buildActionMask = 2147483647;
369 | files = (
370 | );
371 | inputFileListPaths = (
372 | );
373 | inputPaths = (
374 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
375 | "${PODS_ROOT}/Manifest.lock",
376 | );
377 | name = "[CP] Check Pods Manifest.lock";
378 | outputFileListPaths = (
379 | );
380 | outputPaths = (
381 | "$(DERIVED_FILE_DIR)/Pods-ClipboardToastExample-checkManifestLockResult.txt",
382 | );
383 | runOnlyForDeploymentPostprocessing = 0;
384 | shellPath = /bin/sh;
385 | 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";
386 | showEnvVarsInLog = 0;
387 | };
388 | C1D60D28B925C94BD88E79D7 /* [CP] Copy Pods Resources */ = {
389 | isa = PBXShellScriptBuildPhase;
390 | buildActionMask = 2147483647;
391 | files = (
392 | );
393 | inputPaths = (
394 | "${PODS_ROOT}/Target Support Files/Pods-ClipboardToastExample/Pods-ClipboardToastExample-resources.sh",
395 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
396 | );
397 | name = "[CP] Copy Pods Resources";
398 | outputPaths = (
399 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
400 | );
401 | runOnlyForDeploymentPostprocessing = 0;
402 | shellPath = /bin/sh;
403 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ClipboardToastExample/Pods-ClipboardToastExample-resources.sh\"\n";
404 | showEnvVarsInLog = 0;
405 | };
406 | FD10A7F022414F080027D42C /* Start Packager */ = {
407 | isa = PBXShellScriptBuildPhase;
408 | buildActionMask = 2147483647;
409 | files = (
410 | );
411 | inputFileListPaths = (
412 | );
413 | inputPaths = (
414 | );
415 | name = "Start Packager";
416 | outputFileListPaths = (
417 | );
418 | outputPaths = (
419 | );
420 | runOnlyForDeploymentPostprocessing = 0;
421 | shellPath = /bin/sh;
422 | 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";
423 | showEnvVarsInLog = 0;
424 | };
425 | FD10A7F122414F3F0027D42C /* Start Packager */ = {
426 | isa = PBXShellScriptBuildPhase;
427 | buildActionMask = 2147483647;
428 | files = (
429 | );
430 | inputFileListPaths = (
431 | );
432 | inputPaths = (
433 | );
434 | name = "Start Packager";
435 | outputFileListPaths = (
436 | );
437 | outputPaths = (
438 | );
439 | runOnlyForDeploymentPostprocessing = 0;
440 | shellPath = /bin/sh;
441 | 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";
442 | showEnvVarsInLog = 0;
443 | };
444 | /* End PBXShellScriptBuildPhase section */
445 |
446 | /* Begin PBXSourcesBuildPhase section */
447 | 00E356EA1AD99517003FC87E /* Sources */ = {
448 | isa = PBXSourcesBuildPhase;
449 | buildActionMask = 2147483647;
450 | files = (
451 | 00E356F31AD99517003FC87E /* ClipboardToastExampleTests.m in Sources */,
452 | );
453 | runOnlyForDeploymentPostprocessing = 0;
454 | };
455 | 13B07F871A680F5B00A75B9A /* Sources */ = {
456 | isa = PBXSourcesBuildPhase;
457 | buildActionMask = 2147483647;
458 | files = (
459 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
460 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
461 | );
462 | runOnlyForDeploymentPostprocessing = 0;
463 | };
464 | 2D02E4771E0B4A5D006451C7 /* Sources */ = {
465 | isa = PBXSourcesBuildPhase;
466 | buildActionMask = 2147483647;
467 | files = (
468 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
469 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
470 | );
471 | runOnlyForDeploymentPostprocessing = 0;
472 | };
473 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = {
474 | isa = PBXSourcesBuildPhase;
475 | buildActionMask = 2147483647;
476 | files = (
477 | 2DCD954D1E0B4F2C00145EB5 /* ClipboardToastExampleTests.m in Sources */,
478 | );
479 | runOnlyForDeploymentPostprocessing = 0;
480 | };
481 | /* End PBXSourcesBuildPhase section */
482 |
483 | /* Begin PBXTargetDependency section */
484 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
485 | isa = PBXTargetDependency;
486 | target = 13B07F861A680F5B00A75B9A /* ClipboardToastExample */;
487 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
488 | };
489 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
490 | isa = PBXTargetDependency;
491 | target = 2D02E47A1E0B4A5D006451C7 /* ClipboardToastExample-tvOS */;
492 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
493 | };
494 | /* End PBXTargetDependency section */
495 |
496 | /* Begin XCBuildConfiguration section */
497 | 00E356F61AD99517003FC87E /* Debug */ = {
498 | isa = XCBuildConfiguration;
499 | buildSettings = {
500 | BUNDLE_LOADER = "$(TEST_HOST)";
501 | GCC_PREPROCESSOR_DEFINITIONS = (
502 | "DEBUG=1",
503 | "$(inherited)",
504 | );
505 | INFOPLIST_FILE = ClipboardToastExampleTests/Info.plist;
506 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
508 | OTHER_LDFLAGS = (
509 | "-ObjC",
510 | "-lc++",
511 | "$(inherited)",
512 | );
513 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeclipboardtoast;
514 | PRODUCT_NAME = "$(TARGET_NAME)";
515 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ClipboardToastExample.app/ClipboardToastExample";
516 | };
517 | name = Debug;
518 | };
519 | 00E356F71AD99517003FC87E /* Release */ = {
520 | isa = XCBuildConfiguration;
521 | buildSettings = {
522 | BUNDLE_LOADER = "$(TEST_HOST)";
523 | COPY_PHASE_STRIP = NO;
524 | INFOPLIST_FILE = ClipboardToastExampleTests/Info.plist;
525 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
527 | OTHER_LDFLAGS = (
528 | "-ObjC",
529 | "-lc++",
530 | "$(inherited)",
531 | );
532 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeclipboardtoast;
533 | PRODUCT_NAME = "$(TARGET_NAME)";
534 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ClipboardToastExample.app/ClipboardToastExample";
535 | };
536 | name = Release;
537 | };
538 | 13B07F941A680F5B00A75B9A /* Debug */ = {
539 | isa = XCBuildConfiguration;
540 | baseConfigurationReference = 47F7ED3B7971BE374F7B8635 /* Pods-ClipboardToastExample.debug.xcconfig */;
541 | buildSettings = {
542 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
543 | CLANG_ENABLE_MODULES = YES;
544 | CURRENT_PROJECT_VERSION = 1;
545 | ENABLE_BITCODE = NO;
546 | INFOPLIST_FILE = ClipboardToastExample/Info.plist;
547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
548 | OTHER_LDFLAGS = (
549 | "$(inherited)",
550 | "-ObjC",
551 | "-lc++",
552 | );
553 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeclipboardtoast;
554 | PRODUCT_NAME = ClipboardToastExample;
555 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
556 | SWIFT_VERSION = 5.0;
557 | VERSIONING_SYSTEM = "apple-generic";
558 | };
559 | name = Debug;
560 | };
561 | 13B07F951A680F5B00A75B9A /* Release */ = {
562 | isa = XCBuildConfiguration;
563 | baseConfigurationReference = E00ACF0FDA8BF921659E2F9A /* Pods-ClipboardToastExample.release.xcconfig */;
564 | buildSettings = {
565 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
566 | CLANG_ENABLE_MODULES = YES;
567 | CURRENT_PROJECT_VERSION = 1;
568 | INFOPLIST_FILE = ClipboardToastExample/Info.plist;
569 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
570 | OTHER_LDFLAGS = (
571 | "$(inherited)",
572 | "-ObjC",
573 | "-lc++",
574 | );
575 | PRODUCT_BUNDLE_IDENTIFIER = com.example.reactnativeclipboardtoast;
576 | PRODUCT_NAME = ClipboardToastExample;
577 | SWIFT_VERSION = 5.0;
578 | VERSIONING_SYSTEM = "apple-generic";
579 | };
580 | name = Release;
581 | };
582 | 2D02E4971E0B4A5E006451C7 /* Debug */ = {
583 | isa = XCBuildConfiguration;
584 | buildSettings = {
585 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
586 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
587 | CLANG_ANALYZER_NONNULL = YES;
588 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
589 | CLANG_WARN_INFINITE_RECURSION = YES;
590 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
591 | DEBUG_INFORMATION_FORMAT = dwarf;
592 | ENABLE_TESTABILITY = YES;
593 | GCC_NO_COMMON_BLOCKS = YES;
594 | INFOPLIST_FILE = "ClipboardToastExample-tvOS/Info.plist";
595 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
596 | OTHER_LDFLAGS = (
597 | "$(inherited)",
598 | "-ObjC",
599 | "-lc++",
600 | );
601 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.ClipboardToastExample-tvOS";
602 | PRODUCT_NAME = "$(TARGET_NAME)";
603 | SDKROOT = appletvos;
604 | TARGETED_DEVICE_FAMILY = 3;
605 | TVOS_DEPLOYMENT_TARGET = 10.0;
606 | };
607 | name = Debug;
608 | };
609 | 2D02E4981E0B4A5E006451C7 /* Release */ = {
610 | isa = XCBuildConfiguration;
611 | buildSettings = {
612 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
613 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
614 | CLANG_ANALYZER_NONNULL = YES;
615 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
616 | CLANG_WARN_INFINITE_RECURSION = YES;
617 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
618 | COPY_PHASE_STRIP = NO;
619 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
620 | GCC_NO_COMMON_BLOCKS = YES;
621 | INFOPLIST_FILE = "ClipboardToastExample-tvOS/Info.plist";
622 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
623 | OTHER_LDFLAGS = (
624 | "$(inherited)",
625 | "-ObjC",
626 | "-lc++",
627 | );
628 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.ClipboardToastExample-tvOS";
629 | PRODUCT_NAME = "$(TARGET_NAME)";
630 | SDKROOT = appletvos;
631 | TARGETED_DEVICE_FAMILY = 3;
632 | TVOS_DEPLOYMENT_TARGET = 10.0;
633 | };
634 | name = Release;
635 | };
636 | 2D02E4991E0B4A5E006451C7 /* Debug */ = {
637 | isa = XCBuildConfiguration;
638 | buildSettings = {
639 | BUNDLE_LOADER = "$(TEST_HOST)";
640 | CLANG_ANALYZER_NONNULL = YES;
641 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
642 | CLANG_WARN_INFINITE_RECURSION = YES;
643 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
644 | DEBUG_INFORMATION_FORMAT = dwarf;
645 | ENABLE_TESTABILITY = YES;
646 | GCC_NO_COMMON_BLOCKS = YES;
647 | INFOPLIST_FILE = "ClipboardToastExample-tvOSTests/Info.plist";
648 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
649 | OTHER_LDFLAGS = (
650 | "$(inherited)",
651 | "-ObjC",
652 | "-lc++",
653 | );
654 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.ClipboardToastExample-tvOSTests";
655 | PRODUCT_NAME = "$(TARGET_NAME)";
656 | SDKROOT = appletvos;
657 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ClipboardToastExample-tvOS.app/ClipboardToastExample-tvOS";
658 | TVOS_DEPLOYMENT_TARGET = 10.1;
659 | };
660 | name = Debug;
661 | };
662 | 2D02E49A1E0B4A5E006451C7 /* Release */ = {
663 | isa = XCBuildConfiguration;
664 | buildSettings = {
665 | BUNDLE_LOADER = "$(TEST_HOST)";
666 | CLANG_ANALYZER_NONNULL = YES;
667 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
668 | CLANG_WARN_INFINITE_RECURSION = YES;
669 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
670 | COPY_PHASE_STRIP = NO;
671 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
672 | GCC_NO_COMMON_BLOCKS = YES;
673 | INFOPLIST_FILE = "ClipboardToastExample-tvOSTests/Info.plist";
674 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
675 | OTHER_LDFLAGS = (
676 | "$(inherited)",
677 | "-ObjC",
678 | "-lc++",
679 | );
680 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.ClipboardToastExample-tvOSTests";
681 | PRODUCT_NAME = "$(TARGET_NAME)";
682 | SDKROOT = appletvos;
683 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ClipboardToastExample-tvOS.app/ClipboardToastExample-tvOS";
684 | TVOS_DEPLOYMENT_TARGET = 10.1;
685 | };
686 | name = Release;
687 | };
688 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
689 | isa = XCBuildConfiguration;
690 | buildSettings = {
691 | ALWAYS_SEARCH_USER_PATHS = NO;
692 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
693 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
694 | CLANG_CXX_LIBRARY = "libc++";
695 | CLANG_ENABLE_MODULES = YES;
696 | CLANG_ENABLE_OBJC_ARC = YES;
697 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
698 | CLANG_WARN_BOOL_CONVERSION = YES;
699 | CLANG_WARN_COMMA = YES;
700 | CLANG_WARN_CONSTANT_CONVERSION = YES;
701 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
702 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
703 | CLANG_WARN_EMPTY_BODY = YES;
704 | CLANG_WARN_ENUM_CONVERSION = YES;
705 | CLANG_WARN_INFINITE_RECURSION = YES;
706 | CLANG_WARN_INT_CONVERSION = YES;
707 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
708 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
709 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
710 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
711 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
712 | CLANG_WARN_STRICT_PROTOTYPES = YES;
713 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
714 | CLANG_WARN_UNREACHABLE_CODE = YES;
715 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
716 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
717 | COPY_PHASE_STRIP = NO;
718 | ENABLE_STRICT_OBJC_MSGSEND = YES;
719 | ENABLE_TESTABILITY = YES;
720 | GCC_C_LANGUAGE_STANDARD = gnu99;
721 | GCC_DYNAMIC_NO_PIC = NO;
722 | GCC_NO_COMMON_BLOCKS = YES;
723 | GCC_OPTIMIZATION_LEVEL = 0;
724 | GCC_PREPROCESSOR_DEFINITIONS = (
725 | "DEBUG=1",
726 | "$(inherited)",
727 | );
728 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
729 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
730 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
731 | GCC_WARN_UNDECLARED_SELECTOR = YES;
732 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
733 | GCC_WARN_UNUSED_FUNCTION = YES;
734 | GCC_WARN_UNUSED_VARIABLE = YES;
735 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
736 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
737 | LIBRARY_SEARCH_PATHS = (
738 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
739 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
740 | "\"$(inherited)\"",
741 | );
742 | MTL_ENABLE_DEBUG_INFO = YES;
743 | ONLY_ACTIVE_ARCH = YES;
744 | SDKROOT = iphoneos;
745 | };
746 | name = Debug;
747 | };
748 | 83CBBA211A601CBA00E9B192 /* Release */ = {
749 | isa = XCBuildConfiguration;
750 | buildSettings = {
751 | ALWAYS_SEARCH_USER_PATHS = NO;
752 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
753 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
754 | CLANG_CXX_LIBRARY = "libc++";
755 | CLANG_ENABLE_MODULES = YES;
756 | CLANG_ENABLE_OBJC_ARC = YES;
757 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
758 | CLANG_WARN_BOOL_CONVERSION = YES;
759 | CLANG_WARN_COMMA = YES;
760 | CLANG_WARN_CONSTANT_CONVERSION = YES;
761 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
762 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
763 | CLANG_WARN_EMPTY_BODY = YES;
764 | CLANG_WARN_ENUM_CONVERSION = YES;
765 | CLANG_WARN_INFINITE_RECURSION = YES;
766 | CLANG_WARN_INT_CONVERSION = YES;
767 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
768 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
769 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
770 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
771 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
772 | CLANG_WARN_STRICT_PROTOTYPES = YES;
773 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
774 | CLANG_WARN_UNREACHABLE_CODE = YES;
775 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
776 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
777 | COPY_PHASE_STRIP = YES;
778 | ENABLE_NS_ASSERTIONS = NO;
779 | ENABLE_STRICT_OBJC_MSGSEND = YES;
780 | GCC_C_LANGUAGE_STANDARD = gnu99;
781 | GCC_NO_COMMON_BLOCKS = YES;
782 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
783 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
784 | GCC_WARN_UNDECLARED_SELECTOR = YES;
785 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
786 | GCC_WARN_UNUSED_FUNCTION = YES;
787 | GCC_WARN_UNUSED_VARIABLE = YES;
788 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
789 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
790 | LIBRARY_SEARCH_PATHS = (
791 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
792 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
793 | "\"$(inherited)\"",
794 | );
795 | MTL_ENABLE_DEBUG_INFO = NO;
796 | SDKROOT = iphoneos;
797 | VALIDATE_PRODUCT = YES;
798 | };
799 | name = Release;
800 | };
801 | /* End XCBuildConfiguration section */
802 |
803 | /* Begin XCConfigurationList section */
804 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ClipboardToastExampleTests" */ = {
805 | isa = XCConfigurationList;
806 | buildConfigurations = (
807 | 00E356F61AD99517003FC87E /* Debug */,
808 | 00E356F71AD99517003FC87E /* Release */,
809 | );
810 | defaultConfigurationIsVisible = 0;
811 | defaultConfigurationName = Release;
812 | };
813 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ClipboardToastExample" */ = {
814 | isa = XCConfigurationList;
815 | buildConfigurations = (
816 | 13B07F941A680F5B00A75B9A /* Debug */,
817 | 13B07F951A680F5B00A75B9A /* Release */,
818 | );
819 | defaultConfigurationIsVisible = 0;
820 | defaultConfigurationName = Release;
821 | };
822 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ClipboardToastExample-tvOS" */ = {
823 | isa = XCConfigurationList;
824 | buildConfigurations = (
825 | 2D02E4971E0B4A5E006451C7 /* Debug */,
826 | 2D02E4981E0B4A5E006451C7 /* Release */,
827 | );
828 | defaultConfigurationIsVisible = 0;
829 | defaultConfigurationName = Release;
830 | };
831 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ClipboardToastExample-tvOSTests" */ = {
832 | isa = XCConfigurationList;
833 | buildConfigurations = (
834 | 2D02E4991E0B4A5E006451C7 /* Debug */,
835 | 2D02E49A1E0B4A5E006451C7 /* Release */,
836 | );
837 | defaultConfigurationIsVisible = 0;
838 | defaultConfigurationName = Release;
839 | };
840 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ClipboardToastExample" */ = {
841 | isa = XCConfigurationList;
842 | buildConfigurations = (
843 | 83CBBA201A601CBA00E9B192 /* Debug */,
844 | 83CBBA211A601CBA00E9B192 /* Release */,
845 | );
846 | defaultConfigurationIsVisible = 0;
847 | defaultConfigurationName = Release;
848 | };
849 | /* End XCConfigurationList section */
850 | };
851 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
852 | }
853 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample.xcodeproj/xcshareddata/xcschemes/ClipboardToastExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
81 |
83 |
89 |
90 |
91 |
92 |
94 |
95 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 |
14 | #ifdef FB_SONARKIT_ENABLED
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 | #import
21 | static void InitializeFlipper(UIApplication *application) {
22 | FlipperClient *client = [FlipperClient sharedClient];
23 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
24 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
25 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
26 | [client addPlugin:[FlipperKitReactPlugin new]];
27 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
28 | [client start];
29 | }
30 | #endif
31 |
32 | @implementation AppDelegate
33 |
34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
35 | {
36 | #ifdef FB_SONARKIT_ENABLED
37 | InitializeFlipper(application);
38 | #endif
39 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
40 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
41 | moduleName:@"ClipboardToastExample"
42 | initialProperties:nil];
43 |
44 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
45 |
46 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
47 | UIViewController *rootViewController = [UIViewController new];
48 | rootViewController.view = rootView;
49 | self.window.rootViewController = rootViewController;
50 | [self.window makeKeyAndVisible];
51 | return YES;
52 | }
53 |
54 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
55 | {
56 | #if DEBUG
57 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
58 | #else
59 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
60 | #endif
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/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/ClipboardToastExample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ClipboardToast 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 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSLocationWhenInUseUsageDescription
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIRequiredDeviceCapabilities
45 |
46 | armv7
47 |
48 | UISupportedInterfaceOrientations
49 |
50 | UIInterfaceOrientationPortrait
51 | UIInterfaceOrientationLandscapeLeft
52 | UIInterfaceOrientationLandscapeRight
53 |
54 | UIViewControllerBasedStatusBarAppearance
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/example/ios/ClipboardToastExample/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // ClipboardToastExample
4 | //
5 |
6 | import Foundation
7 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, '10.0'
5 |
6 | target 'ClipboardToastExample' do
7 | config = use_native_modules!
8 |
9 | use_react_native!(:path => config["reactNativePath"])
10 |
11 | # Enables Flipper.
12 | #
13 | # Note that if you have use_frameworks! enabled, Flipper will not work and
14 | # you should disable these next few lines.
15 | # use_flipper!
16 | post_install do |installer|
17 | flipper_post_install(installer)
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost-for-react-native (1.63.0)
3 | - DoubleConversion (1.1.6)
4 | - FBLazyVector (0.63.4)
5 | - FBReactNativeSpec (0.63.4):
6 | - Folly (= 2020.01.13.00)
7 | - RCTRequired (= 0.63.4)
8 | - RCTTypeSafety (= 0.63.4)
9 | - React-Core (= 0.63.4)
10 | - React-jsi (= 0.63.4)
11 | - ReactCommon/turbomodule/core (= 0.63.4)
12 | - Folly (2020.01.13.00):
13 | - boost-for-react-native
14 | - DoubleConversion
15 | - Folly/Default (= 2020.01.13.00)
16 | - glog
17 | - Folly/Default (2020.01.13.00):
18 | - boost-for-react-native
19 | - DoubleConversion
20 | - glog
21 | - glog (0.3.5)
22 | - RCTRequired (0.63.4)
23 | - RCTTypeSafety (0.63.4):
24 | - FBLazyVector (= 0.63.4)
25 | - Folly (= 2020.01.13.00)
26 | - RCTRequired (= 0.63.4)
27 | - React-Core (= 0.63.4)
28 | - React (0.63.4):
29 | - React-Core (= 0.63.4)
30 | - React-Core/DevSupport (= 0.63.4)
31 | - React-Core/RCTWebSocket (= 0.63.4)
32 | - React-RCTActionSheet (= 0.63.4)
33 | - React-RCTAnimation (= 0.63.4)
34 | - React-RCTBlob (= 0.63.4)
35 | - React-RCTImage (= 0.63.4)
36 | - React-RCTLinking (= 0.63.4)
37 | - React-RCTNetwork (= 0.63.4)
38 | - React-RCTSettings (= 0.63.4)
39 | - React-RCTText (= 0.63.4)
40 | - React-RCTVibration (= 0.63.4)
41 | - React-callinvoker (0.63.4)
42 | - React-Core (0.63.4):
43 | - Folly (= 2020.01.13.00)
44 | - glog
45 | - React-Core/Default (= 0.63.4)
46 | - React-cxxreact (= 0.63.4)
47 | - React-jsi (= 0.63.4)
48 | - React-jsiexecutor (= 0.63.4)
49 | - Yoga
50 | - React-Core/CoreModulesHeaders (0.63.4):
51 | - Folly (= 2020.01.13.00)
52 | - glog
53 | - React-Core/Default
54 | - React-cxxreact (= 0.63.4)
55 | - React-jsi (= 0.63.4)
56 | - React-jsiexecutor (= 0.63.4)
57 | - Yoga
58 | - React-Core/Default (0.63.4):
59 | - Folly (= 2020.01.13.00)
60 | - glog
61 | - React-cxxreact (= 0.63.4)
62 | - React-jsi (= 0.63.4)
63 | - React-jsiexecutor (= 0.63.4)
64 | - Yoga
65 | - React-Core/DevSupport (0.63.4):
66 | - Folly (= 2020.01.13.00)
67 | - glog
68 | - React-Core/Default (= 0.63.4)
69 | - React-Core/RCTWebSocket (= 0.63.4)
70 | - React-cxxreact (= 0.63.4)
71 | - React-jsi (= 0.63.4)
72 | - React-jsiexecutor (= 0.63.4)
73 | - React-jsinspector (= 0.63.4)
74 | - Yoga
75 | - React-Core/RCTActionSheetHeaders (0.63.4):
76 | - Folly (= 2020.01.13.00)
77 | - glog
78 | - React-Core/Default
79 | - React-cxxreact (= 0.63.4)
80 | - React-jsi (= 0.63.4)
81 | - React-jsiexecutor (= 0.63.4)
82 | - Yoga
83 | - React-Core/RCTAnimationHeaders (0.63.4):
84 | - Folly (= 2020.01.13.00)
85 | - glog
86 | - React-Core/Default
87 | - React-cxxreact (= 0.63.4)
88 | - React-jsi (= 0.63.4)
89 | - React-jsiexecutor (= 0.63.4)
90 | - Yoga
91 | - React-Core/RCTBlobHeaders (0.63.4):
92 | - Folly (= 2020.01.13.00)
93 | - glog
94 | - React-Core/Default
95 | - React-cxxreact (= 0.63.4)
96 | - React-jsi (= 0.63.4)
97 | - React-jsiexecutor (= 0.63.4)
98 | - Yoga
99 | - React-Core/RCTImageHeaders (0.63.4):
100 | - Folly (= 2020.01.13.00)
101 | - glog
102 | - React-Core/Default
103 | - React-cxxreact (= 0.63.4)
104 | - React-jsi (= 0.63.4)
105 | - React-jsiexecutor (= 0.63.4)
106 | - Yoga
107 | - React-Core/RCTLinkingHeaders (0.63.4):
108 | - Folly (= 2020.01.13.00)
109 | - glog
110 | - React-Core/Default
111 | - React-cxxreact (= 0.63.4)
112 | - React-jsi (= 0.63.4)
113 | - React-jsiexecutor (= 0.63.4)
114 | - Yoga
115 | - React-Core/RCTNetworkHeaders (0.63.4):
116 | - Folly (= 2020.01.13.00)
117 | - glog
118 | - React-Core/Default
119 | - React-cxxreact (= 0.63.4)
120 | - React-jsi (= 0.63.4)
121 | - React-jsiexecutor (= 0.63.4)
122 | - Yoga
123 | - React-Core/RCTSettingsHeaders (0.63.4):
124 | - Folly (= 2020.01.13.00)
125 | - glog
126 | - React-Core/Default
127 | - React-cxxreact (= 0.63.4)
128 | - React-jsi (= 0.63.4)
129 | - React-jsiexecutor (= 0.63.4)
130 | - Yoga
131 | - React-Core/RCTTextHeaders (0.63.4):
132 | - Folly (= 2020.01.13.00)
133 | - glog
134 | - React-Core/Default
135 | - React-cxxreact (= 0.63.4)
136 | - React-jsi (= 0.63.4)
137 | - React-jsiexecutor (= 0.63.4)
138 | - Yoga
139 | - React-Core/RCTVibrationHeaders (0.63.4):
140 | - Folly (= 2020.01.13.00)
141 | - glog
142 | - React-Core/Default
143 | - React-cxxreact (= 0.63.4)
144 | - React-jsi (= 0.63.4)
145 | - React-jsiexecutor (= 0.63.4)
146 | - Yoga
147 | - React-Core/RCTWebSocket (0.63.4):
148 | - Folly (= 2020.01.13.00)
149 | - glog
150 | - React-Core/Default (= 0.63.4)
151 | - React-cxxreact (= 0.63.4)
152 | - React-jsi (= 0.63.4)
153 | - React-jsiexecutor (= 0.63.4)
154 | - Yoga
155 | - React-CoreModules (0.63.4):
156 | - FBReactNativeSpec (= 0.63.4)
157 | - Folly (= 2020.01.13.00)
158 | - RCTTypeSafety (= 0.63.4)
159 | - React-Core/CoreModulesHeaders (= 0.63.4)
160 | - React-jsi (= 0.63.4)
161 | - React-RCTImage (= 0.63.4)
162 | - ReactCommon/turbomodule/core (= 0.63.4)
163 | - React-cxxreact (0.63.4):
164 | - boost-for-react-native (= 1.63.0)
165 | - DoubleConversion
166 | - Folly (= 2020.01.13.00)
167 | - glog
168 | - React-callinvoker (= 0.63.4)
169 | - React-jsinspector (= 0.63.4)
170 | - React-jsi (0.63.4):
171 | - boost-for-react-native (= 1.63.0)
172 | - DoubleConversion
173 | - Folly (= 2020.01.13.00)
174 | - glog
175 | - React-jsi/Default (= 0.63.4)
176 | - React-jsi/Default (0.63.4):
177 | - boost-for-react-native (= 1.63.0)
178 | - DoubleConversion
179 | - Folly (= 2020.01.13.00)
180 | - glog
181 | - React-jsiexecutor (0.63.4):
182 | - DoubleConversion
183 | - Folly (= 2020.01.13.00)
184 | - glog
185 | - React-cxxreact (= 0.63.4)
186 | - React-jsi (= 0.63.4)
187 | - React-jsinspector (0.63.4)
188 | - React-RCTActionSheet (0.63.4):
189 | - React-Core/RCTActionSheetHeaders (= 0.63.4)
190 | - React-RCTAnimation (0.63.4):
191 | - FBReactNativeSpec (= 0.63.4)
192 | - Folly (= 2020.01.13.00)
193 | - RCTTypeSafety (= 0.63.4)
194 | - React-Core/RCTAnimationHeaders (= 0.63.4)
195 | - React-jsi (= 0.63.4)
196 | - ReactCommon/turbomodule/core (= 0.63.4)
197 | - React-RCTBlob (0.63.4):
198 | - FBReactNativeSpec (= 0.63.4)
199 | - Folly (= 2020.01.13.00)
200 | - React-Core/RCTBlobHeaders (= 0.63.4)
201 | - React-Core/RCTWebSocket (= 0.63.4)
202 | - React-jsi (= 0.63.4)
203 | - React-RCTNetwork (= 0.63.4)
204 | - ReactCommon/turbomodule/core (= 0.63.4)
205 | - React-RCTImage (0.63.4):
206 | - FBReactNativeSpec (= 0.63.4)
207 | - Folly (= 2020.01.13.00)
208 | - RCTTypeSafety (= 0.63.4)
209 | - React-Core/RCTImageHeaders (= 0.63.4)
210 | - React-jsi (= 0.63.4)
211 | - React-RCTNetwork (= 0.63.4)
212 | - ReactCommon/turbomodule/core (= 0.63.4)
213 | - React-RCTLinking (0.63.4):
214 | - FBReactNativeSpec (= 0.63.4)
215 | - React-Core/RCTLinkingHeaders (= 0.63.4)
216 | - React-jsi (= 0.63.4)
217 | - ReactCommon/turbomodule/core (= 0.63.4)
218 | - React-RCTNetwork (0.63.4):
219 | - FBReactNativeSpec (= 0.63.4)
220 | - Folly (= 2020.01.13.00)
221 | - RCTTypeSafety (= 0.63.4)
222 | - React-Core/RCTNetworkHeaders (= 0.63.4)
223 | - React-jsi (= 0.63.4)
224 | - ReactCommon/turbomodule/core (= 0.63.4)
225 | - React-RCTSettings (0.63.4):
226 | - FBReactNativeSpec (= 0.63.4)
227 | - Folly (= 2020.01.13.00)
228 | - RCTTypeSafety (= 0.63.4)
229 | - React-Core/RCTSettingsHeaders (= 0.63.4)
230 | - React-jsi (= 0.63.4)
231 | - ReactCommon/turbomodule/core (= 0.63.4)
232 | - React-RCTText (0.63.4):
233 | - React-Core/RCTTextHeaders (= 0.63.4)
234 | - React-RCTVibration (0.63.4):
235 | - FBReactNativeSpec (= 0.63.4)
236 | - Folly (= 2020.01.13.00)
237 | - React-Core/RCTVibrationHeaders (= 0.63.4)
238 | - React-jsi (= 0.63.4)
239 | - ReactCommon/turbomodule/core (= 0.63.4)
240 | - ReactCommon/turbomodule/core (0.63.4):
241 | - DoubleConversion
242 | - Folly (= 2020.01.13.00)
243 | - glog
244 | - React-callinvoker (= 0.63.4)
245 | - React-Core (= 0.63.4)
246 | - React-cxxreact (= 0.63.4)
247 | - React-jsi (= 0.63.4)
248 | - Yoga (1.14.0)
249 |
250 | DEPENDENCIES:
251 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
252 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
253 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
254 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
255 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
256 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
257 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
258 | - React (from `../node_modules/react-native/`)
259 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
260 | - React-Core (from `../node_modules/react-native/`)
261 | - React-Core/DevSupport (from `../node_modules/react-native/`)
262 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
263 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
264 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
265 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
266 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
267 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
268 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
269 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
270 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
271 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
272 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
273 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
274 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
275 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
276 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
277 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
278 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
279 |
280 | SPEC REPOS:
281 | trunk:
282 | - boost-for-react-native
283 |
284 | EXTERNAL SOURCES:
285 | DoubleConversion:
286 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
287 | FBLazyVector:
288 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
289 | FBReactNativeSpec:
290 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec"
291 | Folly:
292 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
293 | glog:
294 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
295 | RCTRequired:
296 | :path: "../node_modules/react-native/Libraries/RCTRequired"
297 | RCTTypeSafety:
298 | :path: "../node_modules/react-native/Libraries/TypeSafety"
299 | React:
300 | :path: "../node_modules/react-native/"
301 | React-callinvoker:
302 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
303 | React-Core:
304 | :path: "../node_modules/react-native/"
305 | React-CoreModules:
306 | :path: "../node_modules/react-native/React/CoreModules"
307 | React-cxxreact:
308 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
309 | React-jsi:
310 | :path: "../node_modules/react-native/ReactCommon/jsi"
311 | React-jsiexecutor:
312 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
313 | React-jsinspector:
314 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
315 | React-RCTActionSheet:
316 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
317 | React-RCTAnimation:
318 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
319 | React-RCTBlob:
320 | :path: "../node_modules/react-native/Libraries/Blob"
321 | React-RCTImage:
322 | :path: "../node_modules/react-native/Libraries/Image"
323 | React-RCTLinking:
324 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
325 | React-RCTNetwork:
326 | :path: "../node_modules/react-native/Libraries/Network"
327 | React-RCTSettings:
328 | :path: "../node_modules/react-native/Libraries/Settings"
329 | React-RCTText:
330 | :path: "../node_modules/react-native/Libraries/Text"
331 | React-RCTVibration:
332 | :path: "../node_modules/react-native/Libraries/Vibration"
333 | ReactCommon:
334 | :path: "../node_modules/react-native/ReactCommon"
335 | Yoga:
336 | :path: "../node_modules/react-native/ReactCommon/yoga"
337 |
338 | SPEC CHECKSUMS:
339 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
340 | DoubleConversion: cde416483dac037923206447da6e1454df403714
341 | FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
342 | FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
343 | Folly: b73c3869541e86821df3c387eb0af5f65addfab4
344 | glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
345 | RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e
346 | RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b
347 | React: b0a957a2c44da4113b0c4c9853d8387f8e64e615
348 | React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe
349 | React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b
350 | React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60
351 | React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3
352 | React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31
353 | React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949
354 | React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a
355 | React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336
356 | React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b
357 | React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0
358 | React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0
359 | React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2
360 | React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae
361 | React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a
362 | React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c
363 | React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d
364 | ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
365 | Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6
366 |
367 | PODFILE CHECKSUM: f76d3c03fdb785c3cde5caaa4a231c24e4be1241
368 |
369 | COCOAPODS: 1.9.3
370 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const blacklist = require('metro-config/src/defaults/blacklist');
3 | const escape = require('escape-string-regexp');
4 | const pak = require('../package.json');
5 |
6 | const root = path.resolve(__dirname, '..');
7 |
8 | const modules = Object.keys({
9 | ...pak.peerDependencies,
10 | });
11 |
12 | module.exports = {
13 | projectRoot: __dirname,
14 | watchFolders: [root],
15 |
16 | // We need to make sure that only one version is loaded for peerDependencies
17 | // So we blacklist them at the root, and alias them to the versions in example's node_modules
18 | resolver: {
19 | blacklistRE: blacklist(
20 | modules.map(
21 | (m) =>
22 | new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23 | )
24 | ),
25 |
26 | extraNodeModules: modules.reduce((acc, name) => {
27 | acc[name] = path.join(__dirname, 'node_modules', name);
28 | return acc;
29 | }, {}),
30 | },
31 |
32 | transformer: {
33 | getTransformOptions: async () => ({
34 | transform: {
35 | experimentalImportSupport: false,
36 | inlineRequires: true,
37 | },
38 | }),
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-clipboard-toast-example",
3 | "description": "Example app for react-native-clipboard-toast",
4 | "version": "0.0.1",
5 | "private": true,
6 | "scripts": {
7 | "android": "react-native run-android",
8 | "ios": "react-native run-ios",
9 | "start": "react-native start"
10 | },
11 | "dependencies": {
12 | "react": "16.13.1",
13 | "react-native": "0.63.4"
14 | },
15 | "devDependencies": {
16 | "@babel/core": "^7.12.10",
17 | "@babel/runtime": "^7.12.5",
18 | "babel-plugin-module-resolver": "^4.0.0",
19 | "metro-react-native-babel-preset": "^0.64.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/example/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { StyleSheet, View, Text, Clipboard, Image } from 'react-native';
3 | import ClipboardToast from 'react-native-clipboard-toast';
4 |
5 | console.disableYellowBox = true;
6 |
7 | export default function App() {
8 | const [copiedText, setCopiedText] = React.useState(
9 | 'Nothing to show, copy by clicking on some button'
10 | );
11 |
12 | const fetchCopiedText = async () => {
13 | const text = await Clipboard.getString();
14 | setCopiedText(text);
15 | };
16 |
17 | return (
18 |
19 |
23 |
24 |
25 |
37 |
38 |
39 |
40 |
55 |
56 |
57 |
58 |
74 |
75 |
76 |
77 |
87 |
88 |
89 | {`Copied Text:\n${copiedText}`}
92 |
93 | );
94 | }
95 |
96 | const styles = StyleSheet.create({
97 | container: {
98 | backgroundColor: '#FFFeee',
99 | // margin: 30,
100 | alignItems: 'center',
101 | flex: 1,
102 | flexDirection: 'column',
103 | paddingVertical: 25,
104 | },
105 | buttonContainer: {
106 | width: 250,
107 | flex: 1,
108 | justifyContent: 'center',
109 | },
110 | clipboardToastContainer: {
111 | backgroundColor: '#DDDDDD',
112 | padding: 10,
113 | borderRadius: 5,
114 | },
115 | clipboardText: {
116 | fontSize: 18,
117 | textAlign: 'center',
118 | },
119 | });
120 |
--------------------------------------------------------------------------------
/example/src/clipboard-toast-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/idanlevi1/react-native-clipboard-toast/8d555510704d4caaa185612b9b21a6da122183fc/example/src/clipboard-toast-icon.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-clipboard-toast",
3 | "version": "1.0.0",
4 | "description": "React Native Clipboard API with Animated toast message component",
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-clipboard-toast.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 | "commit-postfix": " --no-verify"
34 | },
35 | "keywords": [
36 | "react-native",
37 | "ios",
38 | "android"
39 | ],
40 | "repository": "https://github.com/idanlevi1/react-native-clipboard-toast",
41 | "author": "idan levi (https://github.com/idanlevi1)",
42 | "license": "MIT",
43 | "bugs": {
44 | "url": "https://github.com/idanlevi1/react-native-clipboard-toast/issues"
45 | },
46 | "homepage": "https://github.com/idanlevi1/react-native-clipboard-toast#readme",
47 | "publishConfig": {
48 | "registry": "https://registry.npmjs.org/"
49 | },
50 | "devDependencies": {
51 | "@commitlint/config-conventional": "^11.0.0",
52 | "@react-native-community/eslint-config": "^2.0.0",
53 | "@release-it/conventional-changelog": "^2.0.0",
54 | "@types/jest": "^26.0.0",
55 | "@types/react": "^16.9.19",
56 | "@types/react-native": "0.62.13",
57 | "commitlint": "^11.0.0",
58 | "eslint": "^7.2.0",
59 | "eslint-config-prettier": "^7.0.0",
60 | "eslint-plugin-prettier": "^3.1.3",
61 | "husky": "^4.2.5",
62 | "jest": "^26.0.1",
63 | "pod-install": "^0.1.0",
64 | "prettier": "^2.0.5",
65 | "react": "16.13.1",
66 | "react-native": "0.63.4",
67 | "react-native-builder-bob": "^",
68 | "release-it": "^14.2.2",
69 | "typescript": "^4.1.3"
70 | },
71 | "peerDependencies": {
72 | "react": "*",
73 | "react-native": "*"
74 | },
75 | "jest": {
76 | "preset": "react-native",
77 | "modulePathIgnorePatterns": [
78 | "/example/node_modules",
79 | "/lib/"
80 | ]
81 | },
82 | "husky": {
83 | "hooks": {
84 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
85 | "pre-commit": "yarn lint && yarn typescript"
86 | }
87 | },
88 | "commitlint": {
89 | "extends": [
90 | "@commitlint/config-conventional"
91 | ]
92 | },
93 | "release-it": {
94 | "git": {
95 | "commitMessage": "chore: release ${version}",
96 | "tagName": "v${version}"
97 | },
98 | "npm": {
99 | "publish": true
100 | },
101 | "github": {
102 | "release": true
103 | },
104 | "plugins": {
105 | "@release-it/conventional-changelog": {
106 | "preset": "angular"
107 | }
108 | }
109 | },
110 | "eslintConfig": {
111 | "root": true,
112 | "extends": [
113 | "@react-native-community",
114 | "prettier"
115 | ],
116 | "rules": {
117 | "prettier/prettier": [
118 | "error",
119 | {
120 | "quoteProps": "consistent",
121 | "singleQuote": true,
122 | "tabWidth": 2,
123 | "trailingComma": "es5",
124 | "useTabs": false
125 | }
126 | ]
127 | }
128 | },
129 | "eslintIgnore": [
130 | "node_modules/",
131 | "lib/"
132 | ],
133 | "prettier": {
134 | "quoteProps": "consistent",
135 | "singleQuote": true,
136 | "tabWidth": 2,
137 | "trailingComma": "es5",
138 | "useTabs": false
139 | },
140 | "react-native-builder-bob": {
141 | "source": "src",
142 | "output": "lib",
143 | "targets": [
144 | "commonjs",
145 | "module",
146 | [
147 | "typescript",
148 | {
149 | "project": "tsconfig.build.json"
150 | }
151 | ]
152 | ]
153 | },
154 | "dependencies": {
155 | "prop-types": "^15.7.2",
156 | "react-native-root-toast": "^3.2.1"
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/scripts/bootstrap.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const child_process = require('child_process');
3 |
4 | const root = path.resolve(__dirname, '..');
5 | const args = process.argv.slice(2);
6 | const options = {
7 | cwd: process.cwd(),
8 | env: process.env,
9 | stdio: 'inherit',
10 | encoding: 'utf-8',
11 | };
12 |
13 | let result;
14 |
15 | if (process.cwd() !== root || args.length) {
16 | // We're not in the root of the project, or additional arguments were passed
17 | // In this case, forward the command to `yarn`
18 | result = child_process.spawnSync('yarn', args, options);
19 | } else {
20 | // If `yarn` is run without arguments, perform bootstrap
21 | result = child_process.spawnSync('yarn', ['bootstrap'], options);
22 | }
23 |
24 | process.exitCode = result.status;
25 |
--------------------------------------------------------------------------------
/src/__tests__/index.test.tsx:
--------------------------------------------------------------------------------
1 | it.todo('write a test');
2 |
--------------------------------------------------------------------------------
/src/clipboard-toast.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { TouchableOpacity, Text, Clipboard } from 'react-native';
3 | import Toast from 'react-native-root-toast';
4 | import PropTypes from 'prop-types';
5 |
6 | export interface ClipboardToastProps {
7 | textToShow: string;
8 | textToCopy: string;
9 | toastText: string;
10 | containerStyle?: any;
11 | textStyle?: any;
12 | id?: any;
13 | accessibilityLabel?: string;
14 | toastDuration?: number;
15 | toastPosition?: string;
16 | toastDelay?: number;
17 | toastAnimation?: boolean;
18 | toastHideOnPress?: boolean;
19 | toastBackgroundColor?: any;
20 | toastTextColor?: any;
21 | toastOnShow?: any;
22 | }
23 |
24 | const ClipboardToast: React.FC = ({
25 | textToShow = '',
26 | textToCopy = '',
27 | toastText = 'Text is copied',
28 | containerStyle = {},
29 | textStyle = {},
30 | id = 'someKey',
31 | accessibilityLabel,
32 | toastDuration = 750,
33 | toastPosition,
34 | toastDelay = 0,
35 | toastAnimation = true,
36 | toastHideOnPress = true,
37 | toastBackgroundColor = null,
38 | toastTextColor = null,
39 | toastOnShow = () => {},
40 | }) => {
41 | const convertPosition = () => {
42 | switch ((toastPosition || '').toLowerCase()) {
43 | case 'top':
44 | return Toast.positions.TOP;
45 | case 'center':
46 | return Toast.positions.CENTER;
47 | default:
48 | return Toast.positions.BOTTOM;
49 | }
50 | };
51 |
52 | const onCopyToClipBoard = (clipboardText: string) => {
53 | Clipboard.setString(clipboardText);
54 | let toast = Toast.show(toastText, {
55 | duration: Toast.durations.LONG,
56 | position: convertPosition(),
57 | shadow: true,
58 | animation: toastAnimation,
59 | hideOnPress: toastHideOnPress,
60 | delay: toastDelay,
61 | backgroundColor: toastBackgroundColor,
62 | textColor: toastTextColor,
63 | onShow: toastOnShow,
64 | });
65 |
66 | setTimeout(function () {
67 | Toast.hide(toast);
68 | }, toastDuration + toastDelay);
69 | };
70 |
71 | return (
72 | onCopyToClipBoard(textToCopy)}
79 | >
80 | {textToShow}
81 |
82 | );
83 | };
84 |
85 | ClipboardToast.propTypes = {
86 | textToShow: PropTypes.string.isRequired,
87 | textToCopy: PropTypes.string.isRequired,
88 | toastText: PropTypes.string.isRequired,
89 | containerStyle: PropTypes.any,
90 | textStyle: PropTypes.any,
91 | id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
92 | accessibilityLabel: PropTypes.string,
93 | toastDuration: PropTypes.number,
94 | toastPosition: PropTypes.oneOf(['top', 'center', 'bottom']),
95 | toastDelay: PropTypes.number,
96 | toastAnimation: PropTypes.bool,
97 | toastHideOnPress: PropTypes.bool,
98 | toastBackgroundColor: PropTypes.any,
99 | toastTextColor: PropTypes.any,
100 | toastOnShow: PropTypes.func,
101 | };
102 |
103 | export default ClipboardToast;
104 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import ClipboardToast from './clipboard-toast';
2 |
3 | export default ClipboardToast;
4 |
--------------------------------------------------------------------------------
/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-clipboard-toast": ["./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 |
--------------------------------------------------------------------------------