├── .gitattributes ├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── android ├── .classpath ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── ui │ └── notificationbanner │ ├── RNNotificationBannerModule.java │ └── RNNotificationBannerPackage.java ├── example ├── .bundle │ └── config ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .vscode │ └── settings.json ├── .watchmanconfig ├── App.tsx ├── Gemfile ├── README.md ├── __tests__ │ └── App.test.tsx ├── android │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── 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 │ ├── Podfile │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ └── contents.xcworkspacedata │ └── example │ │ ├── AppDelegate.swift │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── PrivacyInfo.xcprivacy ├── jest.config.js ├── metro.config.js ├── package.json └── tsconfig.json ├── ios ├── RNNotificationBanner.h ├── RNNotificationBanner.m ├── RNNotificationBanner.podspec ├── RNNotificationBanner.xcodeproj │ └── project.pbxproj └── RNNotificationBanner.xcworkspace │ └── contents.xcworkspacedata ├── js └── RNNotificationBanner.js └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # OSX 3 | # 4 | .DS_Store 5 | 6 | # node.js 7 | # 8 | node_modules/ 9 | npm-debug.log 10 | yarn-error.log 11 | 12 | 13 | # Xcode 14 | # 15 | build/ 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | xcuserdata 25 | *.xccheckout 26 | *.moved-aside 27 | DerivedData 28 | *.hmap 29 | *.ipa 30 | *.xcuserstate 31 | project.xcworkspace 32 | 33 | 34 | # Android/IntelliJ 35 | # 36 | build/ 37 | .idea 38 | .gradle 39 | local.properties 40 | *.iml 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | 47 | .history/ -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable", 3 | "java.configuration.updateBuildConfiguration": "interactive" 4 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 |

5 | 6 |

7 | 8 | 9 |

10 | 11 | PRs Welcome 12 | 13 |

14 | 15 | 16 | ReactNative: Native Notification Banner (Android/iOS) 17 | 18 | If this project has helped you out, please support us with a star 🌟 19 |

