├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .github └── images │ └── icon.png ├── .gitignore ├── .watchmanconfig ├── .yarnrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── android ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactnativenotificationsutils │ ├── NotificationsUtilsModule.java │ └── NotificationsUtilsPackage.java ├── babel.config.js ├── example ├── .bundle │ └── config ├── .node-version ├── .ruby-version ├── .watchmanconfig ├── Gemfile ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── notificationsutilsexample │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── notificationsutilsexample │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── CMakeLists.txt │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── .xcode.env │ ├── File.swift │ ├── NotificationsUtilsExample-Bridging-Header.h │ ├── NotificationsUtilsExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── NotificationsUtilsExample.xcscheme │ ├── NotificationsUtilsExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── NotificationsUtilsExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ ├── NotificationsUtilsExample.entitlements │ │ └── main.m │ ├── NotificationsUtilsExampleTests │ │ ├── Info.plist │ │ └── NotificationsUtilsExampleTests.m │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json ├── react-native.config.js ├── src │ └── App.tsx └── yarn.lock ├── ios ├── NotificationsUtils-Bridging-Header.h ├── NotificationsUtils.m ├── NotificationsUtils.swift └── NotificationsUtils.xcodeproj │ └── project.pbxproj ├── lefthook.yml ├── package.json ├── react-native-notifications-utils.podspec ├── scripts └── bootstrap.js ├── src ├── NotificationsUtilsModule.ts ├── __tests__ │ └── index.test.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:16 7 | working_directory: ~/project 8 | 9 | commands: 10 | attach_project: 11 | steps: 12 | - attach_workspace: 13 | at: ~/project 14 | 15 | jobs: 16 | install-dependencies: 17 | executor: default 18 | steps: 19 | - checkout 20 | - attach_project 21 | - restore_cache: 22 | keys: 23 | - dependencies-{{ checksum "package.json" }} 24 | - dependencies- 25 | - restore_cache: 26 | keys: 27 | - dependencies-example-{{ checksum "example/package.json" }} 28 | - dependencies-example- 29 | - run: 30 | name: Install dependencies 31 | command: | 32 | yarn install --cwd example --frozen-lockfile 33 | yarn install --frozen-lockfile 34 | - save_cache: 35 | key: dependencies-{{ checksum "package.json" }} 36 | paths: node_modules 37 | - save_cache: 38 | key: dependencies-example-{{ checksum "example/package.json" }} 39 | paths: example/node_modules 40 | - persist_to_workspace: 41 | root: . 42 | paths: . 43 | 44 | lint: 45 | executor: default 46 | steps: 47 | - attach_project 48 | - run: 49 | name: Lint files 50 | command: | 51 | yarn lint 52 | 53 | typescript: 54 | executor: default 55 | steps: 56 | - attach_project 57 | - run: 58 | name: Typecheck files 59 | command: | 60 | yarn typescript 61 | 62 | unit-tests: 63 | executor: default 64 | steps: 65 | - attach_project 66 | - run: 67 | name: Run unit tests 68 | command: | 69 | yarn test --coverage 70 | - store_artifacts: 71 | path: coverage 72 | destination: coverage 73 | 74 | build-package: 75 | executor: default 76 | steps: 77 | - attach_project 78 | - run: 79 | name: Build package 80 | command: | 81 | yarn prepare 82 | 83 | workflows: 84 | build-and-test: 85 | jobs: 86 | - install-dependencies 87 | - lint: 88 | requires: 89 | - install-dependencies 90 | - typescript: 91 | requires: 92 | - install-dependencies 93 | - unit-tests: 94 | requires: 95 | - install-dependencies 96 | - build-package: 97 | requires: 98 | - install-dependencies 99 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /.github/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/.github/images/icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .classpath 35 | .cxx 36 | .gradle 37 | .idea 38 | .project 39 | .settings 40 | local.properties 41 | android.iml 42 | 43 | # Cocoapods 44 | # 45 | example/ios/Pods 46 | 47 | # Ruby 48 | example/vendor/ 49 | 50 | # node.js 51 | # 52 | node_modules/ 53 | npm-debug.log 54 | yarn-debug.log 55 | yarn-error.log 56 | 57 | # BUCK 58 | buck-out/ 59 | \.buckd/ 60 | android/app/libs 61 | android/keystores/debug.keystore 62 | 63 | # Expo 64 | .expo/* 65 | 66 | # generated by bob 67 | lib/ 68 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # Override Yarn command so we can automatically setup the repo on running `yarn` 2 | 3 | yarn-path "scripts/bootstrap.js" 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # [0.3.0](https://github.com/Stringsaeed/react-native-notifications-utils/compare/v0.2.0...v0.3.0) (2022-11-02) 4 | 5 | 6 | ### Features 7 | 8 | * use `channelId` directly in `openSettings` ([48be8fc](https://github.com/Stringsaeed/react-native-notifications-utils/commit/48be8fcab6231ef2af17754b42dae625cf999f6f)) -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | We as members, contributors, and leaders pledge to make participation in our 7 | community a harassment-free experience for everyone, regardless of age, body 8 | size, visible or invisible disability, ethnicity, sex characteristics, gender 9 | identity and expression, level of experience, education, socio-economic status, 10 | nationality, personal appearance, race, caste, color, religion, or sexual 11 | identity and orientation. 12 | 13 | We pledge to act and interact in ways that contribute to an open, welcoming, 14 | diverse, inclusive, and healthy community. 15 | 16 | ## Our Standards 17 | 18 | Examples of behavior that contributes to a positive environment for our 19 | community include: 20 | 21 | * Demonstrating empathy and kindness toward other people 22 | * Being respectful of differing opinions, viewpoints, and experiences 23 | * Giving and gracefully accepting constructive feedback 24 | * Accepting responsibility and apologizing to those affected by our mistakes, 25 | and learning from the experience 26 | * Focusing on what is best not just for us as individuals, but for the overall 27 | community 28 | 29 | Examples of unacceptable behavior include: 30 | 31 | * The use of sexualized language or imagery, and sexual attention or advances of 32 | any kind 33 | * Trolling, insulting or derogatory comments, and personal or political attacks 34 | * Public or private harassment 35 | * Publishing others' private information, such as a physical or email address, 36 | without their explicit permission 37 | * Other conduct which could reasonably be considered inappropriate in a 38 | professional setting 39 | 40 | ## Enforcement Responsibilities 41 | 42 | Community leaders are responsible for clarifying and enforcing our standards of 43 | acceptable behavior and will take appropriate and fair corrective action in 44 | response to any behavior that they deem inappropriate, threatening, offensive, 45 | or harmful. 46 | 47 | Community leaders have the right and responsibility to remove, edit, or reject 48 | comments, commits, code, wiki edits, issues, and other contributions that are 49 | not aligned to this Code of Conduct, and will communicate reasons for moderation 50 | decisions when appropriate. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies within all community spaces, and also applies when 55 | an individual is officially representing the community in public spaces. 56 | Examples of representing our community include using an official e-mail address, 57 | posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. 59 | 60 | ## Enforcement 61 | 62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 63 | reported to the community leaders responsible for enforcement at 64 | [INSERT CONTACT METHOD]. 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 119 | version 2.1, available at 120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 121 | 122 | Community Impact Guidelines were inspired by 123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at 127 | [https://www.contributor-covenant.org/translations][translations]. 128 | 129 | [homepage]: https://www.contributor-covenant.org 130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 131 | [Mozilla CoC]: https://github.com/mozilla/diversity 132 | [FAQ]: https://www.contributor-covenant.org/faq 133 | [translations]: https://www.contributor-covenant.org/translations 134 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are always welcome, no matter how large or small! 4 | 5 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md). 6 | 7 | ## Development workflow 8 | 9 | To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: 10 | 11 | ```sh 12 | yarn 13 | ``` 14 | 15 | > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development. 16 | 17 | While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app. 18 | 19 | To start the packager: 20 | 21 | ```sh 22 | yarn example start 23 | ``` 24 | 25 | To run the example app on Android: 26 | 27 | ```sh 28 | yarn example android 29 | ``` 30 | 31 | To run the example app on iOS: 32 | 33 | ```sh 34 | yarn example ios 35 | ``` 36 | 37 | 38 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 39 | 40 | ```sh 41 | yarn typescript 42 | yarn lint 43 | ``` 44 | 45 | To fix formatting errors, run the following: 46 | 47 | ```sh 48 | yarn lint --fix 49 | ``` 50 | 51 | Remember to add tests for your change if possible. Run the unit tests by: 52 | 53 | ```sh 54 | yarn test 55 | ``` 56 | To edit the Objective-C files, open `example/ios/NotificationsUtilsExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-notifications-utils`. 57 | 58 | To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativenotificationsutils` under `Android`. 59 | ### Commit message convention 60 | 61 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 62 | 63 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 64 | - `feat`: new features, e.g. add new method to the module. 65 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 66 | - `docs`: changes into documentation, e.g. add usage example for the module.. 67 | - `test`: adding or updating tests, e.g. add integration tests using detox. 68 | - `chore`: tooling changes, e.g. change CI config. 69 | 70 | Our pre-commit hooks verify that your commit message matches this format when committing. 71 | 72 | ### Linting and tests 73 | 74 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 75 | 76 | 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. 77 | 78 | Our pre-commit hooks verify that the linter and tests pass when committing. 79 | 80 | ### Publishing to npm 81 | 82 | We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc. 83 | 84 | To publish new versions, run the following: 85 | 86 | ```sh 87 | yarn release 88 | ``` 89 | 90 | ### Scripts 91 | 92 | The `package.json` file contains various scripts for common tasks: 93 | 94 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 95 | - `yarn typescript`: type-check files with TypeScript. 96 | - `yarn lint`: lint files with ESLint. 97 | - `yarn test`: run unit tests with Jest. 98 | - `yarn example start`: start the Metro server for the example app. 99 | - `yarn example android`: run the example app on Android. 100 | - `yarn example ios`: run the example app on iOS. 101 | 102 | ### Sending a pull request 103 | 104 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). 105 | 106 | When you're sending a pull request: 107 | 108 | - Prefer small pull requests focused on one change. 109 | - Verify that linters and tests are passing. 110 | - Review the documentation to make sure it looks good. 111 | - Follow the pull request template when opening a pull request. 112 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 113 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Muhammed Saeed 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |
3 | React Native Notifications Utils logo 4 |
5 |
6 | 7 | # `react-native-notifications-utils` 8 | 9 | ## ✨ Features 10 | - Opening App Notifications Settings for Android and iOS 11 | 12 | - Typescript 13 | 14 | - Built for already in production app 15 | 16 | 17 | 18 | 19 | ## 🧱 Installation 20 | ```sh 21 | yarn add react-native-notifications-utils 22 | ``` 23 | 24 | ### iOS 25 | 26 | > 📝 **_NOTE:_** requires Xcode 14+ (iOS 16) 27 | 28 | ```sh 29 | cd ios && pod install 30 | ``` 31 | 32 | 33 | 34 | ## ⚙️ Usage 35 | 36 | ```typescript 37 | import NotificationsUtils from "react-native-notifications-utils"; 38 | 39 | // ... 40 | 41 | NotificationsUtils.openSettings(); 42 | ``` 43 | 44 | 45 | 46 | ## 📜 API 47 | 48 | ### `openSettings(channelId?: string)` 49 | API used to open the Platform specific System settings for the application. 50 | 51 | | Parameter | Type | Description | Android | iOS | 52 | | --------- | -------- | ------------------------------------------------------------------------------------------- | ------- | --- | 53 | | channelId | `string` | The channel id to open the settings for. If not provided, the default channel will be used. | ✅ | ❌ | 54 | 55 | - On Android: 56 | - API version is >= 26 with `channelId` will open the channel settings. if `channelI` is not provided, the app's notification settings will be opened. 57 | - API version is < 26, the application settings screen is opened 58 | 59 | - On iOS: 60 | - If the version of iOS is >= 15.4, the app's notification settings screen is displayed. 61 | - If the version of iOS is < 15.4, the app's settings screen is displayed. 62 | - for further details, see: 63 | - [Apple's iOS 16 documentation for `openNotificationSettingsURLString`]( https://developer.apple.com/documentation/uikit/uiapplication/4013180-opennotificationsettingsurlstrin) 64 | - [Apple's iOS 15.4 documentation for `UIApplicationOpenNotificationSettingsURLString`](https://developer.apple.com/documentation/uikit/uiapplicationopennotificationsettingsurlstring) 65 | - [Apple's documentation for `openSettingsURLString`](https://developer.apple.com/documentation/uikit/uiapplication/1623042-opensettingsurlstring). 66 | 67 | 68 | 69 | ## 🫂 Contributing 70 | 71 | See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. 72 | 73 | 74 | 75 | ## Author 76 | 77 | - [**@stringsaeed**](https://www.github.com/stringsaeed) 78 | 79 | 80 | 81 | ## License 82 | 83 | MIT 84 | 85 | 86 | 87 | ### TODO: 88 | 89 | - [ ] Add tests 90 | 91 | - [ ] Add support for request permissions 92 | 93 | - [ ] Keeps updated with new native features 94 | 95 | 96 | 97 | --- 98 | 99 | Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob) 100 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.3' 9 | } 10 | } 11 | 12 | def isNewArchitectureEnabled() { 13 | return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" 14 | } 15 | 16 | apply plugin: 'com.android.library' 17 | 18 | if (isNewArchitectureEnabled()) { 19 | apply plugin: 'com.facebook.react' 20 | } 21 | 22 | def getExtOrDefault(name) { 23 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['NotificationsUtils_' + name] 24 | } 25 | 26 | def getExtOrIntegerDefault(name) { 27 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['NotificationsUtils_' + name]).toInteger() 28 | } 29 | 30 | android { 31 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') 32 | 33 | defaultConfig { 34 | minSdkVersion getExtOrIntegerDefault('minSdkVersion') 35 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') 36 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 37 | } 38 | buildTypes { 39 | release { 40 | minifyEnabled false 41 | } 42 | } 43 | 44 | lintOptions { 45 | disable 'GradleCompatible' 46 | } 47 | 48 | compileOptions { 49 | sourceCompatibility JavaVersion.VERSION_1_8 50 | targetCompatibility JavaVersion.VERSION_1_8 51 | } 52 | 53 | } 54 | 55 | repositories { 56 | mavenCentral() 57 | google() 58 | 59 | def found = false 60 | def defaultDir = null 61 | def androidSourcesName = 'React Native sources' 62 | 63 | if (rootProject.ext.has('reactNativeAndroidRoot')) { 64 | defaultDir = rootProject.ext.get('reactNativeAndroidRoot') 65 | } else { 66 | defaultDir = new File( 67 | projectDir, 68 | '/../../../node_modules/react-native/android' 69 | ) 70 | } 71 | 72 | if (defaultDir.exists()) { 73 | maven { 74 | url defaultDir.toString() 75 | name androidSourcesName 76 | } 77 | 78 | logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") 79 | found = true 80 | } else { 81 | def parentDir = rootProject.projectDir 82 | 83 | 1.upto(5, { 84 | if (found) return true 85 | parentDir = parentDir.parentFile 86 | 87 | def androidSourcesDir = new File( 88 | parentDir, 89 | 'node_modules/react-native' 90 | ) 91 | 92 | def androidPrebuiltBinaryDir = new File( 93 | parentDir, 94 | 'node_modules/react-native/android' 95 | ) 96 | 97 | if (androidPrebuiltBinaryDir.exists()) { 98 | maven { 99 | url androidPrebuiltBinaryDir.toString() 100 | name androidSourcesName 101 | } 102 | 103 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") 104 | found = true 105 | } else if (androidSourcesDir.exists()) { 106 | maven { 107 | url androidSourcesDir.toString() 108 | name androidSourcesName 109 | } 110 | 111 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") 112 | found = true 113 | } 114 | }) 115 | } 116 | 117 | if (!found) { 118 | throw new GradleException( 119 | "${project.name}: unable to locate React Native android sources. " + 120 | "Ensure you have you installed React Native as a dependency in your project and try again." 121 | ) 122 | } 123 | } 124 | 125 | 126 | dependencies { 127 | //noinspection GradleDynamicVersion 128 | implementation "com.facebook.react:react-native:+" 129 | // From node_modules 130 | } 131 | 132 | if (isNewArchitectureEnabled()) { 133 | react { 134 | jsRootDir = file("../src/") 135 | libraryName = "NotificationsUtils" 136 | codegenJavaPackageName = "com.reactnativenotificationsutils" 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | NotificationsUtils_kotlinVersion=1.7.0 2 | NotificationsUtils_minSdkVersion=21 3 | NotificationsUtils_targetSdkVersion=31 4 | NotificationsUtils_compileSdkVersion=31 5 | NotificationsUtils_ndkversion=21.4.7075529 6 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativenotificationsutils/NotificationsUtilsModule.java: -------------------------------------------------------------------------------- 1 | package com.reactnativenotificationsutils; 2 | 3 | import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; 4 | 5 | import android.app.Activity; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.os.Build; 9 | import android.provider.Settings; 10 | 11 | import androidx.annotation.NonNull; 12 | import androidx.annotation.Nullable; 13 | 14 | import com.facebook.react.bridge.ReactApplicationContext; 15 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 16 | import com.facebook.react.bridge.ReactMethod; 17 | import com.facebook.react.module.annotations.ReactModule; 18 | 19 | @ReactModule(name = NotificationsUtilsModule.NAME) 20 | public class NotificationsUtilsModule extends ReactContextBaseJavaModule { 21 | public static final String NAME = "NotificationsUtils"; 22 | 23 | public NotificationsUtilsModule(ReactApplicationContext reactContext) { 24 | super(reactContext); 25 | } 26 | 27 | @Override 28 | @NonNull 29 | public String getName() { 30 | return NAME; 31 | } 32 | 33 | @ReactMethod 34 | public void openAppNotificationsSettings(String channelId) { 35 | final Activity activity = getCurrentActivity(); 36 | final Context context = getReactApplicationContext().getApplicationContext(); 37 | 38 | if (activity == null) { 39 | return; 40 | } 41 | 42 | Intent intent; 43 | if (Build.VERSION.SDK_INT >= 26) { 44 | if (channelId != null) { 45 | intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS); 46 | intent.putExtra(Settings.EXTRA_CHANNEL_ID, channelId); 47 | } else { 48 | intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS); 49 | } 50 | intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName()); 51 | } else { 52 | intent = new Intent(Settings.ACTION_APPLICATION_SETTINGS); 53 | } 54 | 55 | intent.setFlags(FLAG_ACTIVITY_NEW_TASK); 56 | 57 | activity.runOnUiThread(() -> context.startActivity(intent)); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativenotificationsutils/NotificationsUtilsPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactnativenotificationsutils; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.facebook.react.ReactPackage; 6 | import com.facebook.react.bridge.NativeModule; 7 | import com.facebook.react.bridge.ReactApplicationContext; 8 | import com.facebook.react.uimanager.ViewManager; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | public class NotificationsUtilsPackage implements ReactPackage { 15 | @NonNull 16 | @Override 17 | public List createNativeModules(@NonNull ReactApplicationContext reactContext) { 18 | List modules = new ArrayList<>(); 19 | modules.add(new NotificationsUtilsModule(reactContext)); 20 | return modules; 21 | } 22 | 23 | @NonNull 24 | @Override 25 | public List createViewManagers(@NonNull ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.node-version: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /example/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.notificationsutilsexample", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.notificationsutilsexample", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: true, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: "../../node_modules/react-native/react.gradle" 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get("enableHermes", false); 123 | 124 | /** 125 | * Architectures to build native code for. 126 | */ 127 | def reactNativeArchitectures() { 128 | def value = project.getProperties().get("reactNativeArchitectures") 129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 130 | } 131 | 132 | android { 133 | ndkVersion rootProject.ext.ndkVersion 134 | 135 | compileSdkVersion rootProject.ext.compileSdkVersion 136 | 137 | defaultConfig { 138 | applicationId "com.notificationsutilsexample" 139 | minSdkVersion rootProject.ext.minSdkVersion 140 | targetSdkVersion rootProject.ext.targetSdkVersion 141 | versionCode 1 142 | versionName "1.0" 143 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 144 | 145 | if (isNewArchitectureEnabled()) { 146 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 147 | externalNativeBuild { 148 | cmake { 149 | arguments "-DPROJECT_BUILD_DIR=$buildDir", 150 | "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 151 | "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", 152 | "-DNODE_MODULES_DIR=$rootDir/../node_modules", 153 | "-DANDROID_STL=c++_shared" 154 | } 155 | } 156 | if (!enableSeparateBuildPerCPUArchitecture) { 157 | ndk { 158 | abiFilters (*reactNativeArchitectures()) 159 | } 160 | } 161 | } 162 | } 163 | 164 | if (isNewArchitectureEnabled()) { 165 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 166 | externalNativeBuild { 167 | cmake { 168 | path "$projectDir/src/main/jni/CMakeLists.txt" 169 | } 170 | } 171 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 172 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 173 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 174 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 175 | into("$buildDir/react-ndk/exported") 176 | } 177 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 178 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 179 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 180 | into("$buildDir/react-ndk/exported") 181 | } 182 | afterEvaluate { 183 | // If you wish to add a custom TurboModule or component locally, 184 | // you should uncomment this line. 185 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 186 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 187 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 188 | 189 | // Due to a bug inside AGP, we have to explicitly set a dependency 190 | // between configureCMakeDebug* tasks and the preBuild tasks. 191 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 192 | configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) 193 | configureCMakeDebug.dependsOn(preDebugBuild) 194 | reactNativeArchitectures().each { architecture -> 195 | tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { 196 | dependsOn("preDebugBuild") 197 | } 198 | tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { 199 | dependsOn("preReleaseBuild") 200 | } 201 | } 202 | } 203 | } 204 | 205 | splits { 206 | abi { 207 | reset() 208 | enable enableSeparateBuildPerCPUArchitecture 209 | universalApk false // If true, also generate a universal APK 210 | include (*reactNativeArchitectures()) 211 | } 212 | } 213 | signingConfigs { 214 | debug { 215 | storeFile file('debug.keystore') 216 | storePassword 'android' 217 | keyAlias 'androiddebugkey' 218 | keyPassword 'android' 219 | } 220 | } 221 | buildTypes { 222 | debug { 223 | signingConfig signingConfigs.debug 224 | } 225 | release { 226 | // Caution! In production, you need to generate your own keystore file. 227 | // see https://reactnative.dev/docs/signed-apk-android. 228 | signingConfig signingConfigs.debug 229 | minifyEnabled enableProguardInReleaseBuilds 230 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 231 | } 232 | } 233 | 234 | // applicationVariants are e.g. debug, release 235 | applicationVariants.all { variant -> 236 | variant.outputs.each { output -> 237 | // For each separate APK per architecture, set a unique version code as described here: 238 | // https://developer.android.com/studio/build/configure-apk-splits.html 239 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 240 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 241 | def abi = output.getFilter(OutputFile.ABI) 242 | if (abi != null) { // null for the universal-debug, universal-release variants 243 | output.versionCodeOverride = 244 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 245 | } 246 | 247 | } 248 | } 249 | } 250 | 251 | dependencies { 252 | implementation fileTree(dir: "libs", include: ["*.jar"]) 253 | 254 | //noinspection GradleDynamicVersion 255 | implementation "com.facebook.react:react-native:+" // From node_modules 256 | 257 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 258 | 259 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 260 | exclude group:'com.facebook.fbjni' 261 | } 262 | 263 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 264 | exclude group:'com.facebook.flipper' 265 | exclude group:'com.squareup.okhttp3', module:'okhttp' 266 | } 267 | 268 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 269 | exclude group:'com.facebook.flipper' 270 | } 271 | 272 | if (enableHermes) { 273 | //noinspection GradleDynamicVersion 274 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 275 | exclude group:'com.facebook.fbjni' 276 | } 277 | } else { 278 | implementation jscFlavor 279 | } 280 | } 281 | 282 | if (isNewArchitectureEnabled()) { 283 | // If new architecture is enabled, we let you build RN from source 284 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 285 | // This will be applied to all the imported transtitive dependency. 286 | configurations.all { 287 | resolutionStrategy.dependencySubstitution { 288 | substitute(module("com.facebook.react:react-native")) 289 | .using(project(":ReactAndroid")) 290 | .because("On New Architecture we're building React Native from source") 291 | substitute(module("com.facebook.react:hermes-engine")) 292 | .using(project(":ReactAndroid:hermes-engine")) 293 | .because("On New Architecture we're building Hermes from source") 294 | } 295 | } 296 | } 297 | 298 | // Run this once to be able to run the application with BUCK 299 | // puts all compile dependencies into folder libs for BUCK to use 300 | task copyDownloadableDepsToLibs(type: Copy) { 301 | from configurations.implementation 302 | into 'libs' 303 | } 304 | 305 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 306 | 307 | def isNewArchitectureEnabled() { 308 | // To opt-in for the New Architecture, you can either: 309 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 310 | // - Invoke gradle with `-newArchEnabled=true` 311 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 312 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 313 | } 314 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/notificationsutilsexample/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and 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.notificationsutilsexample; 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.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/notificationsutilsexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.notificationsutilsexample; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | 7 | public class MainActivity extends ReactActivity { 8 | 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | protected String getMainComponentName() { 15 | return "NotificationsUtilsExample"; 16 | } 17 | 18 | /** 19 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 20 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 21 | * (Paper). 22 | */ 23 | @Override 24 | protected ReactActivityDelegate createReactActivityDelegate() { 25 | return new MainActivityDelegate(this, getMainComponentName()); 26 | } 27 | 28 | public static class MainActivityDelegate extends ReactActivityDelegate { 29 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 30 | super(activity, mainComponentName); 31 | } 32 | 33 | @Override 34 | protected ReactRootView createRootView() { 35 | ReactRootView reactRootView = new ReactRootView(getContext()); 36 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 37 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 38 | return reactRootView; 39 | } 40 | 41 | @Override 42 | protected boolean isConcurrentRootEnabled() { 43 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 44 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 45 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/notificationsutilsexample/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.notificationsutilsexample; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.config.ReactFeatureFlags; 11 | import com.facebook.soloader.SoLoader; 12 | import com.notificationsutilsexample.newarchitecture.MainApplicationReactNativeHost; 13 | import java.lang.reflect.InvocationTargetException; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | // packages.add(new MyReactNativePackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | private final ReactNativeHost mNewArchitectureNativeHost = 41 | new MainApplicationReactNativeHost(this); 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 46 | return mNewArchitectureNativeHost; 47 | } else { 48 | return mReactNativeHost; 49 | } 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | // If you opted-in for the New Architecture, we enable the TurboModule system 56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 57 | SoLoader.init(this, /* native exopackage */ false); 58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 59 | } 60 | 61 | /** 62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 64 | * 65 | * @param context 66 | * @param reactInstanceManager 67 | */ 68 | private static void initializeFlipper( 69 | Context context, ReactInstanceManager reactInstanceManager) { 70 | if (BuildConfig.DEBUG) { 71 | try { 72 | /* 73 | We use reflection here to pick up the class that initializes Flipper, 74 | since Flipper library is not available in release mode 75 | */ 76 | Class aClass = Class.forName("com.notificationsutilsexample.ReactNativeFlipper"); 77 | aClass 78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 79 | .invoke(null, context, reactInstanceManager); 80 | } catch (ClassNotFoundException e) { 81 | e.printStackTrace(); 82 | } catch (NoSuchMethodException e) { 83 | e.printStackTrace(); 84 | } catch (IllegalAccessException e) { 85 | e.printStackTrace(); 86 | } catch (InvocationTargetException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/notificationsutilsexample/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.notificationsutilsexample.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.FabricJSIModuleProvider; 20 | import com.facebook.react.fabric.ReactNativeConfig; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.notificationsutilsexample.BuildConfig; 23 | import com.notificationsutilsexample.newarchitecture.components.MainComponentsRegistry; 24 | import com.notificationsutilsexample.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | ReactNativeConfig.DEFAULT_CONFIG, 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/notificationsutilsexample/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.notificationsutilsexample.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/notificationsutilsexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.notificationsutilsexample.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("notificationsutilsexample_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | 3 | # Define the library name here. 4 | project(notificationsutilsexample_appmodules) 5 | 6 | # This file includes all the necessary to let you build your application with the New Architecture. 7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace facebook { 7 | namespace react { 8 | 9 | std::shared_ptr MainApplicationModuleProvider( 10 | const std::string &moduleName, 11 | const JavaTurboModule::InitParams ¶ms) { 12 | // Here you can provide your own module provider for TurboModules coming from 13 | // either your application or from external libraries. The approach to follow 14 | // is similar to the following (for a library called `samplelibrary`: 15 | // 16 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 17 | // if (module != nullptr) { 18 | // return module; 19 | // } 20 | // return rncore_ModuleProvider(moduleName, params); 21 | 22 | // Module providers autolinked by RN CLI 23 | auto rncli_module = rncli_ModuleProvider(moduleName, params); 24 | if (rncli_module != nullptr) { 25 | return rncli_module; 26 | } 27 | 28 | return rncore_ModuleProvider(moduleName, params); 29 | } 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string &moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string &name, 26 | const std::shared_ptr &jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string &name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | const std::string &name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/notificationsutilsexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string &name, 25 | const std::shared_ptr &jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string &name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(const std::string &name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace facebook { 10 | namespace react { 11 | 12 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 13 | 14 | std::shared_ptr 15 | MainComponentsRegistry::sharedProviderRegistry() { 16 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 17 | 18 | // Autolinked providers registered by RN CLI 19 | rncli_registerProviders(providerRegistry); 20 | 21 | // Custom Fabric Components go here. You can register custom 22 | // components coming from your App or from 3rd party libraries here. 23 | // 24 | // providerRegistry->add(concreteComponentDescriptorProvider< 25 | // AocViewerComponentDescriptor>()); 26 | return providerRegistry; 27 | } 28 | 29 | jni::local_ref 30 | MainComponentsRegistry::initHybrid( 31 | jni::alias_ref, 32 | ComponentFactory *delegate) { 33 | auto instance = makeCxxInstance(delegate); 34 | 35 | auto buildRegistryFunction = 36 | [](EventDispatcher::Weak const &eventDispatcher, 37 | ContextContainer::Shared const &contextContainer) 38 | -> ComponentDescriptorRegistry::Shared { 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 40 | ->createComponentDescriptorRegistry( 41 | {eventDispatcher, contextContainer}); 42 | 43 | auto mutableRegistry = 44 | std::const_pointer_cast(registry); 45 | 46 | mutableRegistry->setFallbackComponentDescriptor( 47 | std::make_shared( 48 | ComponentDescriptorParameters{ 49 | eventDispatcher, contextContainer, nullptr})); 50 | 51 | return registry; 52 | }; 53 | 54 | delegate->buildRegistryFunction = buildRegistryFunction; 55 | return instance; 56 | } 57 | 58 | void MainComponentsRegistry::registerNatives() { 59 | registerHybrid({ 60 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 61 | }); 62 | } 63 | 64 | } // namespace react 65 | } // namespace facebook 66 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/notificationsutilsexample/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/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/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NotificationsUtilsExample 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 = "31.0.0" 6 | minSdkVersion = 21 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | 10 | if (System.properties['os.arch'] == "aarch64") { 11 | // For M1 Users we need to use the NDK 24 which added support for aarch64 12 | ndkVersion = "24.0.8215888" 13 | } else { 14 | // Otherwise we default to the side-by-side NDK version from AGP. 15 | ndkVersion = "21.4.7075529" 16 | } 17 | } 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | dependencies { 23 | classpath("com.android.tools.build:gradle:7.2.1") 24 | classpath("com.facebook.react:react-native-gradle-plugin") 25 | classpath("de.undercouch:gradle-download-task:5.0.1") 26 | // NOTE: Do not place your application dependencies here; they belong 27 | // in the individual module build.gradle files 28 | } 29 | } 30 | 31 | allprojects { 32 | repositories { 33 | maven { 34 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 35 | url("$rootDir/../node_modules/react-native/android") 36 | } 37 | maven { 38 | // Android JSC is installed from npm 39 | url("$rootDir/../node_modules/jsc-android/dist") 40 | } 41 | mavenCentral { 42 | // We don't want to fetch react-native from Maven Central as there are 43 | // older versions over there. 44 | content { 45 | excludeGroup "com.facebook.react" 46 | } 47 | } 48 | google() 49 | maven { url 'https://www.jitpack.io' } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /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: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stringsaeed/react-native-notifications-utils/fbf93005c45c6a1f0c2dec9774e5534fd87d9ba5/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original 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 POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'NotificationsUtilsExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } 12 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NotificationsUtilsExample", 3 | "displayName": "NotificationsUtilsExample" 4 | } -------------------------------------------------------------------------------- /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.js: -------------------------------------------------------------------------------- 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/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/ios/File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // NotificationsUtilsExample 4 | // 5 | 6 | import Foundation 7 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample-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/NotificationsUtilsExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* NotificationsUtilsExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* NotificationsUtilsExampleTests.m */; }; 11 | 0C80B921A6F3F58F76C31292 /* libPods-NotificationsUtilsExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-NotificationsUtilsExample.a */; }; 12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 7699B88040F8A987B510C191 /* libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a */; }; 16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 25 | remoteInfo = NotificationsUtilsExample; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 00E356EE1AD99517003FC87E /* NotificationsUtilsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NotificationsUtilsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 00E356F21AD99517003FC87E /* NotificationsUtilsExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NotificationsUtilsExampleTests.m; sourceTree = ""; }; 33 | 13B07F961A680F5B00A75B9A /* NotificationsUtilsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NotificationsUtilsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = NotificationsUtilsExample/AppDelegate.h; sourceTree = ""; }; 35 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = NotificationsUtilsExample/AppDelegate.mm; sourceTree = ""; }; 36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = NotificationsUtilsExample/Images.xcassets; sourceTree = ""; }; 37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = NotificationsUtilsExample/Info.plist; sourceTree = ""; }; 38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = NotificationsUtilsExample/main.m; sourceTree = ""; }; 39 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 3B4392A12AC88292D35C810B /* Pods-NotificationsUtilsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationsUtilsExample.debug.xcconfig"; path = "Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample.debug.xcconfig"; sourceTree = ""; }; 41 | 5709B34CF0A7D63546082F79 /* Pods-NotificationsUtilsExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationsUtilsExample.release.xcconfig"; path = "Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample.release.xcconfig"; sourceTree = ""; }; 42 | 5B7EB9410499542E8C5724F5 /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.debug.xcconfig"; sourceTree = ""; }; 43 | 5DCACB8F33CDC322A6C60F78 /* libPods-NotificationsUtilsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NotificationsUtilsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 635F61D62912669000481753 /* NotificationsUtilsExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = NotificationsUtilsExample.entitlements; path = NotificationsUtilsExample/NotificationsUtilsExample.entitlements; sourceTree = ""; }; 45 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = NotificationsUtilsExample/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 89C6BE57DB24E9ADA2F236DE /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.release.xcconfig"; path = "Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.release.xcconfig"; sourceTree = ""; }; 47 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 7699B88040F8A987B510C191 /* libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 0C80B921A6F3F58F76C31292 /* libPods-NotificationsUtilsExample.a in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 00E356EF1AD99517003FC87E /* NotificationsUtilsExampleTests */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 00E356F21AD99517003FC87E /* NotificationsUtilsExampleTests.m */, 74 | 00E356F01AD99517003FC87E /* Supporting Files */, 75 | ); 76 | path = NotificationsUtilsExampleTests; 77 | sourceTree = ""; 78 | }; 79 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 00E356F11AD99517003FC87E /* Info.plist */, 83 | ); 84 | name = "Supporting Files"; 85 | sourceTree = ""; 86 | }; 87 | 13B07FAE1A68108700A75B9A /* NotificationsUtilsExample */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 635F61D62912669000481753 /* NotificationsUtilsExample.entitlements */, 91 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 92 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 93 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 94 | 13B07FB61A68108700A75B9A /* Info.plist */, 95 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 96 | 13B07FB71A68108700A75B9A /* main.m */, 97 | ); 98 | name = NotificationsUtilsExample; 99 | sourceTree = ""; 100 | }; 101 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 105 | 5DCACB8F33CDC322A6C60F78 /* libPods-NotificationsUtilsExample.a */, 106 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-NotificationsUtilsExample-NotificationsUtilsExampleTests.a */, 107 | ); 108 | name = Frameworks; 109 | sourceTree = ""; 110 | }; 111 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | ); 115 | name = Libraries; 116 | sourceTree = ""; 117 | }; 118 | 83CBB9F61A601CBA00E9B192 = { 119 | isa = PBXGroup; 120 | children = ( 121 | 13B07FAE1A68108700A75B9A /* NotificationsUtilsExample */, 122 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 123 | 00E356EF1AD99517003FC87E /* NotificationsUtilsExampleTests */, 124 | 83CBBA001A601CBA00E9B192 /* Products */, 125 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 126 | BBD78D7AC51CEA395F1C20DB /* Pods */, 127 | ); 128 | indentWidth = 2; 129 | sourceTree = ""; 130 | tabWidth = 2; 131 | usesTabs = 0; 132 | }; 133 | 83CBBA001A601CBA00E9B192 /* Products */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 13B07F961A680F5B00A75B9A /* NotificationsUtilsExample.app */, 137 | 00E356EE1AD99517003FC87E /* NotificationsUtilsExampleTests.xctest */, 138 | ); 139 | name = Products; 140 | sourceTree = ""; 141 | }; 142 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 3B4392A12AC88292D35C810B /* Pods-NotificationsUtilsExample.debug.xcconfig */, 146 | 5709B34CF0A7D63546082F79 /* Pods-NotificationsUtilsExample.release.xcconfig */, 147 | 5B7EB9410499542E8C5724F5 /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.debug.xcconfig */, 148 | 89C6BE57DB24E9ADA2F236DE /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.release.xcconfig */, 149 | ); 150 | path = Pods; 151 | sourceTree = ""; 152 | }; 153 | /* End PBXGroup section */ 154 | 155 | /* Begin PBXNativeTarget section */ 156 | 00E356ED1AD99517003FC87E /* NotificationsUtilsExampleTests */ = { 157 | isa = PBXNativeTarget; 158 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "NotificationsUtilsExampleTests" */; 159 | buildPhases = ( 160 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 161 | 00E356EA1AD99517003FC87E /* Sources */, 162 | 00E356EB1AD99517003FC87E /* Frameworks */, 163 | 00E356EC1AD99517003FC87E /* Resources */, 164 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, 165 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 171 | ); 172 | name = NotificationsUtilsExampleTests; 173 | productName = NotificationsUtilsExampleTests; 174 | productReference = 00E356EE1AD99517003FC87E /* NotificationsUtilsExampleTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | 13B07F861A680F5B00A75B9A /* NotificationsUtilsExample */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NotificationsUtilsExample" */; 180 | buildPhases = ( 181 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 182 | FD10A7F022414F080027D42C /* Start Packager */, 183 | 13B07F871A680F5B00A75B9A /* Sources */, 184 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 185 | 13B07F8E1A680F5B00A75B9A /* Resources */, 186 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 187 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 188 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | ); 194 | name = NotificationsUtilsExample; 195 | productName = NotificationsUtilsExample; 196 | productReference = 13B07F961A680F5B00A75B9A /* NotificationsUtilsExample.app */; 197 | productType = "com.apple.product-type.application"; 198 | }; 199 | /* End PBXNativeTarget section */ 200 | 201 | /* Begin PBXProject section */ 202 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 203 | isa = PBXProject; 204 | attributes = { 205 | LastUpgradeCheck = 1210; 206 | TargetAttributes = { 207 | 00E356ED1AD99517003FC87E = { 208 | CreatedOnToolsVersion = 6.2; 209 | TestTargetID = 13B07F861A680F5B00A75B9A; 210 | }; 211 | 13B07F861A680F5B00A75B9A = { 212 | LastSwiftMigration = 1120; 213 | }; 214 | }; 215 | }; 216 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NotificationsUtilsExample" */; 217 | compatibilityVersion = "Xcode 12.0"; 218 | developmentRegion = en; 219 | hasScannedForEncodings = 0; 220 | knownRegions = ( 221 | en, 222 | Base, 223 | ); 224 | mainGroup = 83CBB9F61A601CBA00E9B192; 225 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 226 | projectDirPath = ""; 227 | projectRoot = ""; 228 | targets = ( 229 | 13B07F861A680F5B00A75B9A /* NotificationsUtilsExample */, 230 | 00E356ED1AD99517003FC87E /* NotificationsUtilsExampleTests */, 231 | ); 232 | }; 233 | /* End PBXProject section */ 234 | 235 | /* Begin PBXResourcesBuildPhase section */ 236 | 00E356EC1AD99517003FC87E /* Resources */ = { 237 | isa = PBXResourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 248 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXResourcesBuildPhase section */ 253 | 254 | /* Begin PBXShellScriptBuildPhase section */ 255 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 256 | isa = PBXShellScriptBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | inputPaths = ( 261 | "$(SRCROOT)/.xcode.env.local", 262 | "$(SRCROOT)/.xcode.env", 263 | ); 264 | name = "Bundle React Native code and images"; 265 | outputPaths = ( 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | shellPath = /bin/sh; 269 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 270 | }; 271 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 272 | isa = PBXShellScriptBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | inputFileListPaths = ( 277 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", 278 | ); 279 | name = "[CP] Embed Pods Frameworks"; 280 | outputFileListPaths = ( 281 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | shellPath = /bin/sh; 285 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-frameworks.sh\"\n"; 286 | showEnvVarsInLog = 0; 287 | }; 288 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 289 | isa = PBXShellScriptBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | ); 293 | inputFileListPaths = ( 294 | ); 295 | inputPaths = ( 296 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 297 | "${PODS_ROOT}/Manifest.lock", 298 | ); 299 | name = "[CP] Check Pods Manifest.lock"; 300 | outputFileListPaths = ( 301 | ); 302 | outputPaths = ( 303 | "$(DERIVED_FILE_DIR)/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-checkManifestLockResult.txt", 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | 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"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputFileListPaths = ( 316 | ); 317 | inputPaths = ( 318 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 319 | "${PODS_ROOT}/Manifest.lock", 320 | ); 321 | name = "[CP] Check Pods Manifest.lock"; 322 | outputFileListPaths = ( 323 | ); 324 | outputPaths = ( 325 | "$(DERIVED_FILE_DIR)/Pods-NotificationsUtilsExample-checkManifestLockResult.txt", 326 | ); 327 | runOnlyForDeploymentPostprocessing = 0; 328 | shellPath = /bin/sh; 329 | 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"; 330 | showEnvVarsInLog = 0; 331 | }; 332 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { 333 | isa = PBXShellScriptBuildPhase; 334 | buildActionMask = 2147483647; 335 | files = ( 336 | ); 337 | inputFileListPaths = ( 338 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 339 | ); 340 | name = "[CP] Embed Pods Frameworks"; 341 | outputFileListPaths = ( 342 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | shellPath = /bin/sh; 346 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-frameworks.sh\"\n"; 347 | showEnvVarsInLog = 0; 348 | }; 349 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 350 | isa = PBXShellScriptBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | ); 354 | inputFileListPaths = ( 355 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-resources-${CONFIGURATION}-input-files.xcfilelist", 356 | ); 357 | name = "[CP] Copy Pods Resources"; 358 | outputFileListPaths = ( 359 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-resources-${CONFIGURATION}-output-files.xcfilelist", 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | shellPath = /bin/sh; 363 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample/Pods-NotificationsUtilsExample-resources.sh\"\n"; 364 | showEnvVarsInLog = 0; 365 | }; 366 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 367 | isa = PBXShellScriptBuildPhase; 368 | buildActionMask = 2147483647; 369 | files = ( 370 | ); 371 | inputFileListPaths = ( 372 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", 373 | ); 374 | name = "[CP] Copy Pods Resources"; 375 | outputFileListPaths = ( 376 | "${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | shellPath = /bin/sh; 380 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests/Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests-resources.sh\"\n"; 381 | showEnvVarsInLog = 0; 382 | }; 383 | FD10A7F022414F080027D42C /* Start Packager */ = { 384 | isa = PBXShellScriptBuildPhase; 385 | buildActionMask = 2147483647; 386 | files = ( 387 | ); 388 | inputFileListPaths = ( 389 | ); 390 | inputPaths = ( 391 | ); 392 | name = "Start Packager"; 393 | outputFileListPaths = ( 394 | ); 395 | outputPaths = ( 396 | ); 397 | runOnlyForDeploymentPostprocessing = 0; 398 | shellPath = /bin/sh; 399 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 400 | showEnvVarsInLog = 0; 401 | }; 402 | /* End PBXShellScriptBuildPhase section */ 403 | 404 | /* Begin PBXSourcesBuildPhase section */ 405 | 00E356EA1AD99517003FC87E /* Sources */ = { 406 | isa = PBXSourcesBuildPhase; 407 | buildActionMask = 2147483647; 408 | files = ( 409 | 00E356F31AD99517003FC87E /* NotificationsUtilsExampleTests.m in Sources */, 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | 13B07F871A680F5B00A75B9A /* Sources */ = { 414 | isa = PBXSourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 418 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 419 | ); 420 | runOnlyForDeploymentPostprocessing = 0; 421 | }; 422 | /* End PBXSourcesBuildPhase section */ 423 | 424 | /* Begin PBXTargetDependency section */ 425 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 426 | isa = PBXTargetDependency; 427 | target = 13B07F861A680F5B00A75B9A /* NotificationsUtilsExample */; 428 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 429 | }; 430 | /* End PBXTargetDependency section */ 431 | 432 | /* Begin XCBuildConfiguration section */ 433 | 00E356F61AD99517003FC87E /* Debug */ = { 434 | isa = XCBuildConfiguration; 435 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.debug.xcconfig */; 436 | buildSettings = { 437 | BUNDLE_LOADER = "$(TEST_HOST)"; 438 | GCC_PREPROCESSOR_DEFINITIONS = ( 439 | "DEBUG=1", 440 | "$(inherited)", 441 | ); 442 | INFOPLIST_FILE = NotificationsUtilsExampleTests/Info.plist; 443 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 444 | LD_RUNPATH_SEARCH_PATHS = ( 445 | "$(inherited)", 446 | "@executable_path/Frameworks", 447 | "@loader_path/Frameworks", 448 | ); 449 | OTHER_LDFLAGS = ( 450 | "-ObjC", 451 | "-lc++", 452 | "$(inherited)", 453 | ); 454 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NotificationsUtilsExample.app/NotificationsUtilsExample"; 457 | }; 458 | name = Debug; 459 | }; 460 | 00E356F71AD99517003FC87E /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-NotificationsUtilsExample-NotificationsUtilsExampleTests.release.xcconfig */; 463 | buildSettings = { 464 | BUNDLE_LOADER = "$(TEST_HOST)"; 465 | COPY_PHASE_STRIP = NO; 466 | INFOPLIST_FILE = NotificationsUtilsExampleTests/Info.plist; 467 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 468 | LD_RUNPATH_SEARCH_PATHS = ( 469 | "$(inherited)", 470 | "@executable_path/Frameworks", 471 | "@loader_path/Frameworks", 472 | ); 473 | OTHER_LDFLAGS = ( 474 | "-ObjC", 475 | "-lc++", 476 | "$(inherited)", 477 | ); 478 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NotificationsUtilsExample.app/NotificationsUtilsExample"; 481 | }; 482 | name = Release; 483 | }; 484 | 13B07F941A680F5B00A75B9A /* Debug */ = { 485 | isa = XCBuildConfiguration; 486 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-NotificationsUtilsExample.debug.xcconfig */; 487 | buildSettings = { 488 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 489 | CLANG_ENABLE_MODULES = YES; 490 | CODE_SIGN_ENTITLEMENTS = NotificationsUtilsExample/NotificationsUtilsExample.entitlements; 491 | CURRENT_PROJECT_VERSION = 1; 492 | DEVELOPMENT_TEAM = V3HN8HXZYK; 493 | ENABLE_BITCODE = NO; 494 | INFOPLIST_FILE = NotificationsUtilsExample/Info.plist; 495 | LD_RUNPATH_SEARCH_PATHS = ( 496 | "$(inherited)", 497 | "@executable_path/Frameworks", 498 | ); 499 | OTHER_LDFLAGS = ( 500 | "$(inherited)", 501 | "-ObjC", 502 | "-lc++", 503 | ); 504 | PRODUCT_BUNDLE_IDENTIFIER = com.stringsaeed.notifications; 505 | PRODUCT_NAME = NotificationsUtilsExample; 506 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 507 | SWIFT_VERSION = 5.0; 508 | VERSIONING_SYSTEM = "apple-generic"; 509 | }; 510 | name = Debug; 511 | }; 512 | 13B07F951A680F5B00A75B9A /* Release */ = { 513 | isa = XCBuildConfiguration; 514 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-NotificationsUtilsExample.release.xcconfig */; 515 | buildSettings = { 516 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 517 | CLANG_ENABLE_MODULES = YES; 518 | CODE_SIGN_ENTITLEMENTS = NotificationsUtilsExample/NotificationsUtilsExample.entitlements; 519 | CURRENT_PROJECT_VERSION = 1; 520 | DEVELOPMENT_TEAM = V3HN8HXZYK; 521 | INFOPLIST_FILE = NotificationsUtilsExample/Info.plist; 522 | LD_RUNPATH_SEARCH_PATHS = ( 523 | "$(inherited)", 524 | "@executable_path/Frameworks", 525 | ); 526 | OTHER_LDFLAGS = ( 527 | "$(inherited)", 528 | "-ObjC", 529 | "-lc++", 530 | ); 531 | PRODUCT_BUNDLE_IDENTIFIER = com.stringsaeed.notifications; 532 | PRODUCT_NAME = NotificationsUtilsExample; 533 | SWIFT_VERSION = 5.0; 534 | VERSIONING_SYSTEM = "apple-generic"; 535 | }; 536 | name = Release; 537 | }; 538 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 539 | isa = XCBuildConfiguration; 540 | buildSettings = { 541 | ALWAYS_SEARCH_USER_PATHS = NO; 542 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 543 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 544 | CLANG_CXX_LIBRARY = "libc++"; 545 | CLANG_ENABLE_MODULES = YES; 546 | CLANG_ENABLE_OBJC_ARC = YES; 547 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 548 | CLANG_WARN_BOOL_CONVERSION = YES; 549 | CLANG_WARN_COMMA = YES; 550 | CLANG_WARN_CONSTANT_CONVERSION = YES; 551 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 552 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 553 | CLANG_WARN_EMPTY_BODY = YES; 554 | CLANG_WARN_ENUM_CONVERSION = YES; 555 | CLANG_WARN_INFINITE_RECURSION = YES; 556 | CLANG_WARN_INT_CONVERSION = YES; 557 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 558 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 559 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 560 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 561 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 562 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 563 | CLANG_WARN_STRICT_PROTOTYPES = YES; 564 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 565 | CLANG_WARN_UNREACHABLE_CODE = YES; 566 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 567 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 568 | COPY_PHASE_STRIP = NO; 569 | ENABLE_STRICT_OBJC_MSGSEND = YES; 570 | ENABLE_TESTABILITY = YES; 571 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 572 | GCC_C_LANGUAGE_STANDARD = gnu99; 573 | GCC_DYNAMIC_NO_PIC = NO; 574 | GCC_NO_COMMON_BLOCKS = YES; 575 | GCC_OPTIMIZATION_LEVEL = 0; 576 | GCC_PREPROCESSOR_DEFINITIONS = ( 577 | "DEBUG=1", 578 | "$(inherited)", 579 | ); 580 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 581 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 582 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 583 | GCC_WARN_UNDECLARED_SELECTOR = YES; 584 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 585 | GCC_WARN_UNUSED_FUNCTION = YES; 586 | GCC_WARN_UNUSED_VARIABLE = YES; 587 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 588 | LD_RUNPATH_SEARCH_PATHS = ( 589 | /usr/lib/swift, 590 | "$(inherited)", 591 | ); 592 | LIBRARY_SEARCH_PATHS = ( 593 | "\"$(SDKROOT)/usr/lib/swift\"", 594 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 595 | "\"$(inherited)\"", 596 | ); 597 | MTL_ENABLE_DEBUG_INFO = YES; 598 | ONLY_ACTIVE_ARCH = YES; 599 | OTHER_CPLUSPLUSFLAGS = ( 600 | "$(OTHER_CFLAGS)", 601 | "-DFOLLY_NO_CONFIG", 602 | "-DFOLLY_MOBILE=1", 603 | "-DFOLLY_USE_LIBCPP=1", 604 | ); 605 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 606 | SDKROOT = iphoneos; 607 | }; 608 | name = Debug; 609 | }; 610 | 83CBBA211A601CBA00E9B192 /* Release */ = { 611 | isa = XCBuildConfiguration; 612 | buildSettings = { 613 | ALWAYS_SEARCH_USER_PATHS = NO; 614 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 615 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 616 | CLANG_CXX_LIBRARY = "libc++"; 617 | CLANG_ENABLE_MODULES = YES; 618 | CLANG_ENABLE_OBJC_ARC = YES; 619 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 620 | CLANG_WARN_BOOL_CONVERSION = YES; 621 | CLANG_WARN_COMMA = YES; 622 | CLANG_WARN_CONSTANT_CONVERSION = YES; 623 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 624 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 625 | CLANG_WARN_EMPTY_BODY = YES; 626 | CLANG_WARN_ENUM_CONVERSION = YES; 627 | CLANG_WARN_INFINITE_RECURSION = YES; 628 | CLANG_WARN_INT_CONVERSION = YES; 629 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 630 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 631 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 632 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 633 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 634 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 635 | CLANG_WARN_STRICT_PROTOTYPES = YES; 636 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 637 | CLANG_WARN_UNREACHABLE_CODE = YES; 638 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 639 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 640 | COPY_PHASE_STRIP = YES; 641 | ENABLE_NS_ASSERTIONS = NO; 642 | ENABLE_STRICT_OBJC_MSGSEND = YES; 643 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; 644 | GCC_C_LANGUAGE_STANDARD = gnu99; 645 | GCC_NO_COMMON_BLOCKS = YES; 646 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 647 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 648 | GCC_WARN_UNDECLARED_SELECTOR = YES; 649 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 650 | GCC_WARN_UNUSED_FUNCTION = YES; 651 | GCC_WARN_UNUSED_VARIABLE = YES; 652 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 653 | LD_RUNPATH_SEARCH_PATHS = ( 654 | /usr/lib/swift, 655 | "$(inherited)", 656 | ); 657 | LIBRARY_SEARCH_PATHS = ( 658 | "\"$(SDKROOT)/usr/lib/swift\"", 659 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 660 | "\"$(inherited)\"", 661 | ); 662 | MTL_ENABLE_DEBUG_INFO = NO; 663 | OTHER_CPLUSPLUSFLAGS = ( 664 | "$(OTHER_CFLAGS)", 665 | "-DFOLLY_NO_CONFIG", 666 | "-DFOLLY_MOBILE=1", 667 | "-DFOLLY_USE_LIBCPP=1", 668 | ); 669 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 670 | SDKROOT = iphoneos; 671 | VALIDATE_PRODUCT = YES; 672 | }; 673 | name = Release; 674 | }; 675 | /* End XCBuildConfiguration section */ 676 | 677 | /* Begin XCConfigurationList section */ 678 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "NotificationsUtilsExampleTests" */ = { 679 | isa = XCConfigurationList; 680 | buildConfigurations = ( 681 | 00E356F61AD99517003FC87E /* Debug */, 682 | 00E356F71AD99517003FC87E /* Release */, 683 | ); 684 | defaultConfigurationIsVisible = 0; 685 | defaultConfigurationName = Release; 686 | }; 687 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "NotificationsUtilsExample" */ = { 688 | isa = XCConfigurationList; 689 | buildConfigurations = ( 690 | 13B07F941A680F5B00A75B9A /* Debug */, 691 | 13B07F951A680F5B00A75B9A /* Release */, 692 | ); 693 | defaultConfigurationIsVisible = 0; 694 | defaultConfigurationName = Release; 695 | }; 696 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "NotificationsUtilsExample" */ = { 697 | isa = XCConfigurationList; 698 | buildConfigurations = ( 699 | 83CBBA201A601CBA00E9B192 /* Debug */, 700 | 83CBBA211A601CBA00E9B192 /* Release */, 701 | ); 702 | defaultConfigurationIsVisible = 0; 703 | defaultConfigurationName = Release; 704 | }; 705 | /* End XCConfigurationList section */ 706 | }; 707 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 708 | } 709 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample.xcodeproj/xcshareddata/xcschemes/NotificationsUtilsExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 20 | 21 | @interface AppDelegate () { 22 | RCTTurboModuleManager *_turboModuleManager; 23 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 24 | std::shared_ptr _reactNativeConfig; 25 | facebook::react::ContextContainer::Shared _contextContainer; 26 | } 27 | @end 28 | #endif 29 | 30 | @implementation AppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | RCTAppSetupPrepareApp(application); 35 | 36 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 37 | 38 | #if RCT_NEW_ARCH_ENABLED 39 | _contextContainer = std::make_shared(); 40 | _reactNativeConfig = std::make_shared(); 41 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 42 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 43 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 44 | #endif 45 | 46 | NSDictionary *initProps = [self prepareInitialProps]; 47 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"NotificationsUtilsExample", initProps); 48 | 49 | if (@available(iOS 13.0, *)) { 50 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 51 | } else { 52 | rootView.backgroundColor = [UIColor whiteColor]; 53 | } 54 | 55 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 56 | UIViewController *rootViewController = [UIViewController new]; 57 | rootViewController.view = rootView; 58 | self.window.rootViewController = rootViewController; 59 | [self.window makeKeyAndVisible]; 60 | return YES; 61 | } 62 | 63 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 64 | /// 65 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 66 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 67 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 68 | - (BOOL)concurrentRootEnabled 69 | { 70 | // Switch this bool to turn on and off the concurrent root 71 | return true; 72 | } 73 | 74 | - (NSDictionary *)prepareInitialProps 75 | { 76 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 77 | 78 | #ifdef RCT_NEW_ARCH_ENABLED 79 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 80 | #endif 81 | 82 | return initProps; 83 | } 84 | 85 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 86 | { 87 | #if DEBUG 88 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 89 | #else 90 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 91 | #endif 92 | } 93 | 94 | #if RCT_NEW_ARCH_ENABLED 95 | 96 | #pragma mark - RCTCxxBridgeDelegate 97 | 98 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 99 | { 100 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 101 | delegate:self 102 | jsInvoker:bridge.jsCallInvoker]; 103 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 104 | } 105 | 106 | #pragma mark RCTTurboModuleManagerDelegate 107 | 108 | - (Class)getModuleClassFromName:(const char *)name 109 | { 110 | return RCTCoreModulesClassProvider(name); 111 | } 112 | 113 | - (std::shared_ptr)getTurboModule:(const std::string &)name 114 | jsInvoker:(std::shared_ptr)jsInvoker 115 | { 116 | return nullptr; 117 | } 118 | 119 | - (std::shared_ptr)getTurboModule:(const std::string &)name 120 | initParams: 121 | (const facebook::react::ObjCTurboModule::InitParams &)params 122 | { 123 | return nullptr; 124 | } 125 | 126 | - (id)getModuleInstanceFromClass:(Class)moduleClass 127 | { 128 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 129 | } 130 | 131 | #endif 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NotificationsUtilsExample 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | NSUserNotificationsUsageDescription 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/NotificationsUtilsExample/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/NotificationsUtilsExample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExample/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/NotificationsUtilsExampleTests/NotificationsUtilsExampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface NotificationsUtilsExampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation NotificationsUtilsExampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /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, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'NotificationsUtilsExample' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | permissions_path = '../node_modules/react-native-permissions/ios' 14 | pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications" 15 | 16 | 17 | use_react_native!( 18 | :path => config[:reactNativePath], 19 | # Hermes is now enabled by default. Disable by setting this flag to false. 20 | # Upcoming versions of React Native may rely on get_default_flags(), but 21 | # we make it explicit here to aid in the React Native upgrade process. 22 | :hermes_enabled => true, 23 | :fabric_enabled => flags[:fabric_enabled], 24 | # Enables Flipper. 25 | # 26 | # Note that if you have use_frameworks! enabled, Flipper will not work and 27 | # you should disable the next line. 28 | :flipper_configuration => FlipperConfiguration.enabled, 29 | # An absolute path to your application root. 30 | :app_path => "#{Pod::Config.instance.installation_root}/.." 31 | ) 32 | 33 | target 'NotificationsUtilsExampleTests' do 34 | inherit! :complete 35 | # Pods for testing 36 | end 37 | 38 | post_install do |installer| 39 | react_native_post_install( 40 | installer, 41 | # Set `mac_catalyst_enabled` to `true` in order to apply patches 42 | # necessary for Mac Catalyst builds 43 | :mac_catalyst_enabled => false 44 | ) 45 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.70.4) 6 | - FBReactNativeSpec (0.70.4): 7 | - RCT-Folly (= 2021.07.22.00) 8 | - RCTRequired (= 0.70.4) 9 | - RCTTypeSafety (= 0.70.4) 10 | - React-Core (= 0.70.4) 11 | - React-jsi (= 0.70.4) 12 | - ReactCommon/turbomodule/core (= 0.70.4) 13 | - Flipper (0.125.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.2.0.1) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.10): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.1100) 26 | - Flipper-Glog (0.5.0.5) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.125.0): 31 | - FlipperKit/Core (= 0.125.0) 32 | - FlipperKit/Core (0.125.0): 33 | - Flipper (~> 0.125.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - SocketRocket (~> 0.6.0) 39 | - FlipperKit/CppBridge (0.125.0): 40 | - Flipper (~> 0.125.0) 41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0): 42 | - Flipper-Folly (~> 2.6) 43 | - FlipperKit/FBDefines (0.125.0) 44 | - FlipperKit/FKPortForwarding (0.125.0): 45 | - CocoaAsyncSocket (~> 7.6) 46 | - Flipper-PeerTalk (~> 0.0.4) 47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0) 48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0): 49 | - FlipperKit/Core 50 | - FlipperKit/FlipperKitHighlightOverlay 51 | - FlipperKit/FlipperKitLayoutTextSearchable 52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0): 53 | - FlipperKit/Core 54 | - FlipperKit/FlipperKitHighlightOverlay 55 | - FlipperKit/FlipperKitLayoutHelpers 56 | - YogaKit (~> 1.18) 57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0): 58 | - FlipperKit/Core 59 | - FlipperKit/FlipperKitHighlightOverlay 60 | - FlipperKit/FlipperKitLayoutHelpers 61 | - FlipperKit/FlipperKitLayoutIOSDescriptors 62 | - FlipperKit/FlipperKitLayoutTextSearchable 63 | - YogaKit (~> 1.18) 64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0) 65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0): 66 | - FlipperKit/Core 67 | - FlipperKit/FlipperKitReactPlugin (0.125.0): 68 | - FlipperKit/Core 69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0): 70 | - FlipperKit/Core 71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0): 72 | - FlipperKit/Core 73 | - FlipperKit/FlipperKitNetworkPlugin 74 | - fmt (6.2.1) 75 | - glog (0.3.5) 76 | - hermes-engine (0.70.4) 77 | - libevent (2.1.12) 78 | - OpenSSL-Universal (1.1.1100) 79 | - Permission-Notifications (3.6.1): 80 | - RNPermissions 81 | - RCT-Folly (2021.07.22.00): 82 | - boost 83 | - DoubleConversion 84 | - fmt (~> 6.2.1) 85 | - glog 86 | - RCT-Folly/Default (= 2021.07.22.00) 87 | - RCT-Folly/Default (2021.07.22.00): 88 | - boost 89 | - DoubleConversion 90 | - fmt (~> 6.2.1) 91 | - glog 92 | - RCT-Folly/Futures (2021.07.22.00): 93 | - boost 94 | - DoubleConversion 95 | - fmt (~> 6.2.1) 96 | - glog 97 | - libevent 98 | - RCTRequired (0.70.4) 99 | - RCTTypeSafety (0.70.4): 100 | - FBLazyVector (= 0.70.4) 101 | - RCTRequired (= 0.70.4) 102 | - React-Core (= 0.70.4) 103 | - React (0.70.4): 104 | - React-Core (= 0.70.4) 105 | - React-Core/DevSupport (= 0.70.4) 106 | - React-Core/RCTWebSocket (= 0.70.4) 107 | - React-RCTActionSheet (= 0.70.4) 108 | - React-RCTAnimation (= 0.70.4) 109 | - React-RCTBlob (= 0.70.4) 110 | - React-RCTImage (= 0.70.4) 111 | - React-RCTLinking (= 0.70.4) 112 | - React-RCTNetwork (= 0.70.4) 113 | - React-RCTSettings (= 0.70.4) 114 | - React-RCTText (= 0.70.4) 115 | - React-RCTVibration (= 0.70.4) 116 | - React-bridging (0.70.4): 117 | - RCT-Folly (= 2021.07.22.00) 118 | - React-jsi (= 0.70.4) 119 | - React-callinvoker (0.70.4) 120 | - React-Codegen (0.70.4): 121 | - FBReactNativeSpec (= 0.70.4) 122 | - RCT-Folly (= 2021.07.22.00) 123 | - RCTRequired (= 0.70.4) 124 | - RCTTypeSafety (= 0.70.4) 125 | - React-Core (= 0.70.4) 126 | - React-jsi (= 0.70.4) 127 | - React-jsiexecutor (= 0.70.4) 128 | - ReactCommon/turbomodule/core (= 0.70.4) 129 | - React-Core (0.70.4): 130 | - glog 131 | - RCT-Folly (= 2021.07.22.00) 132 | - React-Core/Default (= 0.70.4) 133 | - React-cxxreact (= 0.70.4) 134 | - React-jsi (= 0.70.4) 135 | - React-jsiexecutor (= 0.70.4) 136 | - React-perflogger (= 0.70.4) 137 | - Yoga 138 | - React-Core/CoreModulesHeaders (0.70.4): 139 | - glog 140 | - RCT-Folly (= 2021.07.22.00) 141 | - React-Core/Default 142 | - React-cxxreact (= 0.70.4) 143 | - React-jsi (= 0.70.4) 144 | - React-jsiexecutor (= 0.70.4) 145 | - React-perflogger (= 0.70.4) 146 | - Yoga 147 | - React-Core/Default (0.70.4): 148 | - glog 149 | - RCT-Folly (= 2021.07.22.00) 150 | - React-cxxreact (= 0.70.4) 151 | - React-jsi (= 0.70.4) 152 | - React-jsiexecutor (= 0.70.4) 153 | - React-perflogger (= 0.70.4) 154 | - Yoga 155 | - React-Core/DevSupport (0.70.4): 156 | - glog 157 | - RCT-Folly (= 2021.07.22.00) 158 | - React-Core/Default (= 0.70.4) 159 | - React-Core/RCTWebSocket (= 0.70.4) 160 | - React-cxxreact (= 0.70.4) 161 | - React-jsi (= 0.70.4) 162 | - React-jsiexecutor (= 0.70.4) 163 | - React-jsinspector (= 0.70.4) 164 | - React-perflogger (= 0.70.4) 165 | - Yoga 166 | - React-Core/RCTActionSheetHeaders (0.70.4): 167 | - glog 168 | - RCT-Folly (= 2021.07.22.00) 169 | - React-Core/Default 170 | - React-cxxreact (= 0.70.4) 171 | - React-jsi (= 0.70.4) 172 | - React-jsiexecutor (= 0.70.4) 173 | - React-perflogger (= 0.70.4) 174 | - Yoga 175 | - React-Core/RCTAnimationHeaders (0.70.4): 176 | - glog 177 | - RCT-Folly (= 2021.07.22.00) 178 | - React-Core/Default 179 | - React-cxxreact (= 0.70.4) 180 | - React-jsi (= 0.70.4) 181 | - React-jsiexecutor (= 0.70.4) 182 | - React-perflogger (= 0.70.4) 183 | - Yoga 184 | - React-Core/RCTBlobHeaders (0.70.4): 185 | - glog 186 | - RCT-Folly (= 2021.07.22.00) 187 | - React-Core/Default 188 | - React-cxxreact (= 0.70.4) 189 | - React-jsi (= 0.70.4) 190 | - React-jsiexecutor (= 0.70.4) 191 | - React-perflogger (= 0.70.4) 192 | - Yoga 193 | - React-Core/RCTImageHeaders (0.70.4): 194 | - glog 195 | - RCT-Folly (= 2021.07.22.00) 196 | - React-Core/Default 197 | - React-cxxreact (= 0.70.4) 198 | - React-jsi (= 0.70.4) 199 | - React-jsiexecutor (= 0.70.4) 200 | - React-perflogger (= 0.70.4) 201 | - Yoga 202 | - React-Core/RCTLinkingHeaders (0.70.4): 203 | - glog 204 | - RCT-Folly (= 2021.07.22.00) 205 | - React-Core/Default 206 | - React-cxxreact (= 0.70.4) 207 | - React-jsi (= 0.70.4) 208 | - React-jsiexecutor (= 0.70.4) 209 | - React-perflogger (= 0.70.4) 210 | - Yoga 211 | - React-Core/RCTNetworkHeaders (0.70.4): 212 | - glog 213 | - RCT-Folly (= 2021.07.22.00) 214 | - React-Core/Default 215 | - React-cxxreact (= 0.70.4) 216 | - React-jsi (= 0.70.4) 217 | - React-jsiexecutor (= 0.70.4) 218 | - React-perflogger (= 0.70.4) 219 | - Yoga 220 | - React-Core/RCTSettingsHeaders (0.70.4): 221 | - glog 222 | - RCT-Folly (= 2021.07.22.00) 223 | - React-Core/Default 224 | - React-cxxreact (= 0.70.4) 225 | - React-jsi (= 0.70.4) 226 | - React-jsiexecutor (= 0.70.4) 227 | - React-perflogger (= 0.70.4) 228 | - Yoga 229 | - React-Core/RCTTextHeaders (0.70.4): 230 | - glog 231 | - RCT-Folly (= 2021.07.22.00) 232 | - React-Core/Default 233 | - React-cxxreact (= 0.70.4) 234 | - React-jsi (= 0.70.4) 235 | - React-jsiexecutor (= 0.70.4) 236 | - React-perflogger (= 0.70.4) 237 | - Yoga 238 | - React-Core/RCTVibrationHeaders (0.70.4): 239 | - glog 240 | - RCT-Folly (= 2021.07.22.00) 241 | - React-Core/Default 242 | - React-cxxreact (= 0.70.4) 243 | - React-jsi (= 0.70.4) 244 | - React-jsiexecutor (= 0.70.4) 245 | - React-perflogger (= 0.70.4) 246 | - Yoga 247 | - React-Core/RCTWebSocket (0.70.4): 248 | - glog 249 | - RCT-Folly (= 2021.07.22.00) 250 | - React-Core/Default (= 0.70.4) 251 | - React-cxxreact (= 0.70.4) 252 | - React-jsi (= 0.70.4) 253 | - React-jsiexecutor (= 0.70.4) 254 | - React-perflogger (= 0.70.4) 255 | - Yoga 256 | - React-CoreModules (0.70.4): 257 | - RCT-Folly (= 2021.07.22.00) 258 | - RCTTypeSafety (= 0.70.4) 259 | - React-Codegen (= 0.70.4) 260 | - React-Core/CoreModulesHeaders (= 0.70.4) 261 | - React-jsi (= 0.70.4) 262 | - React-RCTImage (= 0.70.4) 263 | - ReactCommon/turbomodule/core (= 0.70.4) 264 | - React-cxxreact (0.70.4): 265 | - boost (= 1.76.0) 266 | - DoubleConversion 267 | - glog 268 | - RCT-Folly (= 2021.07.22.00) 269 | - React-callinvoker (= 0.70.4) 270 | - React-jsi (= 0.70.4) 271 | - React-jsinspector (= 0.70.4) 272 | - React-logger (= 0.70.4) 273 | - React-perflogger (= 0.70.4) 274 | - React-runtimeexecutor (= 0.70.4) 275 | - React-hermes (0.70.4): 276 | - DoubleConversion 277 | - glog 278 | - hermes-engine 279 | - RCT-Folly (= 2021.07.22.00) 280 | - RCT-Folly/Futures (= 2021.07.22.00) 281 | - React-cxxreact (= 0.70.4) 282 | - React-jsi (= 0.70.4) 283 | - React-jsiexecutor (= 0.70.4) 284 | - React-jsinspector (= 0.70.4) 285 | - React-perflogger (= 0.70.4) 286 | - React-jsi (0.70.4): 287 | - boost (= 1.76.0) 288 | - DoubleConversion 289 | - glog 290 | - RCT-Folly (= 2021.07.22.00) 291 | - React-jsi/Default (= 0.70.4) 292 | - React-jsi/Default (0.70.4): 293 | - boost (= 1.76.0) 294 | - DoubleConversion 295 | - glog 296 | - RCT-Folly (= 2021.07.22.00) 297 | - React-jsiexecutor (0.70.4): 298 | - DoubleConversion 299 | - glog 300 | - RCT-Folly (= 2021.07.22.00) 301 | - React-cxxreact (= 0.70.4) 302 | - React-jsi (= 0.70.4) 303 | - React-perflogger (= 0.70.4) 304 | - React-jsinspector (0.70.4) 305 | - React-logger (0.70.4): 306 | - glog 307 | - react-native-notifications-utils (0.3.0): 308 | - React-Core 309 | - React-perflogger (0.70.4) 310 | - React-RCTActionSheet (0.70.4): 311 | - React-Core/RCTActionSheetHeaders (= 0.70.4) 312 | - React-RCTAnimation (0.70.4): 313 | - RCT-Folly (= 2021.07.22.00) 314 | - RCTTypeSafety (= 0.70.4) 315 | - React-Codegen (= 0.70.4) 316 | - React-Core/RCTAnimationHeaders (= 0.70.4) 317 | - React-jsi (= 0.70.4) 318 | - ReactCommon/turbomodule/core (= 0.70.4) 319 | - React-RCTBlob (0.70.4): 320 | - RCT-Folly (= 2021.07.22.00) 321 | - React-Codegen (= 0.70.4) 322 | - React-Core/RCTBlobHeaders (= 0.70.4) 323 | - React-Core/RCTWebSocket (= 0.70.4) 324 | - React-jsi (= 0.70.4) 325 | - React-RCTNetwork (= 0.70.4) 326 | - ReactCommon/turbomodule/core (= 0.70.4) 327 | - React-RCTImage (0.70.4): 328 | - RCT-Folly (= 2021.07.22.00) 329 | - RCTTypeSafety (= 0.70.4) 330 | - React-Codegen (= 0.70.4) 331 | - React-Core/RCTImageHeaders (= 0.70.4) 332 | - React-jsi (= 0.70.4) 333 | - React-RCTNetwork (= 0.70.4) 334 | - ReactCommon/turbomodule/core (= 0.70.4) 335 | - React-RCTLinking (0.70.4): 336 | - React-Codegen (= 0.70.4) 337 | - React-Core/RCTLinkingHeaders (= 0.70.4) 338 | - React-jsi (= 0.70.4) 339 | - ReactCommon/turbomodule/core (= 0.70.4) 340 | - React-RCTNetwork (0.70.4): 341 | - RCT-Folly (= 2021.07.22.00) 342 | - RCTTypeSafety (= 0.70.4) 343 | - React-Codegen (= 0.70.4) 344 | - React-Core/RCTNetworkHeaders (= 0.70.4) 345 | - React-jsi (= 0.70.4) 346 | - ReactCommon/turbomodule/core (= 0.70.4) 347 | - React-RCTSettings (0.70.4): 348 | - RCT-Folly (= 2021.07.22.00) 349 | - RCTTypeSafety (= 0.70.4) 350 | - React-Codegen (= 0.70.4) 351 | - React-Core/RCTSettingsHeaders (= 0.70.4) 352 | - React-jsi (= 0.70.4) 353 | - ReactCommon/turbomodule/core (= 0.70.4) 354 | - React-RCTText (0.70.4): 355 | - React-Core/RCTTextHeaders (= 0.70.4) 356 | - React-RCTVibration (0.70.4): 357 | - RCT-Folly (= 2021.07.22.00) 358 | - React-Codegen (= 0.70.4) 359 | - React-Core/RCTVibrationHeaders (= 0.70.4) 360 | - React-jsi (= 0.70.4) 361 | - ReactCommon/turbomodule/core (= 0.70.4) 362 | - React-runtimeexecutor (0.70.4): 363 | - React-jsi (= 0.70.4) 364 | - ReactCommon/turbomodule/core (0.70.4): 365 | - DoubleConversion 366 | - glog 367 | - RCT-Folly (= 2021.07.22.00) 368 | - React-bridging (= 0.70.4) 369 | - React-callinvoker (= 0.70.4) 370 | - React-Core (= 0.70.4) 371 | - React-cxxreact (= 0.70.4) 372 | - React-jsi (= 0.70.4) 373 | - React-logger (= 0.70.4) 374 | - React-perflogger (= 0.70.4) 375 | - RNPermissions (3.6.1): 376 | - React-Core 377 | - SocketRocket (0.6.0) 378 | - Yoga (1.14.0) 379 | - YogaKit (1.18.1): 380 | - Yoga (~> 1.14) 381 | 382 | DEPENDENCIES: 383 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 384 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 385 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 386 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 387 | - Flipper (= 0.125.0) 388 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 389 | - Flipper-DoubleConversion (= 3.2.0.1) 390 | - Flipper-Fmt (= 7.1.7) 391 | - Flipper-Folly (= 2.6.10) 392 | - Flipper-Glog (= 0.5.0.5) 393 | - Flipper-PeerTalk (= 0.0.4) 394 | - Flipper-RSocket (= 1.4.3) 395 | - FlipperKit (= 0.125.0) 396 | - FlipperKit/Core (= 0.125.0) 397 | - FlipperKit/CppBridge (= 0.125.0) 398 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0) 399 | - FlipperKit/FBDefines (= 0.125.0) 400 | - FlipperKit/FKPortForwarding (= 0.125.0) 401 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0) 402 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0) 403 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0) 404 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0) 405 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0) 406 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0) 407 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0) 408 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 409 | - hermes-engine (from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`) 410 | - libevent (~> 2.1.12) 411 | - OpenSSL-Universal (= 1.1.1100) 412 | - Permission-Notifications (from `../node_modules/react-native-permissions/ios/Notifications`) 413 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 414 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 415 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 416 | - React (from `../node_modules/react-native/`) 417 | - React-bridging (from `../node_modules/react-native/ReactCommon`) 418 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 419 | - React-Codegen (from `build/generated/ios`) 420 | - React-Core (from `../node_modules/react-native/`) 421 | - React-Core/DevSupport (from `../node_modules/react-native/`) 422 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 423 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 424 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 425 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`) 426 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 427 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 428 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 429 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 430 | - react-native-notifications-utils (from `../..`) 431 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 432 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 433 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 434 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 435 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 436 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 437 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 438 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 439 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 440 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 441 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 442 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 443 | - RNPermissions (from `../node_modules/react-native-permissions`) 444 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 445 | 446 | SPEC REPOS: 447 | trunk: 448 | - CocoaAsyncSocket 449 | - Flipper 450 | - Flipper-Boost-iOSX 451 | - Flipper-DoubleConversion 452 | - Flipper-Fmt 453 | - Flipper-Folly 454 | - Flipper-Glog 455 | - Flipper-PeerTalk 456 | - Flipper-RSocket 457 | - FlipperKit 458 | - fmt 459 | - libevent 460 | - OpenSSL-Universal 461 | - SocketRocket 462 | - YogaKit 463 | 464 | EXTERNAL SOURCES: 465 | boost: 466 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 467 | DoubleConversion: 468 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 469 | FBLazyVector: 470 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 471 | FBReactNativeSpec: 472 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 473 | glog: 474 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 475 | hermes-engine: 476 | :podspec: "../node_modules/react-native/sdks/hermes/hermes-engine.podspec" 477 | Permission-Notifications: 478 | :path: "../node_modules/react-native-permissions/ios/Notifications" 479 | RCT-Folly: 480 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 481 | RCTRequired: 482 | :path: "../node_modules/react-native/Libraries/RCTRequired" 483 | RCTTypeSafety: 484 | :path: "../node_modules/react-native/Libraries/TypeSafety" 485 | React: 486 | :path: "../node_modules/react-native/" 487 | React-bridging: 488 | :path: "../node_modules/react-native/ReactCommon" 489 | React-callinvoker: 490 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 491 | React-Codegen: 492 | :path: build/generated/ios 493 | React-Core: 494 | :path: "../node_modules/react-native/" 495 | React-CoreModules: 496 | :path: "../node_modules/react-native/React/CoreModules" 497 | React-cxxreact: 498 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 499 | React-hermes: 500 | :path: "../node_modules/react-native/ReactCommon/hermes" 501 | React-jsi: 502 | :path: "../node_modules/react-native/ReactCommon/jsi" 503 | React-jsiexecutor: 504 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 505 | React-jsinspector: 506 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 507 | React-logger: 508 | :path: "../node_modules/react-native/ReactCommon/logger" 509 | react-native-notifications-utils: 510 | :path: "../.." 511 | React-perflogger: 512 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 513 | React-RCTActionSheet: 514 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 515 | React-RCTAnimation: 516 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 517 | React-RCTBlob: 518 | :path: "../node_modules/react-native/Libraries/Blob" 519 | React-RCTImage: 520 | :path: "../node_modules/react-native/Libraries/Image" 521 | React-RCTLinking: 522 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 523 | React-RCTNetwork: 524 | :path: "../node_modules/react-native/Libraries/Network" 525 | React-RCTSettings: 526 | :path: "../node_modules/react-native/Libraries/Settings" 527 | React-RCTText: 528 | :path: "../node_modules/react-native/Libraries/Text" 529 | React-RCTVibration: 530 | :path: "../node_modules/react-native/Libraries/Vibration" 531 | React-runtimeexecutor: 532 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 533 | ReactCommon: 534 | :path: "../node_modules/react-native/ReactCommon" 535 | RNPermissions: 536 | :path: "../node_modules/react-native-permissions" 537 | Yoga: 538 | :path: "../node_modules/react-native/ReactCommon/yoga" 539 | 540 | SPEC CHECKSUMS: 541 | boost: a7c83b31436843459a1961bfd74b96033dc77234 542 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 543 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 544 | FBLazyVector: 8a28262f61fbe40c04ce8677b8d835d97c18f1b3 545 | FBReactNativeSpec: b475991eb2d8da6a4ec32d09a8df31b0247fa87d 546 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 547 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 548 | Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 549 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 550 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 551 | Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446 552 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 553 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 554 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 555 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 556 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b 557 | hermes-engine: 3623325e0d0676a45fbc544d72c57dd79fce7446 558 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 559 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c 560 | Permission-Notifications: 150484ae586eb9be4e32217582a78350a9bb31c3 561 | RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda 562 | RCTRequired: 49a2c4d4215580d8b24ed538ae01b6de20b43a76 563 | RCTTypeSafety: 55d538399fe8b51e5cd862e2ec2f9b135b07e783 564 | React: 413fd7d791365c2c5742b60493d3ab450ca1a210 565 | React-bridging: 8e577e404677d57daa0310db63e6a27328a57207 566 | React-callinvoker: d0ae2f0ea66bcf29a3e42a895428d2f01473d2ea 567 | React-Codegen: 273200ed3b02d35fd1755aebe0eb3319b037d950 568 | React-Core: f42a10403076c1114f8c50f063ddafc9eea92fff 569 | React-CoreModules: 1ed78c63dad96f40b123d4d4ca455e09ccd8aaed 570 | React-cxxreact: 7d30af80adb5fe6a97646a06540c19e61736aa15 571 | React-hermes: 185ce251487bcb812c34ce33b1ab6412419b43a3 572 | React-jsi: 9b2b4ac1642b72bffcd74550f0caa0926b3f8a4d 573 | React-jsiexecutor: 4a893fc8f683b91befcaf56c44ad8be4506b6828 574 | React-jsinspector: 1d5a9e84e419a57cabc23249aec3d837d1b03a80 575 | React-logger: f8071ad48248781d5afdb8a07f778758529d3019 576 | react-native-notifications-utils: f083307d1261f34444a89ca2f9b69f920c9b81e7 577 | React-perflogger: 5e41b01b35d97cc1b0ea177181eb33b5c77623b6 578 | React-RCTActionSheet: 48949f30b24200c82f3dd27847513be34e06a3ae 579 | React-RCTAnimation: 96af42c97966fcd53ed9c31bee6f969c770312b6 580 | React-RCTBlob: 22aa326a2b34eea3299a2274ce93e102f8383ed9 581 | React-RCTImage: 1df0dbdb53609778f68830ccdd07ff3b40812837 582 | React-RCTLinking: eef4732d9102a10174115a727588d199711e376c 583 | React-RCTNetwork: 18716f00568ec203df2192d35f4a74d1d9b00675 584 | React-RCTSettings: 1dc8a5e5272cea1bad2f8d9b4e6bac91b846749b 585 | React-RCTText: 17652c6294903677fb3d754b5955ac293347782c 586 | React-RCTVibration: 0e247407238d3bd6b29d922d7b5de0404359431b 587 | React-runtimeexecutor: 5407e26b5aaafa9b01a08e33653255f8247e7c31 588 | ReactCommon: abf3605a56f98b91671d0d1327addc4ffb87af77 589 | RNPermissions: dcdb7b99796bbeda6975a6e79ad519c41b251b1c 590 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 591 | Yoga: 1f02ef4ce4469aefc36167138441b27d988282b1 592 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 593 | 594 | PODFILE CHECKSUM: 8f6e4c802bfda7c2f70811720900c4619ace0158 595 | 596 | COCOAPODS: 1.11.3 597 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const escape = require('escape-string-regexp'); 3 | const exclusionList = require('metro-config/src/defaults/exclusionList'); 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 block them at the root, and alias them to the versions in example's node_modules 18 | resolver: { 19 | blacklistRE: exclusionList( 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": "NotificationsUtilsExample", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "pods": "pod-install --quiet" 10 | }, 11 | "dependencies": { 12 | "react": "18.1.0", 13 | "react-native": "0.70.4", 14 | "react-native-permissions": "^3.6.1" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.12.9", 18 | "@babel/runtime": "^7.12.5", 19 | "babel-plugin-module-resolver": "^4.1.0", 20 | "metro-react-native-babel-preset": "0.72.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/react-native.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | dependencies: { 5 | 'react-native-notifications-utils': { 6 | root: path.join(__dirname, '..'), 7 | }, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import NotificationsUtils from 'react-native-notifications-utils'; 3 | import { 4 | checkNotifications, 5 | requestNotifications, 6 | } from 'react-native-permissions'; 7 | import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; 8 | 9 | export default function App() { 10 | const onPress = async () => { 11 | const { status } = await checkNotifications(); 12 | if (status !== 'granted') { 13 | await requestNotifications(['alert', 'sound']); 14 | } 15 | NotificationsUtils.openSettings('default'); 16 | }; 17 | 18 | return ( 19 | 20 | 21 | Open App Settings 22 | 23 | 24 | ); 25 | } 26 | 27 | const styles = StyleSheet.create({ 28 | container: { 29 | flex: 1, 30 | alignItems: 'center', 31 | justifyContent: 'center', 32 | paddingHorizontal: 16, 33 | }, 34 | button: { 35 | width: '100%', 36 | height: 56, 37 | backgroundColor: 'blue', 38 | alignItems: 'center', 39 | justifyContent: 'center', 40 | borderRadius: 8, 41 | }, 42 | buttonText: { 43 | color: 'white', 44 | fontSize: 16, 45 | }, 46 | }); 47 | -------------------------------------------------------------------------------- /ios/NotificationsUtils-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | -------------------------------------------------------------------------------- /ios/NotificationsUtils.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(NotificationsUtils, NSObject) 4 | 5 | RCT_EXTERN_METHOD(openAppNotificationsSettings) 6 | 7 | + (BOOL)requiresMainQueueSetup 8 | { 9 | return NO; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ios/NotificationsUtils.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | @objc(NotificationsUtils) 4 | class NotificationsUtils: NSObject { 5 | func openURL(_ url: URL) -> Void { 6 | if #available(iOS 10.0, *){ 7 | UIApplication.shared.open(url) 8 | } else { 9 | UIApplication.shared.openURL(url) 10 | } 11 | } 12 | 13 | @objc(openAppNotificationsSettings) 14 | func openAppNotificationsSettings() -> Void { 15 | let settingsURLString: String; 16 | if #available(iOS 16.0, *) { 17 | settingsURLString = UIApplication.openNotificationSettingsURLString 18 | } else if #available(iOS 15.4, *) { 19 | settingsURLString = UIApplicationOpenNotificationSettingsURLString 20 | } else { 21 | settingsURLString = UIApplication.openSettingsURLString 22 | } 23 | 24 | openURL(URL.init(string: settingsURLString)!) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ios/NotificationsUtils.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5E555C0D2413F4C50049A1A2 /* NotificationsUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* NotificationsUtils.m */; }; 11 | F4FF95D7245B92E800C19C63 /* NotificationsUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* NotificationsUtils.swift */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "include/$(PRODUCT_NAME)"; 19 | dstSubfolderSpec = 16; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 0; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 134814201AA4EA6300B7C361 /* libNotificationsUtils.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNotificationsUtils.a; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | B3E7B5891CC2AC0600A0062D /* NotificationsUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationsUtils.m; sourceTree = ""; }; 29 | F4FF95D5245B92E700C19C63 /* NotificationsUtils-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NotificationsUtils-Bridging-Header.h"; sourceTree = ""; }; 30 | F4FF95D6245B92E800C19C63 /* NotificationsUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsUtils.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 134814211AA4EA7D00B7C361 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | 134814201AA4EA6300B7C361 /* libNotificationsUtils.a */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | 58B511D21A9E6C8500147676 = { 53 | isa = PBXGroup; 54 | children = ( 55 | F4FF95D6245B92E800C19C63 /* NotificationsUtils.swift */, 56 | B3E7B5891CC2AC0600A0062D /* NotificationsUtils.m */, 57 | F4FF95D5245B92E700C19C63 /* NotificationsUtils-Bridging-Header.h */, 58 | 134814211AA4EA7D00B7C361 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | /* End PBXGroup section */ 63 | 64 | /* Begin PBXNativeTarget section */ 65 | 58B511DA1A9E6C8500147676 /* NotificationsUtils */ = { 66 | isa = PBXNativeTarget; 67 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "NotificationsUtils" */; 68 | buildPhases = ( 69 | 58B511D71A9E6C8500147676 /* Sources */, 70 | 58B511D81A9E6C8500147676 /* Frameworks */, 71 | 58B511D91A9E6C8500147676 /* CopyFiles */, 72 | ); 73 | buildRules = ( 74 | ); 75 | dependencies = ( 76 | ); 77 | name = NotificationsUtils; 78 | productName = RCTDataManager; 79 | productReference = 134814201AA4EA6300B7C361 /* libNotificationsUtils.a */; 80 | productType = "com.apple.product-type.library.static"; 81 | }; 82 | /* End PBXNativeTarget section */ 83 | 84 | /* Begin PBXProject section */ 85 | 58B511D31A9E6C8500147676 /* Project object */ = { 86 | isa = PBXProject; 87 | attributes = { 88 | LastUpgradeCheck = 0920; 89 | ORGANIZATIONNAME = Facebook; 90 | TargetAttributes = { 91 | 58B511DA1A9E6C8500147676 = { 92 | CreatedOnToolsVersion = 6.1.1; 93 | }; 94 | }; 95 | }; 96 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "NotificationsUtils" */; 97 | compatibilityVersion = "Xcode 3.2"; 98 | developmentRegion = English; 99 | hasScannedForEncodings = 0; 100 | knownRegions = ( 101 | English, 102 | en, 103 | ); 104 | mainGroup = 58B511D21A9E6C8500147676; 105 | productRefGroup = 58B511D21A9E6C8500147676; 106 | projectDirPath = ""; 107 | projectRoot = ""; 108 | targets = ( 109 | 58B511DA1A9E6C8500147676 /* NotificationsUtils */, 110 | ); 111 | }; 112 | /* End PBXProject section */ 113 | 114 | /* Begin PBXSourcesBuildPhase section */ 115 | 58B511D71A9E6C8500147676 /* Sources */ = { 116 | isa = PBXSourcesBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | F4FF95D7245B92E800C19C63 /* NotificationsUtils.swift in Sources */, 120 | B3E7B58A1CC2AC0600A0062D /* NotificationsUtils.m in Sources */, 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | /* End PBXSourcesBuildPhase section */ 125 | 126 | /* Begin XCBuildConfiguration section */ 127 | 58B511ED1A9E6C8500147676 /* Debug */ = { 128 | isa = XCBuildConfiguration; 129 | buildSettings = { 130 | ALWAYS_SEARCH_USER_PATHS = NO; 131 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 132 | CLANG_CXX_LIBRARY = "libc++"; 133 | CLANG_ENABLE_MODULES = YES; 134 | CLANG_ENABLE_OBJC_ARC = YES; 135 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 136 | CLANG_WARN_BOOL_CONVERSION = YES; 137 | CLANG_WARN_COMMA = YES; 138 | CLANG_WARN_CONSTANT_CONVERSION = YES; 139 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 140 | CLANG_WARN_EMPTY_BODY = YES; 141 | CLANG_WARN_ENUM_CONVERSION = YES; 142 | CLANG_WARN_INFINITE_RECURSION = YES; 143 | CLANG_WARN_INT_CONVERSION = YES; 144 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 145 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 146 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 147 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 148 | CLANG_WARN_STRICT_PROTOTYPES = YES; 149 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 150 | CLANG_WARN_UNREACHABLE_CODE = YES; 151 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 152 | COPY_PHASE_STRIP = NO; 153 | ENABLE_STRICT_OBJC_MSGSEND = YES; 154 | ENABLE_TESTABILITY = YES; 155 | "EXCLUDED_ARCHS[sdk=*]" = arm64; 156 | GCC_C_LANGUAGE_STANDARD = gnu99; 157 | GCC_DYNAMIC_NO_PIC = NO; 158 | GCC_NO_COMMON_BLOCKS = YES; 159 | GCC_OPTIMIZATION_LEVEL = 0; 160 | GCC_PREPROCESSOR_DEFINITIONS = ( 161 | "DEBUG=1", 162 | "$(inherited)", 163 | ); 164 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 165 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 166 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 167 | GCC_WARN_UNDECLARED_SELECTOR = YES; 168 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 169 | GCC_WARN_UNUSED_FUNCTION = YES; 170 | GCC_WARN_UNUSED_VARIABLE = YES; 171 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 172 | MTL_ENABLE_DEBUG_INFO = YES; 173 | ONLY_ACTIVE_ARCH = YES; 174 | SDKROOT = iphoneos; 175 | }; 176 | name = Debug; 177 | }; 178 | 58B511EE1A9E6C8500147676 /* Release */ = { 179 | isa = XCBuildConfiguration; 180 | buildSettings = { 181 | ALWAYS_SEARCH_USER_PATHS = NO; 182 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 183 | CLANG_CXX_LIBRARY = "libc++"; 184 | CLANG_ENABLE_MODULES = YES; 185 | CLANG_ENABLE_OBJC_ARC = YES; 186 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 187 | CLANG_WARN_BOOL_CONVERSION = YES; 188 | CLANG_WARN_COMMA = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INFINITE_RECURSION = YES; 194 | CLANG_WARN_INT_CONVERSION = YES; 195 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 199 | CLANG_WARN_STRICT_PROTOTYPES = YES; 200 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 201 | CLANG_WARN_UNREACHABLE_CODE = YES; 202 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 203 | COPY_PHASE_STRIP = YES; 204 | ENABLE_NS_ASSERTIONS = NO; 205 | ENABLE_STRICT_OBJC_MSGSEND = YES; 206 | "EXCLUDED_ARCHS[sdk=*]" = arm64; 207 | GCC_C_LANGUAGE_STANDARD = gnu99; 208 | GCC_NO_COMMON_BLOCKS = YES; 209 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 210 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 211 | GCC_WARN_UNDECLARED_SELECTOR = YES; 212 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 213 | GCC_WARN_UNUSED_FUNCTION = YES; 214 | GCC_WARN_UNUSED_VARIABLE = YES; 215 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 216 | MTL_ENABLE_DEBUG_INFO = NO; 217 | SDKROOT = iphoneos; 218 | VALIDATE_PRODUCT = YES; 219 | }; 220 | name = Release; 221 | }; 222 | 58B511F01A9E6C8500147676 /* Debug */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | HEADER_SEARCH_PATHS = ( 226 | "$(inherited)", 227 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 228 | "$(SRCROOT)/../../../React/**", 229 | "$(SRCROOT)/../../react-native/React/**", 230 | ); 231 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 232 | OTHER_LDFLAGS = "-ObjC"; 233 | PRODUCT_NAME = NotificationsUtils; 234 | SKIP_INSTALL = YES; 235 | SWIFT_OBJC_BRIDGING_HEADER = "NotificationsUtils-Bridging-Header.h"; 236 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 237 | SWIFT_VERSION = 5.0; 238 | }; 239 | name = Debug; 240 | }; 241 | 58B511F11A9E6C8500147676 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | HEADER_SEARCH_PATHS = ( 245 | "$(inherited)", 246 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 247 | "$(SRCROOT)/../../../React/**", 248 | "$(SRCROOT)/../../react-native/React/**", 249 | ); 250 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 251 | OTHER_LDFLAGS = "-ObjC"; 252 | PRODUCT_NAME = NotificationsUtils; 253 | SKIP_INSTALL = YES; 254 | SWIFT_OBJC_BRIDGING_HEADER = "NotificationsUtils-Bridging-Header.h"; 255 | SWIFT_VERSION = 5.0; 256 | }; 257 | name = Release; 258 | }; 259 | /* End XCBuildConfiguration section */ 260 | 261 | /* Begin XCConfigurationList section */ 262 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "NotificationsUtils" */ = { 263 | isa = XCConfigurationList; 264 | buildConfigurations = ( 265 | 58B511ED1A9E6C8500147676 /* Debug */, 266 | 58B511EE1A9E6C8500147676 /* Release */, 267 | ); 268 | defaultConfigurationIsVisible = 0; 269 | defaultConfigurationName = Release; 270 | }; 271 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "NotificationsUtils" */ = { 272 | isa = XCConfigurationList; 273 | buildConfigurations = ( 274 | 58B511F01A9E6C8500147676 /* Debug */, 275 | 58B511F11A9E6C8500147676 /* Release */, 276 | ); 277 | defaultConfigurationIsVisible = 0; 278 | defaultConfigurationName = Release; 279 | }; 280 | /* End XCConfigurationList section */ 281 | }; 282 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 283 | } 284 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | lint: 5 | files: git diff --name-only @{push} 6 | glob: "*.{js,ts,jsx,tsx}" 7 | run: npx eslint {files} 8 | types: 9 | files: git diff --name-only @{push} 10 | glob: "*.{js,ts, jsx, tsx}" 11 | run: npx tsc --noEmit 12 | commit-msg: 13 | parallel: true 14 | commands: 15 | commitlint: 16 | run: npx commitlint --edit 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-notifications-utils", 3 | "version": "0.3.0", 4 | "description": "react native (native module) notifications utils, for making notifications easier", 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 | "*.podspec", 17 | "!lib/typescript/example", 18 | "!ios/build", 19 | "!android/build", 20 | "!android/gradle", 21 | "!android/gradlew", 22 | "!android/gradlew.bat", 23 | "!android/local.properties", 24 | "!**/__tests__", 25 | "!**/__fixtures__", 26 | "!**/__mocks__", 27 | "!**/.*" 28 | ], 29 | "scripts": { 30 | "test": "jest", 31 | "typescript": "tsc --noEmit", 32 | "lint": "eslint \"**/*.{js,ts,tsx}\"", 33 | "prepare": "bob build", 34 | "release": "release-it", 35 | "example": "yarn --cwd example", 36 | "bootstrap": "yarn example && yarn install && yarn example pods" 37 | }, 38 | "keywords": [ 39 | "react-native", 40 | "ios", 41 | "android", 42 | "notifications", 43 | "utils", 44 | "notifications settings", 45 | "open notifications settings", 46 | "open app settings" 47 | ], 48 | "repository": "https://github.com/Stringsaeed/react-native-notifications-utils", 49 | "author": "Muhammed Saeed (https://github.com/Stringsaeed)", 50 | "license": "MIT", 51 | "bugs": { 52 | "url": "https://github.com/Stringsaeed/react-native-notifications-utils/issues" 53 | }, 54 | "homepage": "https://github.com/Stringsaeed/react-native-notifications-utils#readme", 55 | "publishConfig": { 56 | "registry": "https://registry.npmjs.org/" 57 | }, 58 | "devDependencies": { 59 | "@arkweid/lefthook": "^0.7.7", 60 | "@commitlint/config-conventional": "^17.0.2", 61 | "@react-native-community/eslint-config": "^3.0.2", 62 | "@release-it/conventional-changelog": "^5.0.0", 63 | "@types/jest": "^28.1.2", 64 | "@types/react": "~17.0.21", 65 | "@types/react-native": "0.68.0", 66 | "commitlint": "^17.0.2", 67 | "eslint": "^8.4.1", 68 | "eslint-config-prettier": "^8.5.0", 69 | "eslint-plugin-prettier": "^4.0.0", 70 | "jest": "^28.1.1", 71 | "pod-install": "^0.1.0", 72 | "prettier": "^2.0.5", 73 | "react": "18.1.0", 74 | "react-native": "0.70.4", 75 | "react-native-builder-bob": "^0.20.0", 76 | "release-it": "^15.0.0", 77 | "typescript": "^4.5.2" 78 | }, 79 | "resolutions": { 80 | "@types/react": "17.0.21" 81 | }, 82 | "peerDependencies": { 83 | "react": "*", 84 | "react-native": "*" 85 | }, 86 | "jest": { 87 | "preset": "react-native", 88 | "modulePathIgnorePatterns": [ 89 | "/example/node_modules", 90 | "/lib/" 91 | ] 92 | }, 93 | "commitlint": { 94 | "extends": [ 95 | "@commitlint/config-conventional" 96 | ] 97 | }, 98 | "release-it": { 99 | "git": { 100 | "commitMessage": "chore: release ${version}", 101 | "tagName": "v${version}" 102 | }, 103 | "npm": { 104 | "publish": true 105 | }, 106 | "github": { 107 | "release": true 108 | }, 109 | "plugins": { 110 | "@release-it/conventional-changelog": { 111 | "preset": "angular", 112 | "infile": "CHANGELOG.md" 113 | } 114 | } 115 | }, 116 | "eslintConfig": { 117 | "root": true, 118 | "extends": [ 119 | "@react-native-community", 120 | "prettier" 121 | ], 122 | "rules": { 123 | "prettier/prettier": [ 124 | "error", 125 | { 126 | "quoteProps": "consistent", 127 | "singleQuote": true, 128 | "tabWidth": 2, 129 | "trailingComma": "es5", 130 | "useTabs": false 131 | } 132 | ] 133 | } 134 | }, 135 | "eslintIgnore": [ 136 | "node_modules/", 137 | "lib/" 138 | ], 139 | "prettier": { 140 | "quoteProps": "consistent", 141 | "singleQuote": true, 142 | "tabWidth": 2, 143 | "trailingComma": "es5", 144 | "useTabs": false 145 | }, 146 | "react-native-builder-bob": { 147 | "source": "src", 148 | "output": "lib", 149 | "targets": [ 150 | "commonjs", 151 | "module", 152 | [ 153 | "typescript", 154 | { 155 | "project": "tsconfig.build.json" 156 | } 157 | ] 158 | ] 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /react-native-notifications-utils.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' 5 | 6 | Pod::Spec.new do |s| 7 | s.name = "react-native-notifications-utils" 8 | s.version = package["version"] 9 | s.summary = package["description"] 10 | s.homepage = package["homepage"] 11 | s.license = package["license"] 12 | s.authors = package["author"] 13 | 14 | s.platforms = { :ios => "10.0" } 15 | s.source = { :git => "https://github.com/Stringsaeed/react-native-notifications-utils.git", :tag => "#{s.version}" } 16 | 17 | s.source_files = "ios/**/*.{h,m,mm,swift}" 18 | 19 | s.dependency "React-Core" 20 | 21 | # Don't install the dependencies when we run `pod install` in the old architecture. 22 | if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then 23 | s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" 24 | s.pod_target_xcconfig = { 25 | "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", 26 | "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" 27 | } 28 | 29 | s.dependency "React-Codegen" 30 | s.dependency "RCT-Folly" 31 | s.dependency "RCTRequired" 32 | s.dependency "RCTTypeSafety" 33 | s.dependency "ReactCommon/turbomodule/core" 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /scripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | const os = require('os'); 2 | const path = require('path'); 3 | const child_process = require('child_process'); 4 | 5 | const root = path.resolve(__dirname, '..'); 6 | const args = process.argv.slice(2); 7 | const options = { 8 | cwd: process.cwd(), 9 | env: process.env, 10 | stdio: 'inherit', 11 | encoding: 'utf-8', 12 | }; 13 | 14 | if (os.type() === 'Windows_NT') { 15 | options.shell = true; 16 | } 17 | 18 | let result; 19 | 20 | if (process.cwd() !== root || args.length) { 21 | // We're not in the root of the project, or additional arguments were passed 22 | // In this case, forward the command to `yarn` 23 | result = child_process.spawnSync('yarn', args, options); 24 | } else { 25 | // If `yarn` is run without arguments, perform bootstrap 26 | result = child_process.spawnSync('yarn', ['bootstrap'], options); 27 | } 28 | 29 | process.exitCode = result.status; 30 | -------------------------------------------------------------------------------- /src/NotificationsUtilsModule.ts: -------------------------------------------------------------------------------- 1 | import { NativeModules, Platform } from 'react-native'; 2 | 3 | const LINKING_ERROR = 4 | `The package 'react-native-notifications-utils' doesn't seem to be linked. Make sure: \n\n` + 5 | Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + 6 | '- You rebuilt the app after installing the package\n' + 7 | '- You are not using Expo Go\n'; 8 | 9 | const NotificationsUtilsModule = NativeModules.NotificationsUtils 10 | ? NativeModules.NotificationsUtils 11 | : new Proxy( 12 | {}, 13 | { 14 | get() { 15 | throw new Error(LINKING_ERROR); 16 | }, 17 | } 18 | ); 19 | 20 | export default NotificationsUtilsModule; 21 | -------------------------------------------------------------------------------- /src/__tests__/index.test.tsx: -------------------------------------------------------------------------------- 1 | it.todo('write a test'); 2 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { Platform } from 'react-native'; 2 | import NotificationsUtilsModule from './NotificationsUtilsModule'; 3 | 4 | interface INotificationsUtils { 5 | /** 6 | * API used to open the Platform specific System settings for the application. 7 | * 8 | * On Android: 9 | * API version is >= 26 with `channelId` will open the channel settings. if `channelI` is not provided, the app's notification settings will be opened. 10 | * API version is < 26, the application settings screen is opened. 11 | * On iOS: 12 | * If the version of iOS is >= 15.4, the app's notification settings screen is displayed. 13 | * If the version of iOS is < 15.4, the app's settings screen is displayed. 14 | * On iOS: 15 | * If the version of iOS is >= 15.4, the app's notification settings screen is displayed. 16 | * If the version of iOS is < 15.4, the app's settings screen is displayed. 17 | * @see https://developer.apple.com/documentation/uikit/uiapplication/4013180-opennotificationsettingsurlstrin 18 | * @see https://developer.apple.com/documentation/uikit/uiapplicationopennotificationsettingsurlstring?language=objc 19 | * @see https://developer.apple.com/documentation/uikit/uiapplication/1623042-opensettingsurlstring 20 | * 21 | * 22 | * @platform android 23 | * @param channelId The ID of the channel which will be opened. Can be ignored/omitted to display the 24 | * overall notification settings. 25 | */ 26 | openSettings(channelId?: string): void; 27 | } 28 | 29 | const NotificationsUtils: INotificationsUtils = { 30 | openSettings: (channelId) => { 31 | if (Platform.OS === 'android') { 32 | if (channelId && typeof channelId !== 'string') { 33 | throw new Error( 34 | `NotificationsUtils.openSettings: Expected 'channelId' to be a string, got ${typeof channelId}.` 35 | ); 36 | } 37 | 38 | return NotificationsUtilsModule.openAppNotificationsSettings(channelId); 39 | } 40 | return NotificationsUtilsModule.openAppNotificationsSettings(); 41 | }, 42 | }; 43 | 44 | export default NotificationsUtils; 45 | -------------------------------------------------------------------------------- /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-notifications-utils": ["./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 | "noUncheckedIndexedAccess": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "resolveJsonModule": true, 24 | "skipLibCheck": true, 25 | "strict": true, 26 | "target": "esnext" 27 | } 28 | } 29 | --------------------------------------------------------------------------------