20 | A simple lightweight dropdown banner library using creates native capabilities 21 | 22 | 23 | #### Android 24 | 25 | 26 | | **[Tapadoo/Alerter](https://github.com/Tapadoo/Alerter)** | 27 | | ----------------- | 28 | 29 | 30 | #### iOS 31 | 32 | | **[bryx-inc/BRYXBanner](https://github.com/bryx-inc/BRYXBanner)** | 33 | | ----------------- | 34 | 35 | 36 | ## 📖 Getting started 37 | 38 | `$ yarn add react-native-notification-banner` 39 | 40 | ## **ReactNative >= 77 && ReactNativeNotificationBanner > V3** 41 | 42 | - Add `react-native-image-helper` your app package.json 43 | 44 | `$ npm install react-native-image-helper --save` 45 | 46 | - Add `react-native-vector-icons` to your app package.json and configure it as per their installation steps. It supports till V10 47 | 48 | `$ npm install react-native-vector-icons --save` 49 | 50 | - **iOS** 51 | 52 | - Add the following to your `Podfile` -> `ios/Podfile` and run pod update: 53 | 54 | ``` 55 | #Modify below snippet outside your target project tag 56 | linkage = ENV['USE_FRAMEWORKS'] 57 | if linkage != nil 58 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 59 | use_frameworks! :linkage => linkage.to_sym 60 | else 61 | use_frameworks! 62 | end 63 | 64 | #Add below code in your target project tag 65 | pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios' 66 | 67 | pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master' 68 | 69 | post_install do |installer| 70 | installer.pods_project.targets.each do |target| 71 | if target.name.include?('BRYXBanner') 72 | target.build_configurations.each do |config| 73 | config.build_settings['SWIFT_VERSION'] = '4.2' 74 | end 75 | end 76 | end 77 | 78 | # Ensure the Swift version is set for all targets 79 | installer.pods_project.targets.each do |target| 80 | target.build_configurations.each do |config| 81 | config.build_settings['SWIFT_VERSION'] = '5.0' 82 | end 83 | end 84 | end 85 | ``` 86 | 87 | - **Android** 88 | 89 | Please add below snippet into your app `build.gradle` 90 | 91 | ``` 92 | allprojects { 93 | repositories { 94 | maven { url 'https://jitpack.io' } 95 | } 96 | } 97 | ``` 98 | 99 | 100 | ## **RN61 >= RNBAS V2 >** 101 | 102 | - Add `react-native-image-helper` your app package.json 103 | 104 | `$ npm install react-native-image-helper --save` 105 | 106 | - Add `react-native-vector-icons` to your app package.json and configure it as per their installation steps 107 | 108 | `$ npm install react-native-vector-icons --save` 109 | 110 | - **iOS** 111 | 112 | - Add the following to your `Podfile` -> `ios/Podfile` and run pod update: 113 | 114 | ``` 115 | use_native_modules! 116 | 117 | pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios' 118 | 119 | use_frameworks! 120 | 121 | pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master' 122 | 123 | post_install do |installer| 124 | installer.pods_project.targets.each do |target| 125 | if target.name.include?('BRYXBanner') 126 | target.build_configurations.each do |config| 127 | config.build_settings['SWIFT_VERSION'] = '4.2' 128 | end 129 | end 130 | end 131 | end 132 | ``` 133 | 134 | - **Android** 135 | 136 | Please add below snippet into your app `build.gradle` 137 | 138 | ``` 139 | allprojects { 140 | repositories { 141 | maven { url 'https://jitpack.io' } 142 | } 143 | } 144 | ``` 145 | 146 | ## **RN60 >= RNNB V1 >** 147 | 148 | `$ yarn add react-native-vector-icons` 149 | 150 | > RN60 above please use `react-native-notification-banner` V1 and above 151 | 152 | - **iOS** 153 | 154 | - Add the following to your `Podfile` -> `ios/Podfile` and run pod update: 155 | 156 | ``` 157 | use_native_modules! 158 | 159 | pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios' 160 | 161 | use_frameworks! 162 | 163 | pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master' 164 | 165 | post_install do |installer| 166 | installer.pods_project.targets.each do |target| 167 | if target.name.include?('BRYXBanner') 168 | target.build_configurations.each do |config| 169 | config.build_settings['SWIFT_VERSION'] = '4.2' 170 | end 171 | end 172 | end 173 | end 174 | ``` 175 | 176 | - **Android** 177 | 178 | Please add below snippet into your app `build.gradle` 179 | 180 | ``` 181 | allprojects { 182 | repositories { 183 | maven { url 'https://jitpack.io' } 184 | } 185 | } 186 | ``` 187 | 188 | ## **RN60 < RNNB V1 <** 189 | 190 | > RN60 below please use `react-native-notification-banner` V.0.* 191 | 192 | `$ react-native link react-native-notification-banner` 193 | 194 | `$ react-native link react-native-vector-icons` 195 | 196 | - **iOS** 197 | 198 | - After `react-native link react-native-notification-banner`, please verify `node_modules/react-native-notification-banner/ios/` contains `Pods` folder. If does not exist please execute `pod install` command on `node_modules/react-native-notification-banner/ios/`, if any error => try `pod repo update` then `pod install` 199 | - After verification, open your project and create a folder 'RNNotificationBanner' under Libraries. 200 | - Drag `node_modules/react-native-notification-banner/ios/pods/Pods.xcodeproject` into RNNotificationBanner, as well as the RNNotificationBanner.xcodeproject if it does not exist. 201 | - Add the `BRYXBanner.framework` into your project's `Embedded Binaries` and make sure the framework is also in linked libraries. 202 | - Go to your project's `Build Settings -> Frameworks Search Path` and add `${BUILT_PRODUCTS_DIR}/BRYXBanner` non-recursive. 203 | 204 | - Now build your iOS app through Xcode 205 | 206 | - **Android** 207 | 208 | Please add below snippet into your app `build.gradle` 209 | 210 | ``` 211 | 212 | buildscript { 213 | repositories { 214 | jcenter() 215 | maven { url "https://maven.google.com" } 216 | ... 217 | } 218 | ... 219 | } 220 | 221 | 222 | allprojects { 223 | repositories { 224 | maven { url 'https://jitpack.io' } 225 | maven { url "https://maven.google.com" } 226 | ... 227 | } 228 | } 229 | ``` 230 | 231 | > **Note:** This library is support on Android 27 > above 232 | 233 | ## 💻 Usage 234 | 235 | ```javascript 236 | import { RNNotificationBanner } from 'react-native-notification-banner'; 237 | 238 | import Icon from 'react-native-vector-icons/FontAwesome' 239 | let copy = ; 240 | 241 | RNNotificationBanner.Show({ 242 | title: "Message", 243 | subTitle: "Message", 244 | withIcon: true, 245 | icon: copy, 246 | titleColor: "#FFFFFF", 247 | subTitleColor: "#FFFFFF", 248 | isSwipeToDismissEnabled: true, 249 | }) 250 | 251 | ``` 252 | 253 | > **Note:** 254 | > - We have added `family` prop for `Icon` class, please make sure that you pass the props 255 | 256 | 257 | ## 💡 API's 258 | 259 | **Success**, **Error**, **Info**, **Warn**, **Normal**, **Show** 260 | 261 | 262 | ## 🎨 Props 263 | 264 | | Prop | Type | Default | Note | 265 | | ----------------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------------- | 266 | | `title` | `string` | | Specify title of banner 267 | | `subTitle` | `string` | | Specify subtitle of banner | | 268 | | `tintColor` | `HEX-COLOR` | | Specify tint color of banner | | 269 | | `withIcon` | `bool` | | Enable/Disable icon | | 270 | | `icon` | `RNVectorIcon` | | Specify banner icon | | 271 | | `duration` | `int` | | Specify duration to show banner | | 272 | | `enableProgress` | `bool` | false | Specify to show progress on banner | | 273 | | `onClick` | `func` | | Specify onClick callback | | 274 | | `onHide` | `func` | | Specify onHide callback 275 | 276 | 277 | 278 | ## Icons 279 | 280 | - **RN Vector Icons:** It supports [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons) library. Please find below snippet for the usage: 281 | 282 | ```javascript 283 | let facebook = 284 | 285 | RNNotificationBanner.Success({ title: "Message", subTitle: "Message", withIcon: true, icon: copy}) 286 | ``` 287 | 288 | > **Note:** 289 | > - We have added `family` prop for `Icon` class, please make sure that you pass the props 290 | 291 | 292 | ## ✨ Credits 293 | 294 | - [Tapadoo/Alerter](https://github.com/Tapadoo/Alerter) 295 | - [bryx-inc/BRYXBanner](https://github.com/bryx-inc/BRYXBanner) 296 | 297 | 298 | ## 🤔 How to contribute 299 | Have an idea? Found a bug? Please raise to [ISSUES](https://github.com/prscX/react-native-notification-banner/issues). 300 | Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given. 301 | 302 | ## 💫 Where is this library used? 303 | If you are using this library in one of your projects, add it in this list below. ✨ 304 | 305 | 306 | ## 📜 License 307 | This library is provided under the Apache 2 License. 308 | 309 | RNBottomActionSheet @ [prscX](https://github.com/prscX) 310 | 311 | ## 💖 Support my projects 312 | I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it). 313 | 314 | However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: 315 | * Starring and sharing the projects you like 🚀 316 | * If you're feeling especially charitable, please follow [prscX](https://github.com/prscX) on GitHub. 317 | 318 | Buy Me A Coffee 319 | 320 | Thanks! ❤️ 321 |
322 | [prscX.github.io](https://prscx.github.io) 323 |
324 | 325 | -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | react-native-notification-banner 4 | Project android_ created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | 25 | 1739852518724 26 | 27 | 30 28 | 29 | org.eclipse.core.resources.regexFilterMatcher 30 | node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments=--init-script /var/folders/sz/31n7w1c57g53k4dhf4njl8h00000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/sz/31n7w1c57g53k4dhf4njl8h00000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | // The Android Gradle plugin is only required when opening the android folder stand-alone. 4 | // This avoids unnecessary downloads and potential conflicts when the library is included as a 5 | // module dependency in an application project. 6 | if (project == rootProject) { 7 | repositories { 8 | google() 9 | } 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.library' 14 | 15 | def safeExtGet(prop, fallback) { 16 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 17 | } 18 | 19 | android { 20 | compileSdkVersion safeExtGet('compileSdkVersion', 28) 21 | buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') 22 | 23 | defaultConfig { 24 | minSdkVersion safeExtGet('minSdkVersion', 16) 25 | targetSdkVersion safeExtGet('targetSdkVersion', 28) 26 | versionCode 1 27 | versionName "1.0" 28 | } 29 | lintOptions { 30 | abortOnError false 31 | } 32 | } 33 | 34 | repositories { 35 | google() 36 | mavenCentral() 37 | } 38 | 39 | dependencies { 40 | implementation 'com.facebook.react:react-native:+' 41 | implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '27.0.2')}" 42 | implementation 'com.github.tapadoo:alerter:7.2.4' 43 | } 44 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/ui/notificationbanner/RNNotificationBannerModule.java: -------------------------------------------------------------------------------- 1 | 2 | package ui.notificationbanner; 3 | 4 | import android.annotation.TargetApi; 5 | import android.content.res.Resources; 6 | import android.graphics.Bitmap; 7 | import android.graphics.Canvas; 8 | import android.graphics.Color; 9 | import android.graphics.Paint; 10 | import android.graphics.Rect; 11 | import android.graphics.Typeface; 12 | import android.graphics.drawable.BitmapDrawable; 13 | import android.graphics.drawable.Drawable; 14 | import android.os.StrictMode; 15 | import android.view.View; 16 | import android.widget.TextView; 17 | import java.lang.reflect.Method; 18 | 19 | import com.facebook.react.bridge.ReactApplicationContext; 20 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 21 | import com.facebook.react.bridge.ReactMethod; 22 | import com.facebook.react.bridge.Callback; 23 | import com.facebook.react.bridge.ReadableMap; 24 | import com.facebook.react.views.text.ReactFontManager; 25 | import com.tapadoo.alerter.Alert; 26 | import com.tapadoo.alerter.Alerter; 27 | import com.tapadoo.alerter.OnHideAlertListener; 28 | 29 | public class RNNotificationBannerModule extends ReactContextBaseJavaModule { 30 | 31 | private final ReactApplicationContext reactContext; 32 | 33 | private Callback onClickCallback = null; 34 | private Callback onHideCallback = null; 35 | 36 | public RNNotificationBannerModule(ReactApplicationContext reactContext) { 37 | super(reactContext); 38 | this.reactContext = reactContext; 39 | } 40 | 41 | @Override 42 | public String getName() { 43 | return "RNNotificationBanner"; 44 | } 45 | 46 | @ReactMethod 47 | public void Show(final ReadableMap props, final Callback onClick, final Callback onHide) { 48 | 49 | int type = props.getInt("type"); 50 | 51 | String title = props.getString("title"); 52 | int titleSize = props.getInt("titleSize"); 53 | String titleColorValue = props.getString("titleColor"); 54 | 55 | String subTitle = props.getString("subTitle"); 56 | int subTitleSize = props.getInt("subTitleSize"); 57 | String subTitleColorValue = props.getString("subTitleColor"); 58 | 59 | int duration = props.getInt("duration"); 60 | boolean enableProgress = props.getBoolean("enableProgress"); 61 | String tintColorValue = props.getString("tintColor"); 62 | 63 | boolean dismissable = props.getBoolean("dismissable"); 64 | 65 | boolean isSwipeToDismissEnabled = props.getBoolean("isSwipeToDismissEnabled"); 66 | 67 | boolean withIcon = props.getBoolean("withIcon"); 68 | ReadableMap icon = props.hasKey("icon") ? props.getMap("icon") : null; 69 | 70 | Drawable iconDrawable = null; 71 | 72 | int tintColor = 0; 73 | 74 | onClickCallback = onClick; 75 | onHideCallback = onHide; 76 | 77 | if (withIcon) { 78 | if (icon != null && icon.toHashMap().size() > 0) { 79 | try { 80 | Class clazz = Class.forName("prscx.imagehelper.RNImageHelperModule"); //Controller A or B 81 | Class params[] = {ReadableMap.class}; 82 | Method method = clazz.getDeclaredMethod("GenerateImage", params); 83 | 84 | iconDrawable = (Drawable) method.invoke(null, icon); 85 | } catch (Exception e) { 86 | } 87 | } 88 | } 89 | 90 | if (titleColorValue != null && titleColorValue.length() > 0) { 91 | // config.setTextColor(Color.parseColor(titleColorValue)); 92 | } 93 | if (titleSize != 0) { 94 | // config.setTextSize(titleSize); 95 | } 96 | 97 | 98 | if (tintColorValue != null && tintColorValue.length() > 0) { 99 | tintColor = Color.parseColor(tintColorValue); 100 | } 101 | 102 | Alerter alerter = Alerter.create(getCurrentActivity()); 103 | alerter = alerter.setTitle(title); 104 | alerter = alerter.setText(subTitle); 105 | 106 | if (iconDrawable != null && enableProgress == false) { 107 | alerter = alerter.setIcon(iconDrawable); 108 | } else { 109 | alerter = alerter.hideIcon(); 110 | } 111 | 112 | if (tintColor != 0) { 113 | alerter = alerter.setBackgroundColorInt(tintColor); 114 | } 115 | 116 | if (!dismissable) { 117 | alerter = alerter.setDismissable(dismissable); 118 | } 119 | 120 | if (isSwipeToDismissEnabled) { 121 | alerter.enableSwipeToDismiss(); 122 | } 123 | 124 | alerter = alerter.setOnClickListener(new View.OnClickListener() { 125 | @Override 126 | public void onClick(View view) { 127 | if (onClickCallback != null) { 128 | onClickCallback.invoke(); 129 | 130 | onClickCallback = null; 131 | onHideCallback = null; 132 | } 133 | } 134 | }); 135 | 136 | alerter = alerter.setOnHideListener(new OnHideAlertListener() { 137 | @Override 138 | public void onHide() { 139 | if (onHideCallback != null) { 140 | onHideCallback.invoke(); 141 | 142 | onHideCallback = null; 143 | onClickCallback = null; 144 | } 145 | } 146 | }); 147 | 148 | if (enableProgress) { 149 | alerter.enableProgress(true); 150 | alerter.setProgressColorInt(Color.WHITE); 151 | } 152 | 153 | if (duration != 0) { 154 | alerter.setDuration(duration); 155 | } 156 | 157 | Alert activeAlert = alerter.show(); 158 | 159 | if (activeAlert == null) { 160 | return; 161 | } 162 | 163 | String regexHexColor = "^#(?:[0-9a-fA-F]{3}){1,2}$"; 164 | if (titleColorValue != null && titleColorValue.matches(regexHexColor)) { 165 | activeAlert.getTitle().setTextColor(Color.parseColor(titleColorValue)); 166 | } 167 | if(subTitleColorValue != null && subTitleColorValue.matches(regexHexColor)){ 168 | activeAlert.getText().setTextColor(Color.parseColor(subTitleColorValue)); 169 | } 170 | } 171 | 172 | @ReactMethod 173 | public void Dismiss() { 174 | Alerter.clearCurrent(getCurrentActivity()); 175 | } 176 | } -------------------------------------------------------------------------------- /android/src/main/java/ui/notificationbanner/RNNotificationBannerPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package ui.notificationbanner; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNNotificationBannerPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNNotificationBannerModule(reactContext)); 17 | } 18 | 19 | // Deprecated from RN 0.47 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native', 4 | }; 5 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | **/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | *.keystore 35 | !debug.keystore 36 | 37 | # node.js 38 | # 39 | node_modules/ 40 | npm-debug.log 41 | yarn-error.log 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://docs.fastlane.tools/best-practices/source-control/ 49 | 50 | **/fastlane/report.xml 51 | **/fastlane/Preview.html 52 | **/fastlane/screenshots 53 | **/fastlane/test_output 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # Ruby / CocoaPods 59 | **/Pods/ 60 | /vendor/bundle/ 61 | 62 | # Temporary files created by Metro to check the health of the file watcher 63 | .metro-health-check* 64 | 65 | # testing 66 | /coverage 67 | 68 | # Yarn 69 | .yarn/* 70 | !.yarn/patches 71 | !.yarn/plugins 72 | !.yarn/releases 73 | !.yarn/sdks 74 | !.yarn/versions 75 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /example/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.compile.nullAnalysis.mode": "automatic" 3 | } -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | Platform, 4 | StyleSheet, 5 | Text, 6 | View, 7 | TouchableOpacity 8 | } from 'react-native'; 9 | 10 | import { RNNotificationBanner } from "react-native-notification-banner"; 11 | 12 | import Icon from "react-native-vector-icons/FontAwesome"; 13 | import AntDesign from "react-native-vector-icons/AntDesign"; 14 | import Entypo from "react-native-vector-icons/Entypo"; 15 | import EvilIcons from "react-native-vector-icons/EvilIcons"; 16 | import Feather from "react-native-vector-icons/Feather"; 17 | import FontAwesome from "react-native-vector-icons/FontAwesome"; 18 | import FontAwesome5Brands from "react-native-vector-icons/FontAwesome5"; 19 | import FontAwesome5Regular from "react-native-vector-icons/FontAwesome5"; 20 | import FontAwesome5Solid from "react-native-vector-icons/FontAwesome5"; 21 | import Foundation from "react-native-vector-icons/Foundation"; 22 | import Ionicons from "react-native-vector-icons/Ionicons"; 23 | import MaterialIcons from "react-native-vector-icons/MaterialIcons"; 24 | import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; 25 | import SimpleLineIcons from "react-native-vector-icons/SimpleLineIcons"; 26 | import Octicons from "react-native-vector-icons/Octicons"; 27 | import Zocial from "react-native-vector-icons/Zocial"; 28 | 29 | 30 | // No need to explicitly load fonts individually anymore. React Native Vector Icons handles this. 31 | 32 | interface Props { } // You can define props if your component receives any 33 | 34 | interface State { } // You can define state if your component uses state 35 | 36 | export default class App extends Component { 37 | render() { 38 | const copyIcon = ; // Use FontAwesome directly 39 | 40 | return ( 41 | 42 | { 43 | RNNotificationBanner.Normal({ title: "Message", subTitle: "Sub Message" }); 44 | }}> 45 | {"Normal"} 46 | 47 | 48 | { 49 | setTimeout(() => { 50 | RNNotificationBanner.Dismiss(); 51 | }, 2000); 52 | 53 | RNNotificationBanner.Info({ 54 | title: "Message", 55 | subTitle: "Sub Message", 56 | duration: 10000, 57 | enableProgress: true, 58 | dismissable: false 59 | }); 60 | }}> 61 | {"Info"} 62 | 63 | 64 | { 65 | RNNotificationBanner.Success({ title: 'Message', subTitle: "Sub Message" }); 66 | }}> 67 | {'Success'} 68 | 69 | 70 | { 71 | RNNotificationBanner.Warn({ title: 'Message', subTitle: "Sub Message" }); 72 | }}> 73 | {'Warning'} 74 | 75 | 76 | { 77 | RNNotificationBanner.Error({ title: 'Message', subTitle: "Sub Message" }); 78 | }}> 79 | {'Error'} 80 | 81 | 82 | { 83 | RNNotificationBanner.Show({ 84 | title: "Message", 85 | titleSize: 50, 86 | titleColor: '#555555', 87 | subTitle: "Message", 88 | subTitleSize: 50, 89 | subTitleColor: '#555555', 90 | withIcon: true, 91 | duration: 1, 92 | tintColor: '#000000', 93 | icon: copyIcon, // Use the icon component 94 | dismissable: false, 95 | onClick: () => { 96 | console.log('on click'); 97 | }, 98 | onHide: () => { 99 | console.log('on hide'); 100 | } 101 | }); 102 | }}> 103 | {'Custom'} 104 | 105 | 106 | ); 107 | } 108 | } 109 | 110 | const styles = StyleSheet.create({ 111 | container: { 112 | flex: 1, 113 | justifyContent: 'center', 114 | alignItems: 'center', 115 | backgroundColor: '#F5FCFF', 116 | } 117 | }); -------------------------------------------------------------------------------- /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.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.26.0' 10 | gem 'concurrent-ruby', '< 1.3.4' 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). 2 | 3 | # Getting Started 4 | 5 | > **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding. 6 | 7 | ## Step 1: Start Metro 8 | 9 | First, you will need to run **Metro**, the JavaScript build tool for React Native. 10 | 11 | To start the Metro dev server, run the following command from the root of your React Native project: 12 | 13 | ```sh 14 | # Using npm 15 | npm start 16 | 17 | # OR using Yarn 18 | yarn start 19 | ``` 20 | 21 | ## Step 2: Build and run your app 22 | 23 | With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app: 24 | 25 | ### Android 26 | 27 | ```sh 28 | # Using npm 29 | npm run android 30 | 31 | # OR using Yarn 32 | yarn android 33 | ``` 34 | 35 | ### iOS 36 | 37 | For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps). 38 | 39 | The first time you create a new project, run the Ruby bundler to install CocoaPods itself: 40 | 41 | ```sh 42 | bundle install 43 | ``` 44 | 45 | Then, and every time you update your native dependencies, run: 46 | 47 | ```sh 48 | bundle exec pod install 49 | ``` 50 | 51 | For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html). 52 | 53 | ```sh 54 | # Using npm 55 | npm run ios 56 | 57 | # OR using Yarn 58 | yarn ios 59 | ``` 60 | 61 | If everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device. 62 | 63 | This is one way to run your app — you can also build it directly from Android Studio or Xcode. 64 | 65 | ## Step 3: Modify your app 66 | 67 | Now that you have successfully run the app, let's make changes! 68 | 69 | Open `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh). 70 | 71 | When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload: 72 | 73 | - **Android**: Press the R key twice or select **"Reload"** from the **Dev Menu**, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS). 74 | - **iOS**: Press R in iOS Simulator. 75 | 76 | ## Congratulations! :tada: 77 | 78 | You've successfully run and modified your React Native App. :partying_face: 79 | 80 | ### Now what? 81 | 82 | - If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). 83 | - If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started). 84 | 85 | # Troubleshooting 86 | 87 | If you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. 88 | 89 | # Learn More 90 | 91 | To learn more about React Native, take a look at the following resources: 92 | 93 | - [React Native Website](https://reactnative.dev) - learn more about React Native. 94 | - [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. 95 | - [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. 96 | - [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. 97 | - [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. 98 | -------------------------------------------------------------------------------- /example/__tests__/App.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import React from 'react'; 6 | import ReactTestRenderer from 'react-test-renderer'; 7 | import App from '../App'; 8 | 9 | test('renders correctly', async () => { 10 | await ReactTestRenderer.act(() => { 11 | ReactTestRenderer.create(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | apply plugin: "org.jetbrains.kotlin.android" 3 | apply plugin: "com.facebook.react" 4 | 5 | /** 6 | * This is the configuration block to customize your React Native Android app. 7 | * By default you don't need to apply any configuration, just uncomment the lines you need. 8 | */ 9 | react { 10 | /* Folders */ 11 | // The root of your project, i.e. where "package.json" lives. Default is '../..' 12 | // root = file("../../") 13 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native 14 | // reactNativeDir = file("../../node_modules/react-native") 15 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen 16 | // codegenDir = file("../../node_modules/@react-native/codegen") 17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js 18 | // cliFile = file("../../node_modules/react-native/cli.js") 19 | 20 | /* Variants */ 21 | // The list of variants to that are debuggable. For those we're going to 22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'. 23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. 24 | // debuggableVariants = ["liteDebug", "prodDebug"] 25 | 26 | /* Bundling */ 27 | // A list containing the node command and its flags. Default is just 'node'. 28 | // nodeExecutableAndArgs = ["node"] 29 | // 30 | // The command to run when bundling. By default is 'bundle' 31 | // bundleCommand = "ram-bundle" 32 | // 33 | // The path to the CLI configuration file. Default is empty. 34 | // bundleConfig = file(../rn-cli.config.js) 35 | // 36 | // The name of the generated asset file containing your JS bundle 37 | // bundleAssetName = "MyApplication.android.bundle" 38 | // 39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' 40 | // entryFile = file("../js/MyApplication.android.js") 41 | // 42 | // A list of extra flags to pass to the 'bundle' commands. 43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle 44 | // extraPackagerArgs = [] 45 | 46 | /* Hermes Commands */ 47 | // The hermes compiler command to run. By default it is 'hermesc' 48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" 49 | // 50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" 51 | // hermesFlags = ["-O", "-output-source-map"] 52 | 53 | /* Autolinking */ 54 | autolinkLibrariesWithApp() 55 | } 56 | 57 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 58 | 59 | /** 60 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode. 61 | */ 62 | def enableProguardInReleaseBuilds = false 63 | 64 | /** 65 | * The preferred build flavor of JavaScriptCore (JSC) 66 | * 67 | * For example, to use the international variant, you can use: 68 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 69 | * 70 | * The international variant includes ICU i18n library and necessary data 71 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 72 | * give correct results when using with locales other than en-US. Note that 73 | * this variant is about 6MiB larger per architecture than default. 74 | */ 75 | def jscFlavor = 'org.webkit:android-jsc:+' 76 | 77 | android { 78 | ndkVersion rootProject.ext.ndkVersion 79 | buildToolsVersion rootProject.ext.buildToolsVersion 80 | compileSdk rootProject.ext.compileSdkVersion 81 | 82 | namespace "com.example" 83 | defaultConfig { 84 | applicationId "com.example" 85 | minSdkVersion rootProject.ext.minSdkVersion 86 | targetSdkVersion rootProject.ext.targetSdkVersion 87 | versionCode 1 88 | versionName "1.0" 89 | } 90 | signingConfigs { 91 | debug { 92 | storeFile file('debug.keystore') 93 | storePassword 'android' 94 | keyAlias 'androiddebugkey' 95 | keyPassword 'android' 96 | } 97 | } 98 | buildTypes { 99 | debug { 100 | signingConfig signingConfigs.debug 101 | } 102 | release { 103 | // Caution! In production, you need to generate your own keystore file. 104 | // see https://reactnative.dev/docs/signed-apk-android. 105 | signingConfig signingConfigs.debug 106 | minifyEnabled enableProguardInReleaseBuilds 107 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 108 | } 109 | } 110 | } 111 | 112 | dependencies { 113 | // The version of react-native is set by the React Native Gradle Plugin 114 | implementation("com.facebook.react:react-android") 115 | 116 | if (hermesEnabled.toBoolean()) { 117 | implementation("com.facebook.react:hermes-android") 118 | } else { 119 | implementation jscFlavor 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/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 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | override fun getMainComponentName(): String = "example" 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate(): ReactActivityDelegate = 21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 22 | } 23 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeHost 8 | import com.facebook.react.ReactPackage 9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping 13 | import com.facebook.soloader.SoLoader 14 | 15 | class MainApplication : Application(), ReactApplication { 16 | 17 | override val reactNativeHost: ReactNativeHost = 18 | object : DefaultReactNativeHost(this) { 19 | override fun getPackages(): List = 20 | PackageList(this).packages.apply { 21 | // Packages that cannot be autolinked yet can be added manually here, for example: 22 | // add(MyReactNativePackage()) 23 | } 24 | 25 | override fun getJSMainModuleName(): String = "index" 26 | 27 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 28 | 29 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 30 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 31 | } 32 | 33 | override val reactHost: ReactHost 34 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 35 | 36 | override fun onCreate() { 37 | super.onCreate() 38 | SoLoader.init(this, OpenSourceMergedSoMapping) 39 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 40 | // If you opted-in for the New Architecture, we load the native entry point for this app. 41 | load() 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "35.0.0" 4 | minSdkVersion = 24 5 | compileSdkVersion = 35 6 | targetSdkVersion = 34 7 | ndkVersion = "27.1.12297006" 8 | kotlinVersion = "2.0.21" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:8.8.1") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /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 | android.enableJetifier=true 25 | 26 | # Use this property to specify which architecture you want to build. 27 | # You can also override it from the CLI using 28 | # ./gradlew -PreactNativeArchitectures=x86_64 29 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 30 | 31 | # Use this property to enable support to the new architecture. 32 | # This will allow you to use TurboModules and the Fabric render in 33 | # your application. You should enable this flag either if you want 34 | # to write custom TurboModules/Fabric components OR use libraries that 35 | # are providing them. 36 | newArchEnabled=true 37 | 38 | # Use this property to enable or disable the Hermes JS engine. 39 | # If set to false, you will be using JSC instead. 40 | hermesEnabled=true 41 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prscX/react-native-notification-banner/13bdd603bc0c2b3434a22df21898ec521c15f0d4/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-8.10.2-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /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 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s 90 | ' "$PWD" ) || exit 91 | 92 | # Use the maximum available, or set MAX_FD != -1 to use that value. 93 | MAX_FD=maximum 94 | 95 | warn () { 96 | echo "$*" 97 | } >&2 98 | 99 | die () { 100 | echo 101 | echo "$*" 102 | echo 103 | exit 1 104 | } >&2 105 | 106 | # OS specific support (must be 'true' or 'false'). 107 | cygwin=false 108 | msys=false 109 | darwin=false 110 | nonstop=false 111 | case "$( uname )" in #( 112 | CYGWIN* ) cygwin=true ;; #( 113 | Darwin* ) darwin=true ;; #( 114 | MSYS* | MINGW* ) msys=true ;; #( 115 | NONSTOP* ) nonstop=true ;; 116 | esac 117 | 118 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 119 | 120 | 121 | # Determine the Java command to use to start the JVM. 122 | if [ -n "$JAVA_HOME" ] ; then 123 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 124 | # IBM's JDK on AIX uses strange locations for the executables 125 | JAVACMD=$JAVA_HOME/jre/sh/java 126 | else 127 | JAVACMD=$JAVA_HOME/bin/java 128 | fi 129 | if [ ! -x "$JAVACMD" ] ; then 130 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 131 | 132 | Please set the JAVA_HOME variable in your environment to match the 133 | location of your Java installation." 134 | fi 135 | else 136 | JAVACMD=java 137 | if ! command -v java >/dev/null 2>&1 138 | then 139 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 140 | 141 | Please set the JAVA_HOME variable in your environment to match the 142 | location of your Java installation." 143 | fi 144 | fi 145 | 146 | # Increase the maximum file descriptors if we can. 147 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 148 | case $MAX_FD in #( 149 | max*) 150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 151 | # shellcheck disable=SC2039,SC3045 152 | MAX_FD=$( ulimit -H -n ) || 153 | warn "Could not query maximum file descriptor limit" 154 | esac 155 | case $MAX_FD in #( 156 | '' | soft) :;; #( 157 | *) 158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 159 | # shellcheck disable=SC2039,SC3045 160 | ulimit -n "$MAX_FD" || 161 | warn "Could not set maximum file descriptor limit to $MAX_FD" 162 | esac 163 | fi 164 | 165 | # Collect all arguments for the java command, stacking in reverse order: 166 | # * args from the command line 167 | # * the main class name 168 | # * -classpath 169 | # * -D...appname settings 170 | # * --module-path (only if needed) 171 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 172 | 173 | # For Cygwin or MSYS, switch paths to Windows format before running java 174 | if "$cygwin" || "$msys" ; then 175 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 176 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 177 | 178 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 179 | 180 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 181 | for arg do 182 | if 183 | case $arg in #( 184 | -*) false ;; # don't mess with options #( 185 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 186 | [ -e "$t" ] ;; #( 187 | *) false ;; 188 | esac 189 | then 190 | arg=$( cygpath --path --ignore --mixed "$arg" ) 191 | fi 192 | # Roll the args list around exactly as many times as the number of 193 | # args, so each arg winds up back in the position where it started, but 194 | # possibly modified. 195 | # 196 | # NB: a `for` loop captures its iteration list before it begins, so 197 | # changing the positional parameters here affects neither the number of 198 | # iterations, nor the values presented in `arg`. 199 | shift # remove old arg 200 | set -- "$@" "$arg" # push replacement arg 201 | done 202 | fi 203 | 204 | 205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 207 | 208 | # Collect all arguments for the java command: 209 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 210 | # and any embedded shellness will be escaped. 211 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 212 | # treated as '${Hostname}' itself on the command line. 213 | 214 | set -- \ 215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 216 | -classpath "$CLASSPATH" \ 217 | org.gradle.wrapper.GradleWrapperMain \ 218 | "$@" 219 | 220 | # Stop when "xargs" is not available. 221 | if ! command -v xargs >/dev/null 2>&1 222 | then 223 | die "xargs is not available" 224 | fi 225 | 226 | # Use "xargs" to parse quoted args. 227 | # 228 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 229 | # 230 | # In Bash we could simply go: 231 | # 232 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 233 | # set -- "${ARGS[@]}" "$@" 234 | # 235 | # but POSIX shell has neither arrays nor command substitution, so instead we 236 | # post-process each arg (as a line of input to sed) to backslash-escape any 237 | # character that might be a shell metacharacter, then use eval to reverse 238 | # that process (while maintaining the separation between arguments), and wrap 239 | # the whole thing up as a single "set" statement. 240 | # 241 | # This will of course break if any of these variables contains a newline or 242 | # an unmatched quote. 243 | # 244 | 245 | eval "set -- $( 246 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 247 | xargs -n1 | 248 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 249 | tr '\n' ' ' 250 | )" '"$@"' 251 | 252 | exec "$JAVACMD" "$@" 253 | -------------------------------------------------------------------------------- /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 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'example' 5 | include ':app' 6 | includeBuild('../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/ios/.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/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | else 16 | use_frameworks! 17 | end 18 | 19 | target 'example' do 20 | config = use_native_modules! 21 | 22 | use_react_native!( 23 | :path => config[:reactNativePath], 24 | # An absolute path to your application root. 25 | :app_path => "#{Pod::Config.instance.installation_root}/.." 26 | ) 27 | 28 | pod 'RNImageHelper', :path => '../node_modules/react-native-image-helper/ios' 29 | pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios' 30 | 31 | pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master' 32 | 33 | post_install do |installer| 34 | installer.pods_project.targets.each do |target| 35 | if target.name.include?('BRYXBanner') 36 | target.build_configurations.each do |config| 37 | config.build_settings['SWIFT_VERSION'] = '4.2' 38 | end 39 | end 40 | end 41 | 42 | # Ensure the Swift version is set for all targets 43 | installer.pods_project.targets.each do |target| 44 | target.build_configurations.each do |config| 45 | config.build_settings['SWIFT_VERSION'] = '5.0' 46 | end 47 | end 48 | 49 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 50 | react_native_post_install( 51 | installer, 52 | config[:reactNativePath], 53 | :mac_catalyst_enabled => false, 54 | # :ccache_enabled => true 55 | ) 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 11 | 146C913B713CF4928EC73560 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; }; 12 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; }; 13 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 14 | C7A4CE840792FC8C815C5BF0 /* Pods_example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A2A09A4B0BA25DCCD24E25 /* Pods_example.framework */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 20 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 21 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = example/PrivacyInfo.xcprivacy; sourceTree = ""; }; 22 | 36A2A09A4B0BA25DCCD24E25 /* Pods_example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; 24 | 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; 25 | 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = ""; }; 26 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = ""; }; 27 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | C7A4CE840792FC8C815C5BF0 /* Pods_example.framework in Frameworks */, 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 13B07FAE1A68108700A75B9A /* example */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 46 | 761780EC2CA45674006654EE /* AppDelegate.swift */, 47 | 13B07FB61A68108700A75B9A /* Info.plist */, 48 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 49 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */, 50 | ); 51 | name = example; 52 | sourceTree = ""; 53 | }; 54 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 58 | 36A2A09A4B0BA25DCCD24E25 /* Pods_example.framework */, 59 | ); 60 | name = Frameworks; 61 | sourceTree = ""; 62 | }; 63 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | ); 67 | name = Libraries; 68 | sourceTree = ""; 69 | }; 70 | 83CBB9F61A601CBA00E9B192 = { 71 | isa = PBXGroup; 72 | children = ( 73 | 13B07FAE1A68108700A75B9A /* example */, 74 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 75 | 83CBBA001A601CBA00E9B192 /* Products */, 76 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 77 | BBD78D7AC51CEA395F1C20DB /* Pods */, 78 | ); 79 | indentWidth = 2; 80 | sourceTree = ""; 81 | tabWidth = 2; 82 | usesTabs = 0; 83 | }; 84 | 83CBBA001A601CBA00E9B192 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 13B07F961A680F5B00A75B9A /* example.app */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */, 96 | 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */, 97 | ); 98 | path = Pods; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 13B07F861A680F5B00A75B9A /* example */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 107 | buildPhases = ( 108 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 109 | 13B07F871A680F5B00A75B9A /* Sources */, 110 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 111 | 13B07F8E1A680F5B00A75B9A /* Resources */, 112 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 113 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 114 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 115 | ); 116 | buildRules = ( 117 | ); 118 | dependencies = ( 119 | ); 120 | name = example; 121 | productName = example; 122 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 123 | productType = "com.apple.product-type.application"; 124 | }; 125 | /* End PBXNativeTarget section */ 126 | 127 | /* Begin PBXProject section */ 128 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 129 | isa = PBXProject; 130 | attributes = { 131 | LastUpgradeCheck = 1210; 132 | TargetAttributes = { 133 | 13B07F861A680F5B00A75B9A = { 134 | LastSwiftMigration = 1120; 135 | }; 136 | }; 137 | }; 138 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 139 | compatibilityVersion = "Xcode 12.0"; 140 | developmentRegion = en; 141 | hasScannedForEncodings = 0; 142 | knownRegions = ( 143 | en, 144 | Base, 145 | ); 146 | mainGroup = 83CBB9F61A601CBA00E9B192; 147 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 148 | projectDirPath = ""; 149 | projectRoot = ""; 150 | targets = ( 151 | 13B07F861A680F5B00A75B9A /* example */, 152 | ); 153 | }; 154 | /* End PBXProject section */ 155 | 156 | /* Begin PBXResourcesBuildPhase section */ 157 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 158 | isa = PBXResourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 162 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 163 | 146C913B713CF4928EC73560 /* PrivacyInfo.xcprivacy in Resources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXResourcesBuildPhase section */ 168 | 169 | /* Begin PBXShellScriptBuildPhase section */ 170 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 171 | isa = PBXShellScriptBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | ); 175 | inputPaths = ( 176 | "$(SRCROOT)/.xcode.env.local", 177 | "$(SRCROOT)/.xcode.env", 178 | ); 179 | name = "Bundle React Native code and images"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 185 | }; 186 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputFileListPaths = ( 192 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 193 | ); 194 | name = "[CP] Embed Pods Frameworks"; 195 | outputFileListPaths = ( 196 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | shellPath = /bin/sh; 200 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; 201 | showEnvVarsInLog = 0; 202 | }; 203 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputFileListPaths = ( 209 | ); 210 | inputPaths = ( 211 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 212 | "${PODS_ROOT}/Manifest.lock", 213 | ); 214 | name = "[CP] Check Pods Manifest.lock"; 215 | outputFileListPaths = ( 216 | ); 217 | outputPaths = ( 218 | "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | shellPath = /bin/sh; 222 | 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"; 223 | showEnvVarsInLog = 0; 224 | }; 225 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputFileListPaths = ( 231 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", 232 | ); 233 | name = "[CP] Copy Pods Resources"; 234 | outputFileListPaths = ( 235 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | shellPath = /bin/sh; 239 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; 240 | showEnvVarsInLog = 0; 241 | }; 242 | /* End PBXShellScriptBuildPhase section */ 243 | 244 | /* Begin PBXSourcesBuildPhase section */ 245 | 13B07F871A680F5B00A75B9A /* Sources */ = { 246 | isa = PBXSourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXSourcesBuildPhase section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 13B07F941A680F5B00A75B9A /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */; 259 | buildSettings = { 260 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 261 | CLANG_ENABLE_MODULES = YES; 262 | CURRENT_PROJECT_VERSION = 1; 263 | ENABLE_BITCODE = NO; 264 | INFOPLIST_FILE = example/Info.plist; 265 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; 266 | LD_RUNPATH_SEARCH_PATHS = ( 267 | "$(inherited)", 268 | "@executable_path/Frameworks", 269 | ); 270 | MARKETING_VERSION = 1.0; 271 | OTHER_LDFLAGS = ( 272 | "$(inherited)", 273 | "-ObjC", 274 | "-lc++", 275 | ); 276 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 277 | PRODUCT_NAME = example; 278 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 279 | SWIFT_VERSION = 5.0; 280 | VERSIONING_SYSTEM = "apple-generic"; 281 | }; 282 | name = Debug; 283 | }; 284 | 13B07F951A680F5B00A75B9A /* Release */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = 1; 291 | INFOPLIST_FILE = example/Info.plist; 292 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; 293 | LD_RUNPATH_SEARCH_PATHS = ( 294 | "$(inherited)", 295 | "@executable_path/Frameworks", 296 | ); 297 | MARKETING_VERSION = 1.0; 298 | OTHER_LDFLAGS = ( 299 | "$(inherited)", 300 | "-ObjC", 301 | "-lc++", 302 | ); 303 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 304 | PRODUCT_NAME = example; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Release; 309 | }; 310 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "c++20"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 334 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 335 | CLANG_WARN_STRICT_PROTOTYPES = YES; 336 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 337 | CLANG_WARN_UNREACHABLE_CODE = YES; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 344 | GCC_C_LANGUAGE_STANDARD = gnu99; 345 | GCC_DYNAMIC_NO_PIC = NO; 346 | GCC_NO_COMMON_BLOCKS = YES; 347 | GCC_OPTIMIZATION_LEVEL = 0; 348 | GCC_PREPROCESSOR_DEFINITIONS = ( 349 | "DEBUG=1", 350 | "$(inherited)", 351 | ); 352 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | HEADER_SEARCH_PATHS = ( 360 | "$(inherited)", 361 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", 362 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", 363 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", 364 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", 365 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", 366 | "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", 367 | "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", 368 | "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", 369 | ); 370 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; 371 | LD_RUNPATH_SEARCH_PATHS = ( 372 | /usr/lib/swift, 373 | "$(inherited)", 374 | ); 375 | LIBRARY_SEARCH_PATHS = ( 376 | "\"$(SDKROOT)/usr/lib/swift\"", 377 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 378 | "\"$(inherited)\"", 379 | ); 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | OTHER_CPLUSPLUSFLAGS = ( 383 | "$(OTHER_CFLAGS)", 384 | "-DFOLLY_NO_CONFIG", 385 | "-DFOLLY_MOBILE=1", 386 | "-DFOLLY_USE_LIBCPP=1", 387 | "-DFOLLY_CFG_NO_COROUTINES=1", 388 | "-DFOLLY_HAVE_CLOCK_GETTIME=1", 389 | ); 390 | OTHER_LDFLAGS = ( 391 | "$(inherited)", 392 | " ", 393 | ); 394 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 395 | SDKROOT = iphoneos; 396 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; 397 | USE_HERMES = true; 398 | }; 399 | name = Debug; 400 | }; 401 | 83CBBA211A601CBA00E9B192 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 406 | CLANG_CXX_LANGUAGE_STANDARD = "c++20"; 407 | CLANG_CXX_LIBRARY = "libc++"; 408 | CLANG_ENABLE_MODULES = YES; 409 | CLANG_ENABLE_OBJC_ARC = YES; 410 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 411 | CLANG_WARN_BOOL_CONVERSION = YES; 412 | CLANG_WARN_COMMA = YES; 413 | CLANG_WARN_CONSTANT_CONVERSION = YES; 414 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 415 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 416 | CLANG_WARN_EMPTY_BODY = YES; 417 | CLANG_WARN_ENUM_CONVERSION = YES; 418 | CLANG_WARN_INFINITE_RECURSION = YES; 419 | CLANG_WARN_INT_CONVERSION = YES; 420 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 421 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 422 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 423 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 424 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 425 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 426 | CLANG_WARN_STRICT_PROTOTYPES = YES; 427 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 428 | CLANG_WARN_UNREACHABLE_CODE = YES; 429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 431 | COPY_PHASE_STRIP = YES; 432 | ENABLE_NS_ASSERTIONS = NO; 433 | ENABLE_STRICT_OBJC_MSGSEND = YES; 434 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 435 | GCC_C_LANGUAGE_STANDARD = gnu99; 436 | GCC_NO_COMMON_BLOCKS = YES; 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | HEADER_SEARCH_PATHS = ( 444 | "$(inherited)", 445 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers", 446 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", 447 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers", 448 | "${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios", 449 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx", 450 | "${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", 451 | "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers", 452 | "${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios", 453 | ); 454 | IPHONEOS_DEPLOYMENT_TARGET = 15.1; 455 | LD_RUNPATH_SEARCH_PATHS = ( 456 | /usr/lib/swift, 457 | "$(inherited)", 458 | ); 459 | LIBRARY_SEARCH_PATHS = ( 460 | "\"$(SDKROOT)/usr/lib/swift\"", 461 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 462 | "\"$(inherited)\"", 463 | ); 464 | MTL_ENABLE_DEBUG_INFO = NO; 465 | OTHER_CPLUSPLUSFLAGS = ( 466 | "$(OTHER_CFLAGS)", 467 | "-DFOLLY_NO_CONFIG", 468 | "-DFOLLY_MOBILE=1", 469 | "-DFOLLY_USE_LIBCPP=1", 470 | "-DFOLLY_CFG_NO_COROUTINES=1", 471 | "-DFOLLY_HAVE_CLOCK_GETTIME=1", 472 | ); 473 | OTHER_LDFLAGS = ( 474 | "$(inherited)", 475 | " ", 476 | ); 477 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 478 | SDKROOT = iphoneos; 479 | USE_HERMES = true; 480 | VALIDATE_PRODUCT = YES; 481 | }; 482 | name = Release; 483 | }; 484 | /* End XCBuildConfiguration section */ 485 | 486 | /* Begin XCConfigurationList section */ 487 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | 13B07F941A680F5B00A75B9A /* Debug */, 491 | 13B07F951A680F5B00A75B9A /* Release */, 492 | ); 493 | defaultConfigurationIsVisible = 0; 494 | defaultConfigurationName = Release; 495 | }; 496 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 497 | isa = XCConfigurationList; 498 | buildConfigurations = ( 499 | 83CBBA201A601CBA00E9B192 /* Debug */, 500 | 83CBBA211A601CBA00E9B192 /* Release */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | /* End XCConfigurationList section */ 506 | }; 507 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 508 | } 509 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import React 3 | import React_RCTAppDelegate 4 | import ReactAppDependencyProvider 5 | 6 | @main 7 | class AppDelegate: RCTAppDelegate { 8 | override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { 9 | self.moduleName = "example" 10 | self.dependencyProvider = RCTAppDependencyProvider() 11 | 12 | // You can add your custom initial props in the dictionary below. 13 | // They will be passed down to the ViewController used by React Native. 14 | self.initialProps = [:] 15 | 16 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 17 | } 18 | 19 | override func sourceURL(for bridge: RCTBridge) -> URL? { 20 | self.bundleURL() 21 | } 22 | 23 | override func bundleURL() -> URL? { 24 | #if DEBUG 25 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") 26 | #else 27 | Bundle.main.url(forResource: "main", withExtension: "jsbundle") 28 | #endif 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example/ios/example/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/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | 30 | NSAllowsArbitraryLoads 31 | 32 | NSAllowsLocalNetworking 33 | 34 | 35 | NSLocationWhenInUseUsageDescription 36 | 37 | UILaunchStoryboardName 38 | LaunchScreen 39 | UIRequiredDeviceCapabilities 40 | 41 | arm64 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | UIAppFonts 52 | 53 | AntDesign.ttf 54 | Entypo.ttf 55 | EvilIcons.ttf 56 | Feather.ttf 57 | FontAwesome.ttf 58 | FontAwesome5_Brands.ttf 59 | FontAwesome5_Regular.ttf 60 | FontAwesome5_Solid.ttf 61 | Foundation.ttf 62 | Ionicons.ttf 63 | MaterialIcons.ttf 64 | MaterialCommunityIcons.ttf 65 | Octicons.ttf 66 | SimpleLineIcons.ttf 67 | Zocial.ttf 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /example/ios/example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'react-native', 3 | }; 4 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); 2 | 3 | /** 4 | * Metro configuration 5 | * https://reactnative.dev/docs/metro 6 | * 7 | * @type {import('@react-native/metro-config').MetroConfig} 8 | */ 9 | const config = {}; 10 | 11 | module.exports = mergeConfig(getDefaultConfig(__dirname), config); 12 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "lint": "eslint .", 9 | "start": "react-native start", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "react": "18.3.1", 14 | "react-native": "0.77.0", 15 | "react-native-image-helper": "0.0.4", 16 | "react-native-notification-banner": "3.0.2", 17 | "react-native-vector-icons": "10.2.0" 18 | }, 19 | "devDependencies": { 20 | "@babel/core": "^7.25.2", 21 | "@babel/preset-env": "^7.25.3", 22 | "@babel/runtime": "^7.25.0", 23 | "@react-native-community/cli": "15.0.1", 24 | "@react-native-community/cli-platform-android": "15.0.1", 25 | "@react-native-community/cli-platform-ios": "15.0.1", 26 | "@react-native/babel-preset": "0.77.0", 27 | "@react-native/eslint-config": "0.77.0", 28 | "@react-native/metro-config": "0.77.0", 29 | "@react-native/typescript-config": "0.77.0", 30 | "@types/jest": "^29.5.13", 31 | "@types/react": "^18.2.6", 32 | "@types/react-test-renderer": "^18.0.0", 33 | "eslint": "^8.19.0", 34 | "jest": "^29.6.3", 35 | "prettier": "2.8.8", 36 | "react-test-renderer": "18.3.1", 37 | "typescript": "5.0.4" 38 | }, 39 | "engines": { 40 | "node": ">=18" 41 | } 42 | } -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@react-native/typescript-config/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /ios/RNNotificationBanner.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "BRYXBanner/BRYXBanner-Swift.h" 4 | #import "RNImageHelper.h" 5 | 6 | @interface RNNotificationBanner : NSObject 7 | 8 | @end 9 | 10 | -------------------------------------------------------------------------------- /ios/RNNotificationBanner.m: -------------------------------------------------------------------------------- 1 | 2 | #import "RNNotificationBanner.h" 3 | 4 | @implementation RNNotificationBanner 5 | 6 | RCTResponseSenderBlock _onClickCallback = nil; 7 | RCTResponseSenderBlock _onHideCallback = nil; 8 | 9 | Banner *_banner = nil; 10 | 11 | - (dispatch_queue_t)methodQueue 12 | { 13 | return dispatch_get_main_queue(); 14 | } 15 | RCT_EXPORT_MODULE() 16 | 17 | 18 | 19 | RCT_EXPORT_METHOD(Show:(NSDictionary *)props onClick:(RCTResponseSenderBlock)onClick onHide:(RCTResponseSenderBlock)onHide) { 20 | _onClickCallback = onClick; 21 | _onHideCallback = onHide; 22 | 23 | NSNumber *type = [props objectForKey: @"type"]; 24 | 25 | NSString *title = [props objectForKey: @"title"]; 26 | NSNumber *titleSize = [props objectForKey: @"titleSize"]; 27 | NSString *titleColorValue = [props objectForKey: @"titleColor"]; 28 | 29 | NSString *subTitle = [props objectForKey: @"subTitle"]; 30 | NSNumber *subTitleSize = [props objectForKey: @"subTitleSize"]; 31 | NSString *subTitleColor = [props objectForKey: @"subTitleColor"]; 32 | 33 | NSNumber *duration = [props objectForKey: @"duration"]; 34 | NSNumber *enableProgress = [props objectForKey: @"enableProgress"]; 35 | NSString *tintColorValue = [props objectForKey: @"tintColor"]; 36 | 37 | NSNumber *withIcon = [props objectForKey: @"withIcon"]; 38 | NSDictionary *icon = [props objectForKey: @"icon"]; 39 | UIImage *drawable = nil; 40 | 41 | UIColor *tintColor = nil; 42 | UIColor *titleColor = nil; 43 | 44 | // CSToastStyle *style = [[CSToastStyle alloc] initWithDefaultStyle]; 45 | 46 | if (icon != nil && [icon count] > 0 && [withIcon intValue] == 1) { 47 | drawable = [RNImageHelper GenerateImage: icon]; 48 | } 49 | if (tintColorValue != nil && [tintColorValue length] > 0) { 50 | tintColor = [RNImageHelper ColorFromHexCode: tintColorValue]; 51 | } 52 | if (drawable != nil) { 53 | // style.imageSize = drawable.size; 54 | } 55 | if (titleColorValue != nil && [titleColorValue length] > 0) { 56 | titleColor = [RNImageHelper ColorFromHexCode: titleColorValue]; 57 | } 58 | // if (titleSize != 0) { 59 | // style.titleFont = [UIFont systemFontOfSize: [titleSize intValue]]; 60 | // } 61 | 62 | _banner = [[Banner alloc] initWithTitle:title subtitle:subTitle image:drawable enableProgress:[enableProgress boolValue] backgroundColor:tintColor didTapBlock:nil]; 63 | 64 | if (titleColor != nil) { 65 | _banner.titleLabel.textColor = titleColor; 66 | } 67 | _banner.didTapBlock = ^{ 68 | if (_onClickCallback != nil) _onClickCallback(@[]); 69 | 70 | _onClickCallback = nil; 71 | _onHideCallback = nil; 72 | }; 73 | _banner.didDismissBlock = ^{ 74 | if (_onHideCallback != nil) _onHideCallback(@[]); 75 | 76 | _onClickCallback = nil; 77 | _onHideCallback = nil; 78 | }; 79 | 80 | if ([duration intValue] == 0) { 81 | [_banner show]; 82 | } else { 83 | [_banner showWithDuration: [duration intValue]]; 84 | } 85 | } 86 | 87 | RCT_EXPORT_METHOD(Dismiss) { 88 | if (_banner == nil) return; 89 | 90 | [_banner dismiss]; 91 | } 92 | 93 | @end 94 | 95 | -------------------------------------------------------------------------------- /ios/RNNotificationBanner.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, '../package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'RNNotificationBanner' 7 | s.version = package['version'] 8 | s.summary = package['description'] 9 | s.description = package['description'] 10 | s.homepage = package['homepage'] 11 | s.license = package['license'] 12 | s.author = package['author'] 13 | s.source = { :git => 'https://github.com/prscX/react-native-notification-banner.git', :tag => 'master' } 14 | 15 | s.platform = :ios, '9.0' 16 | s.ios.deployment_target = '8.0' 17 | 18 | s.preserve_paths = 'LICENSE', 'package.json' 19 | s.source_files = '**/*.{h,m}' 20 | s.dependency 'React-Core' 21 | s.dependency 'BRYXBanner' 22 | s.dependency 'RNImageHelper' 23 | end -------------------------------------------------------------------------------- /ios/RNNotificationBanner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A79F11730BD61F5DDE09C915 /* Pods_RNNotificationBanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E15E95BC5E4144B21B72EBC /* Pods_RNNotificationBanner.framework */; }; 11 | B3E7B58A1CC2AC0600A0062D /* RNNotificationBanner.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNNotificationBanner.m */; }; 12 | CE91FE2020FF505800EBFE38 /* BRYXBanner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE91FE1420FF466000EBFE38 /* BRYXBanner.framework */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXContainerItemProxy section */ 16 | CE91FE1320FF466000EBFE38 /* PBXContainerItemProxy */ = { 17 | isa = PBXContainerItemProxy; 18 | containerPortal = CE91FE0E20FF465F00EBFE38 /* Pods.xcodeproj */; 19 | proxyType = 2; 20 | remoteGlobalIDString = 7A26863DF0C616A095B0A0416B8DCE40; 21 | remoteInfo = BRYXBanner; 22 | }; 23 | CE91FE1520FF466000EBFE38 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = CE91FE0E20FF465F00EBFE38 /* Pods.xcodeproj */; 26 | proxyType = 2; 27 | remoteGlobalIDString = E2A083EB519063A23AF34451A1AC72AE; 28 | remoteInfo = "Pods-RNNotificationBanner"; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXCopyFilesBuildPhase section */ 33 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 34 | isa = PBXCopyFilesBuildPhase; 35 | buildActionMask = 2147483647; 36 | dstPath = "include/$(PRODUCT_NAME)"; 37 | dstSubfolderSpec = 16; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXCopyFilesBuildPhase section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 134814201AA4EA6300B7C361 /* libRNNotificationBanner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNNotificationBanner.a; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 8E15E95BC5E4144B21B72EBC /* Pods_RNNotificationBanner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNNotificationBanner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | B3E7B5881CC2AC0600A0062D /* RNNotificationBanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNotificationBanner.h; sourceTree = ""; }; 48 | B3E7B5891CC2AC0600A0062D /* RNNotificationBanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNotificationBanner.m; sourceTree = ""; }; 49 | CE91FE0E20FF465F00EBFE38 /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = ""; }; 50 | DAEFF6CE0778ECC72D0083B4 /* Pods-RNNotificationBanner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNNotificationBanner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNNotificationBanner/Pods-RNNotificationBanner.debug.xcconfig"; sourceTree = ""; }; 51 | F3436422B99CC0033D361FCB /* Pods-RNNotificationBanner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNNotificationBanner.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNNotificationBanner/Pods-RNNotificationBanner.release.xcconfig"; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | CE91FE2020FF505800EBFE38 /* BRYXBanner.framework in Frameworks */, 60 | A79F11730BD61F5DDE09C915 /* Pods_RNNotificationBanner.framework in Frameworks */, 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | /* End PBXFrameworksBuildPhase section */ 65 | 66 | /* Begin PBXGroup section */ 67 | 134814211AA4EA7D00B7C361 /* Products */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 134814201AA4EA6300B7C361 /* libRNNotificationBanner.a */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | 58B511D21A9E6C8500147676 = { 76 | isa = PBXGroup; 77 | children = ( 78 | B3E7B5881CC2AC0600A0062D /* RNNotificationBanner.h */, 79 | B3E7B5891CC2AC0600A0062D /* RNNotificationBanner.m */, 80 | 134814211AA4EA7D00B7C361 /* Products */, 81 | A3F88F03550A5F6690C397F1 /* Frameworks */, 82 | 834CAEC332B789E03F54FF43 /* Pods */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 834CAEC332B789E03F54FF43 /* Pods */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | DAEFF6CE0778ECC72D0083B4 /* Pods-RNNotificationBanner.debug.xcconfig */, 90 | F3436422B99CC0033D361FCB /* Pods-RNNotificationBanner.release.xcconfig */, 91 | ); 92 | name = Pods; 93 | sourceTree = ""; 94 | }; 95 | A3F88F03550A5F6690C397F1 /* Frameworks */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | CE91FE0E20FF465F00EBFE38 /* Pods.xcodeproj */, 99 | 8E15E95BC5E4144B21B72EBC /* Pods_RNNotificationBanner.framework */, 100 | ); 101 | name = Frameworks; 102 | sourceTree = ""; 103 | }; 104 | CE91FE0F20FF465F00EBFE38 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | CE91FE1420FF466000EBFE38 /* BRYXBanner.framework */, 108 | CE91FE1620FF466000EBFE38 /* Pods_RNNotificationBanner.framework */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | /* End PBXGroup section */ 114 | 115 | /* Begin PBXNativeTarget section */ 116 | 58B511DA1A9E6C8500147676 /* RNNotificationBanner */ = { 117 | isa = PBXNativeTarget; 118 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNotificationBanner" */; 119 | buildPhases = ( 120 | 8C8788EB1496FFC1BF94F2B2 /* [CP] Check Pods Manifest.lock */, 121 | 58B511D71A9E6C8500147676 /* Sources */, 122 | 58B511D81A9E6C8500147676 /* Frameworks */, 123 | 58B511D91A9E6C8500147676 /* CopyFiles */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = RNNotificationBanner; 130 | productName = RCTDataManager; 131 | productReference = 134814201AA4EA6300B7C361 /* libRNNotificationBanner.a */; 132 | productType = "com.apple.product-type.library.static"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | 58B511D31A9E6C8500147676 /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | LastUpgradeCheck = 0830; 141 | ORGANIZATIONNAME = Facebook; 142 | TargetAttributes = { 143 | 58B511DA1A9E6C8500147676 = { 144 | CreatedOnToolsVersion = 6.1.1; 145 | }; 146 | }; 147 | }; 148 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNotificationBanner" */; 149 | compatibilityVersion = "Xcode 3.2"; 150 | developmentRegion = English; 151 | hasScannedForEncodings = 0; 152 | knownRegions = ( 153 | en, 154 | ); 155 | mainGroup = 58B511D21A9E6C8500147676; 156 | productRefGroup = 58B511D21A9E6C8500147676; 157 | projectDirPath = ""; 158 | projectReferences = ( 159 | { 160 | ProductGroup = CE91FE0F20FF465F00EBFE38 /* Products */; 161 | ProjectRef = CE91FE0E20FF465F00EBFE38 /* Pods.xcodeproj */; 162 | }, 163 | ); 164 | projectRoot = ""; 165 | targets = ( 166 | 58B511DA1A9E6C8500147676 /* RNNotificationBanner */, 167 | ); 168 | }; 169 | /* End PBXProject section */ 170 | 171 | /* Begin PBXReferenceProxy section */ 172 | CE91FE1420FF466000EBFE38 /* BRYXBanner.framework */ = { 173 | isa = PBXReferenceProxy; 174 | fileType = wrapper.framework; 175 | path = BRYXBanner.framework; 176 | remoteRef = CE91FE1320FF466000EBFE38 /* PBXContainerItemProxy */; 177 | sourceTree = BUILT_PRODUCTS_DIR; 178 | }; 179 | CE91FE1620FF466000EBFE38 /* Pods_RNNotificationBanner.framework */ = { 180 | isa = PBXReferenceProxy; 181 | fileType = wrapper.framework; 182 | path = Pods_RNNotificationBanner.framework; 183 | remoteRef = CE91FE1520FF466000EBFE38 /* PBXContainerItemProxy */; 184 | sourceTree = BUILT_PRODUCTS_DIR; 185 | }; 186 | /* End PBXReferenceProxy section */ 187 | 188 | /* Begin PBXShellScriptBuildPhase section */ 189 | 8C8788EB1496FFC1BF94F2B2 /* [CP] Check Pods Manifest.lock */ = { 190 | isa = PBXShellScriptBuildPhase; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | inputPaths = ( 195 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 196 | "${PODS_ROOT}/Manifest.lock", 197 | ); 198 | name = "[CP] Check Pods Manifest.lock"; 199 | outputPaths = ( 200 | "$(DERIVED_FILE_DIR)/Pods-RNNotificationBanner-checkManifestLockResult.txt", 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 205 | showEnvVarsInLog = 0; 206 | }; 207 | /* End PBXShellScriptBuildPhase section */ 208 | 209 | /* Begin PBXSourcesBuildPhase section */ 210 | 58B511D71A9E6C8500147676 /* Sources */ = { 211 | isa = PBXSourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | B3E7B58A1CC2AC0600A0062D /* RNNotificationBanner.m in Sources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | /* End PBXSourcesBuildPhase section */ 219 | 220 | /* Begin XCBuildConfiguration section */ 221 | 58B511ED1A9E6C8500147676 /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ALWAYS_SEARCH_USER_PATHS = NO; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_WARN_BOOL_CONVERSION = YES; 230 | CLANG_WARN_CONSTANT_CONVERSION = YES; 231 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 232 | CLANG_WARN_EMPTY_BODY = YES; 233 | CLANG_WARN_ENUM_CONVERSION = YES; 234 | CLANG_WARN_INFINITE_RECURSION = YES; 235 | CLANG_WARN_INT_CONVERSION = YES; 236 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 237 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 238 | CLANG_WARN_UNREACHABLE_CODE = YES; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | COPY_PHASE_STRIP = NO; 241 | ENABLE_STRICT_OBJC_MSGSEND = YES; 242 | ENABLE_TESTABILITY = YES; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_DYNAMIC_NO_PIC = NO; 245 | GCC_NO_COMMON_BLOCKS = YES; 246 | GCC_OPTIMIZATION_LEVEL = 0; 247 | GCC_PREPROCESSOR_DEFINITIONS = ( 248 | "DEBUG=1", 249 | "$(inherited)", 250 | ); 251 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 252 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 254 | GCC_WARN_UNDECLARED_SELECTOR = YES; 255 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 256 | GCC_WARN_UNUSED_FUNCTION = YES; 257 | GCC_WARN_UNUSED_VARIABLE = YES; 258 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 259 | MTL_ENABLE_DEBUG_INFO = YES; 260 | ONLY_ACTIVE_ARCH = YES; 261 | SDKROOT = iphoneos; 262 | }; 263 | name = Debug; 264 | }; 265 | 58B511EE1A9E6C8500147676 /* Release */ = { 266 | isa = XCBuildConfiguration; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 270 | CLANG_CXX_LIBRARY = "libc++"; 271 | CLANG_ENABLE_MODULES = YES; 272 | CLANG_ENABLE_OBJC_ARC = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_CONSTANT_CONVERSION = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_EMPTY_BODY = YES; 277 | CLANG_WARN_ENUM_CONVERSION = YES; 278 | CLANG_WARN_INFINITE_RECURSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 282 | CLANG_WARN_UNREACHABLE_CODE = YES; 283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 284 | COPY_PHASE_STRIP = YES; 285 | ENABLE_NS_ASSERTIONS = NO; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_NO_COMMON_BLOCKS = YES; 289 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 291 | GCC_WARN_UNDECLARED_SELECTOR = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 293 | GCC_WARN_UNUSED_FUNCTION = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 296 | MTL_ENABLE_DEBUG_INFO = NO; 297 | SDKROOT = iphoneos; 298 | VALIDATE_PRODUCT = YES; 299 | }; 300 | name = Release; 301 | }; 302 | 58B511F01A9E6C8500147676 /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | baseConfigurationReference = DAEFF6CE0778ECC72D0083B4 /* Pods-RNNotificationBanner.debug.xcconfig */; 305 | buildSettings = { 306 | HEADER_SEARCH_PATHS = ( 307 | "$(inherited)", 308 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 309 | "$(SRCROOT)/../../../React/**", 310 | "$(SRCROOT)/../../react-native/React/**", 311 | ); 312 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 313 | OTHER_LDFLAGS = "-ObjC"; 314 | PRODUCT_NAME = RNNotificationBanner; 315 | SKIP_INSTALL = YES; 316 | }; 317 | name = Debug; 318 | }; 319 | 58B511F11A9E6C8500147676 /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | baseConfigurationReference = F3436422B99CC0033D361FCB /* Pods-RNNotificationBanner.release.xcconfig */; 322 | buildSettings = { 323 | HEADER_SEARCH_PATHS = ( 324 | "$(inherited)", 325 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 326 | "$(SRCROOT)/../../../React/**", 327 | "$(SRCROOT)/../../react-native/React/**", 328 | ); 329 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 330 | OTHER_LDFLAGS = "-ObjC"; 331 | PRODUCT_NAME = RNNotificationBanner; 332 | SKIP_INSTALL = YES; 333 | }; 334 | name = Release; 335 | }; 336 | /* End XCBuildConfiguration section */ 337 | 338 | /* Begin XCConfigurationList section */ 339 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNNotificationBanner" */ = { 340 | isa = XCConfigurationList; 341 | buildConfigurations = ( 342 | 58B511ED1A9E6C8500147676 /* Debug */, 343 | 58B511EE1A9E6C8500147676 /* Release */, 344 | ); 345 | defaultConfigurationIsVisible = 0; 346 | defaultConfigurationName = Release; 347 | }; 348 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNNotificationBanner" */ = { 349 | isa = XCConfigurationList; 350 | buildConfigurations = ( 351 | 58B511F01A9E6C8500147676 /* Debug */, 352 | 58B511F11A9E6C8500147676 /* Release */, 353 | ); 354 | defaultConfigurationIsVisible = 0; 355 | defaultConfigurationName = Release; 356 | }; 357 | /* End XCConfigurationList section */ 358 | }; 359 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 360 | } 361 | -------------------------------------------------------------------------------- /ios/RNNotificationBanner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /js/RNNotificationBanner.js: -------------------------------------------------------------------------------- 1 | import React, { PureComponent } from 'react' 2 | import { 3 | findNodeHandle, 4 | ViewPropTypes, 5 | NativeModules, 6 | Platform 7 | } from 'react-native' 8 | import PropTypes from 'prop-types' 9 | 10 | import RNImageHelper from 'react-native-image-helper' 11 | import Feather from 'react-native-vector-icons/Feather' 12 | 13 | const { RNNotificationBanner } = NativeModules 14 | 15 | class NotificationBanner extends PureComponent { 16 | static propTypes = { 17 | ...ViewPropTypes, 18 | 19 | type: PropTypes.number, 20 | 21 | title: PropTypes.string, 22 | titleSize: PropTypes.number, 23 | titleColor: PropTypes.string, 24 | 25 | subTitle: PropTypes.string, 26 | subTitleSize: PropTypes.number, 27 | subTitleColor: PropTypes.string, 28 | 29 | duration: PropTypes.number, 30 | enableProgress: PropTypes.bool, 31 | tintColor: PropTypes.string, 32 | 33 | withIcon: PropTypes.bool, 34 | icon: PropTypes.object, 35 | 36 | dismissable: PropTypes.bool, 37 | isSwipeToDismissEnabled: PropTypes.bool, 38 | 39 | onClick: PropTypes.func, 40 | onHide: PropTypes.func 41 | } 42 | 43 | static defaultProps = { 44 | type: 0, 45 | 46 | title: '', 47 | titleSize: 0, 48 | titleColor: '', 49 | 50 | subTitle: '', 51 | subTitleSize: 0, 52 | subTitleColor: '', 53 | 54 | duration: 0, 55 | enableProgress: false, 56 | 57 | tintColor: '', 58 | withIcon: true, 59 | 60 | dismissable: true, 61 | isSwipeToDismissEnabled: true 62 | } 63 | 64 | static Duration = { 65 | Short: 0, 66 | Long: 1 67 | } 68 | 69 | static Types = { 70 | Normal: 0, 71 | Info: 1, 72 | Success: 2, 73 | Warn: 3, 74 | Error: 4 75 | } 76 | 77 | static Show(props) { 78 | if (!props) props = {} 79 | if (props.type === undefined) 80 | props.type = NotificationBanner.defaultProps.type 81 | 82 | if (props.title === undefined) 83 | props.title = NotificationBanner.defaultProps.title 84 | if (props.titleSize === undefined) 85 | props.titleSize = NotificationBanner.defaultProps.titleSize 86 | if (props.titleColor === undefined) 87 | props.titleColor = NotificationBanner.defaultProps.titleColor 88 | 89 | if (props.subTitle === undefined) 90 | props.subTitle = NotificationBanner.defaultProps.subTitle 91 | if (props.subTitleSize === undefined) 92 | props.subTitleSize = NotificationBanner.defaultProps.subTitleSize 93 | if (props.subTitleColor === undefined) 94 | props.subTitleColor = NotificationBanner.defaultProps.subTitleColor 95 | 96 | if (props.duration === undefined) 97 | props.duration = NotificationBanner.defaultProps.duration 98 | if (props.enableProgress === undefined) 99 | props.enableProgress = NotificationBanner.defaultProps.enableProgress 100 | 101 | if (props.tintColor === undefined) 102 | props.tintColor = NotificationBanner.defaultProps.tintColor 103 | if (props.withIcon === undefined) 104 | props.withIcon = NotificationBanner.defaultProps.withIcon 105 | 106 | if (props.dismissable === undefined) { 107 | props.dismissable = NotificationBanner.defaultProps.dismissable 108 | } 109 | 110 | if (props.isSwipeToDismissEnabled === undefined) { 111 | props.isSwipeToDismissEnabled = NotificationBanner.defaultProps.isSwipeToDismissEnabled 112 | } 113 | 114 | if (props.withIcon) { 115 | if (props.icon && props.icon.props) { 116 | let icon = props.icon.props 117 | 118 | let vectorIcon = RNImageHelper.Resolve(icon.family, icon.name) 119 | props.icon = Object.assign({}, icon, vectorIcon) 120 | } 121 | } else { 122 | props.icon = undefined 123 | } 124 | 125 | let _onClick = () => { 126 | props.onClick && props.onClick() 127 | } 128 | let _onHide = () => { 129 | props.onHide && props.onHide() 130 | } 131 | 132 | RNNotificationBanner.Show(props, _onClick, _onHide) 133 | } 134 | 135 | static Dismiss() { 136 | RNNotificationBanner.Dismiss() 137 | } 138 | 139 | static successStyle = { 140 | tintColor: '#4b994f', 141 | icon: ( 142 | 148 | ) 149 | } 150 | static Success(props) { 151 | if (!props) props = {} 152 | if (props.tintColor === undefined) 153 | props.tintColor = NotificationBanner.successStyle.tintColor 154 | if (props.icon === undefined) 155 | props.icon = NotificationBanner.successStyle.icon 156 | 157 | props.type = NotificationBanner.Types.Success 158 | 159 | NotificationBanner.Show(props) 160 | } 161 | 162 | static errorStyle = { 163 | tintColor: '#d81919', 164 | icon: ( 165 | 171 | ) 172 | } 173 | static Error(props) { 174 | if (!props) props = {} 175 | if (props.tintColor === undefined) 176 | props.tintColor = NotificationBanner.errorStyle.tintColor 177 | if (props.icon === undefined) 178 | props.icon = NotificationBanner.errorStyle.icon 179 | 180 | props.type = NotificationBanner.Types.Error 181 | 182 | NotificationBanner.Show(props) 183 | } 184 | 185 | static infoStyle = { 186 | tintColor: '#5162bc', 187 | icon: ( 188 | 194 | ) 195 | } 196 | static Info(props) { 197 | if (!props) props = {} 198 | if (props.tintColor === undefined) 199 | props.tintColor = NotificationBanner.infoStyle.tintColor 200 | if (props.icon === undefined) props.icon = NotificationBanner.infoStyle.icon 201 | 202 | props.type = NotificationBanner.Types.Info 203 | 204 | NotificationBanner.Show(props) 205 | } 206 | 207 | static warnStyle = { 208 | tintColor: '#feb119', 209 | icon: ( 210 | 216 | ) 217 | } 218 | static Warn(props) { 219 | if (!props) props = {} 220 | if (props.tintColor === undefined) 221 | props.tintColor = NotificationBanner.warnStyle.tintColor 222 | if (props.icon === undefined) props.icon = NotificationBanner.warnStyle.icon 223 | 224 | props.type = NotificationBanner.Types.Warn 225 | 226 | NotificationBanner.Show(props) 227 | } 228 | 229 | static normalStyle = { 230 | tintColor: '#484d51' 231 | } 232 | static Normal(props) { 233 | if (!props) props = {} 234 | if (props.tintColor === undefined) 235 | props.tintColor = NotificationBanner.normalStyle.tintColor 236 | 237 | props.type = NotificationBanner.Types.Normal 238 | 239 | NotificationBanner.Show(props) 240 | } 241 | 242 | componentDidMount() { } 243 | 244 | componentDidUpdate() { } 245 | 246 | show() { } 247 | 248 | render() { 249 | return null 250 | } 251 | } 252 | 253 | export { NotificationBanner as RNNotificationBanner } 254 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-notification-banner", 3 | "version": "3.0.1", 4 | "description": "ReactNative: Native Notification Banner", 5 | "main": "js/RNNotificationBanner.js", 6 | "homepage": "https://github.com/prscX/react-native-notification-banner.git", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/prscX/react-native-notification-banner.git" 10 | }, 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1" 13 | }, 14 | "keywords": [ 15 | "react-native" 16 | ], 17 | "author": "Pranav Raj Singh Chauhan", 18 | "dependencies": { 19 | }, 20 | "devDependencies": { 21 | "prettier-pack": "0.0.8" 22 | }, 23 | "license": "Apache License 2.0" 24 | } 25 | --------------------------------------------------------------------------------