@psync/notifee 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/LICENSE +44 -0
  2. package/README.md +142 -0
  3. package/RNNotifee.podspec +39 -0
  4. package/RNNotifeeCore.podspec +33 -0
  5. package/android/.editorconfig +10 -0
  6. package/android/build.gradle +116 -0
  7. package/android/gradle.properties +1 -0
  8. package/android/lint.xml +5 -0
  9. package/android/proguard-rules.pro +82 -0
  10. package/android/settings.gradle +1 -0
  11. package/android/src/main/AndroidManifest.xml +12 -0
  12. package/android/src/main/java/io/invertase/notifee/HeadlessTask.java +431 -0
  13. package/android/src/main/java/io/invertase/notifee/NotifeeApiModule.java +365 -0
  14. package/android/src/main/java/io/invertase/notifee/NotifeeEventSubscriber.java +118 -0
  15. package/android/src/main/java/io/invertase/notifee/NotifeeInitProvider.java +55 -0
  16. package/android/src/main/java/io/invertase/notifee/NotifeePackage.java +30 -0
  17. package/android/src/main/java/io/invertase/notifee/NotifeeReactUtils.java +135 -0
  18. package/dist/NotifeeApiModule.d.ts +53 -0
  19. package/dist/NotifeeApiModule.js +609 -0
  20. package/dist/NotifeeApiModule.js.map +1 -0
  21. package/dist/NotifeeJSEventEmitter.d.ts +3 -0
  22. package/dist/NotifeeJSEventEmitter.js +14 -0
  23. package/dist/NotifeeJSEventEmitter.js.map +1 -0
  24. package/dist/NotifeeNativeError.d.ts +15 -0
  25. package/dist/NotifeeNativeError.js +59 -0
  26. package/dist/NotifeeNativeError.js.map +1 -0
  27. package/dist/NotifeeNativeModule.d.ts +14 -0
  28. package/dist/NotifeeNativeModule.js +42 -0
  29. package/dist/NotifeeNativeModule.js.map +1 -0
  30. package/dist/NotifeeNativeModule.web.d.ts +12 -0
  31. package/dist/NotifeeNativeModule.web.js +18 -0
  32. package/dist/NotifeeNativeModule.web.js.map +1 -0
  33. package/dist/index.d.ts +8 -0
  34. package/dist/index.js +43 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/types/Library.d.ts +21 -0
  37. package/dist/types/Library.js +6 -0
  38. package/dist/types/Library.js.map +1 -0
  39. package/dist/types/Module.d.ts +576 -0
  40. package/dist/types/Module.js +6 -0
  41. package/dist/types/Module.js.map +1 -0
  42. package/dist/types/Notification.d.ts +462 -0
  43. package/dist/types/Notification.js +111 -0
  44. package/dist/types/Notification.js.map +1 -0
  45. package/dist/types/NotificationAndroid.d.ts +1311 -0
  46. package/dist/types/NotificationAndroid.js +409 -0
  47. package/dist/types/NotificationAndroid.js.map +1 -0
  48. package/dist/types/NotificationIOS.d.ts +539 -0
  49. package/dist/types/NotificationIOS.js +92 -0
  50. package/dist/types/NotificationIOS.js.map +1 -0
  51. package/dist/types/NotificationWeb.d.ts +5 -0
  52. package/dist/types/NotificationWeb.js +6 -0
  53. package/dist/types/NotificationWeb.js.map +1 -0
  54. package/dist/types/PowerManagerInfo.d.ts +36 -0
  55. package/dist/types/PowerManagerInfo.js +6 -0
  56. package/dist/types/PowerManagerInfo.js.map +1 -0
  57. package/dist/types/Trigger.d.ts +124 -0
  58. package/dist/types/Trigger.js +51 -0
  59. package/dist/types/Trigger.js.map +1 -0
  60. package/dist/utils/id.d.ts +1 -0
  61. package/dist/utils/id.js +15 -0
  62. package/dist/utils/id.js.map +1 -0
  63. package/dist/utils/index.d.ts +16 -0
  64. package/dist/utils/index.js +51 -0
  65. package/dist/utils/index.js.map +1 -0
  66. package/dist/utils/validate.d.ts +15 -0
  67. package/dist/utils/validate.js +90 -0
  68. package/dist/utils/validate.js.map +1 -0
  69. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.d.ts +2 -0
  70. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js +51 -0
  71. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js.map +1 -0
  72. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.d.ts +2 -0
  73. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js +27 -0
  74. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js.map +1 -0
  75. package/dist/validators/validate.d.ts +25 -0
  76. package/dist/validators/validate.js +74 -0
  77. package/dist/validators/validate.js.map +1 -0
  78. package/dist/validators/validateAndroidAction.d.ts +2 -0
  79. package/dist/validators/validateAndroidAction.js +52 -0
  80. package/dist/validators/validateAndroidAction.js.map +1 -0
  81. package/dist/validators/validateAndroidChannel.d.ts +2 -0
  82. package/dist/validators/validateAndroidChannel.js +155 -0
  83. package/dist/validators/validateAndroidChannel.js.map +1 -0
  84. package/dist/validators/validateAndroidChannelGroup.d.ts +2 -0
  85. package/dist/validators/validateAndroidChannelGroup.js +42 -0
  86. package/dist/validators/validateAndroidChannelGroup.js.map +1 -0
  87. package/dist/validators/validateAndroidFullScreenAction.d.ts +2 -0
  88. package/dist/validators/validateAndroidFullScreenAction.js +50 -0
  89. package/dist/validators/validateAndroidFullScreenAction.js.map +1 -0
  90. package/dist/validators/validateAndroidInput.d.ts +2 -0
  91. package/dist/validators/validateAndroidInput.js +54 -0
  92. package/dist/validators/validateAndroidInput.js.map +1 -0
  93. package/dist/validators/validateAndroidNotification.d.ts +2 -0
  94. package/dist/validators/validateAndroidNotification.js +547 -0
  95. package/dist/validators/validateAndroidNotification.js.map +1 -0
  96. package/dist/validators/validateAndroidPressAction.d.ts +2 -0
  97. package/dist/validators/validateAndroidPressAction.js +50 -0
  98. package/dist/validators/validateAndroidPressAction.js.map +1 -0
  99. package/dist/validators/validateAndroidStyle.d.ts +22 -0
  100. package/dist/validators/validateAndroidStyle.js +230 -0
  101. package/dist/validators/validateAndroidStyle.js.map +1 -0
  102. package/dist/validators/validateIOSAttachment.d.ts +6 -0
  103. package/dist/validators/validateIOSAttachment.js +100 -0
  104. package/dist/validators/validateIOSAttachment.js.map +1 -0
  105. package/dist/validators/validateIOSCategory.d.ts +2 -0
  106. package/dist/validators/validateIOSCategory.js +124 -0
  107. package/dist/validators/validateIOSCategory.js.map +1 -0
  108. package/dist/validators/validateIOSCategoryAction.d.ts +2 -0
  109. package/dist/validators/validateIOSCategoryAction.js +59 -0
  110. package/dist/validators/validateIOSCategoryAction.js.map +1 -0
  111. package/dist/validators/validateIOSInput.d.ts +2 -0
  112. package/dist/validators/validateIOSInput.js +32 -0
  113. package/dist/validators/validateIOSInput.js.map +1 -0
  114. package/dist/validators/validateIOSNotification.d.ts +2 -0
  115. package/dist/validators/validateIOSNotification.js +211 -0
  116. package/dist/validators/validateIOSNotification.js.map +1 -0
  117. package/dist/validators/validateIOSPermissions.d.ts +2 -0
  118. package/dist/validators/validateIOSPermissions.js +62 -0
  119. package/dist/validators/validateIOSPermissions.js.map +1 -0
  120. package/dist/validators/validateNotification.d.ts +11 -0
  121. package/dist/validators/validateNotification.js +129 -0
  122. package/dist/validators/validateNotification.js.map +1 -0
  123. package/dist/validators/validateTrigger.d.ts +2 -0
  124. package/dist/validators/validateTrigger.js +110 -0
  125. package/dist/validators/validateTrigger.js.map +1 -0
  126. package/dist/version.d.ts +1 -0
  127. package/dist/version.js +6 -0
  128. package/dist/version.js.map +1 -0
  129. package/ios/NotifeeCore/Info.plist +22 -0
  130. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.h +28 -0
  131. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +76 -0
  132. package/ios/NotifeeCore/NotifeeCore+NSURLSession.h +25 -0
  133. package/ios/NotifeeCore/NotifeeCore+NSURLSession.m +55 -0
  134. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +44 -0
  135. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +270 -0
  136. package/ios/NotifeeCore/NotifeeCore.h +118 -0
  137. package/ios/NotifeeCore/NotifeeCore.m +843 -0
  138. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.h +34 -0
  139. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.m +70 -0
  140. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.h +39 -0
  141. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.m +68 -0
  142. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.h +38 -0
  143. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.m +224 -0
  144. package/ios/NotifeeCore/NotifeeCoreUtil.h +81 -0
  145. package/ios/NotifeeCore/NotifeeCoreUtil.m +834 -0
  146. package/ios/RNNotifee/NotifeeApiModule.h +25 -0
  147. package/ios/RNNotifee/NotifeeApiModule.m +371 -0
  148. package/ios/RNNotifee/NotifeeExtensionHelper.h +37 -0
  149. package/ios/RNNotifee/NotifeeExtensionHelper.m +37 -0
  150. package/ios/RNNotifee.xcodeproj/project.pbxproj +318 -0
  151. package/ios/RNNotifee.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  152. package/ios/RNNotifee.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  153. package/jest-mock.js +161 -0
  154. package/package.json +74 -0
  155. package/react-native.config.js +11 -0
  156. package/src/NotifeeApiModule.ts +827 -0
  157. package/src/NotifeeJSEventEmitter.ts +10 -0
  158. package/src/NotifeeNativeError.ts +68 -0
  159. package/src/NotifeeNativeModule.ts +54 -0
  160. package/src/NotifeeNativeModule.web.ts +24 -0
  161. package/src/index.ts +33 -0
  162. package/src/types/Library.ts +28 -0
  163. package/src/types/Module.ts +629 -0
  164. package/src/types/Notification.ts +518 -0
  165. package/src/types/NotificationAndroid.ts +1478 -0
  166. package/src/types/NotificationIOS.ts +683 -0
  167. package/src/types/NotificationWeb.ts +5 -0
  168. package/src/types/PowerManagerInfo.ts +43 -0
  169. package/src/types/Trigger.ts +136 -0
  170. package/src/utils/id.ts +13 -0
  171. package/src/utils/index.ts +46 -0
  172. package/src/utils/validate.ts +90 -0
  173. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfo.ts +61 -0
  174. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.ts +33 -0
  175. package/src/validators/validate.ts +85 -0
  176. package/src/validators/validateAndroidAction.ts +54 -0
  177. package/src/validators/validateAndroidChannel.ts +188 -0
  178. package/src/validators/validateAndroidChannelGroup.ts +49 -0
  179. package/src/validators/validateAndroidFullScreenAction.ts +65 -0
  180. package/src/validators/validateAndroidInput.ts +67 -0
  181. package/src/validators/validateAndroidNotification.ts +734 -0
  182. package/src/validators/validateAndroidPressAction.ts +65 -0
  183. package/src/validators/validateAndroidStyle.ts +315 -0
  184. package/src/validators/validateIOSAttachment.ts +135 -0
  185. package/src/validators/validateIOSCategory.ts +150 -0
  186. package/src/validators/validateIOSCategoryAction.ts +65 -0
  187. package/src/validators/validateIOSInput.ts +38 -0
  188. package/src/validators/validateIOSNotification.ts +296 -0
  189. package/src/validators/validateIOSPermissions.ts +78 -0
  190. package/src/validators/validateNotification.ts +156 -0
  191. package/src/validators/validateTrigger.ts +142 -0
  192. package/src/version.ts +2 -0
  193. package/tsconfig.json +23 -0
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Apache-2.0 License
2
+ ------------------
3
+
4
+ Copyright (c) 2016-present Invertase Limited <oss@invertase.io>
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this library except in compliance with the License.
8
+
9
+ You may obtain a copy of the Apache-2.0 License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+
20
+
21
+ Creative Commons Attribution 3.0 License
22
+ ----------------------------------------
23
+
24
+ Copyright (c) 2016-present Invertase Limited <oss@invertase.io>
25
+
26
+ Documentation and other instructional materials provided for this project
27
+ (including on a separate documentation repository or it's documentation website) are
28
+ licensed under the Creative Commons Attribution 3.0 License. Code samples/blocks
29
+ contained therein are licensed under the Apache License, Version 2.0 (the "License"), as above.
30
+
31
+ You may obtain a copy of the Creative Commons Attribution 3.0 License at
32
+
33
+ https://creativecommons.org/licenses/by/3.0/
34
+
35
+
36
+
37
+ Notifee CORE License
38
+ --------------------
39
+
40
+ The Notifee "core" submodule on Android/iOS (e.g. `android/libs/notifee_core_release.aar`) is not Open Source
41
+ but is distributed in minified & obfuscated form. A purchased license is required to use Notifee Core in
42
+ release builds and is subject to the Notifee License terms which can be found at:
43
+
44
+ https://notifee.app/license-terms
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ <p align="center">
2
+ <a href="https://notifee.app">
3
+ <img width="160px" src="https://notifee.app/logo-icon.png"><br/>
4
+ </a>
5
+ <h2 align="center">Notifee - React Native</h2>
6
+ </p>
7
+
8
+ ---
9
+
10
+ > ⚠️ **New Architecture Only**: This version of Notifee is built **exclusively for React Native New Architecture**. It requires React Native 0.76+ with the New Architecture enabled. For the legacy architecture, use the stable release branch.
11
+
12
+ A feature rich Android & iOS notifications library for React Native.
13
+
14
+ [> Learn More](https://notifee.app/)
15
+
16
+ ## Platform Requirements
17
+
18
+ | Requirement | Minimum Version |
19
+ |-------------|-----------------|
20
+ | React Native | 0.76+ (New Architecture enabled) |
21
+ | iOS Deployment Target | 15.0+ |
22
+ | Android minSdk | 23+ |
23
+ | Xcode | 16.2+ (for iOS development) |
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ yarn add @psync/notifee
29
+ ```
30
+
31
+ ## Documentation
32
+
33
+ - [Overview](https://notifee.app/react-native/docs/overview)
34
+ - [Licensing](https://notifee.app/react-native/docs/license-keys)
35
+ - [Reference](https://notifee.app/react-native/reference)
36
+
37
+ ### Android
38
+
39
+ The APIs for Android allow for creating rich, styled and highly interactive notifications. Below you'll find guides that cover the supported Android features.
40
+
41
+ | Topic | |
42
+ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
43
+ | [Appearance](https://notifee.app/react-native/docs/android/appearance) | Change the appearance of a notification; icons, colors, visibility etc. |
44
+ | [Behaviour](https://notifee.app/react-native/docs/android/behaviour) | Customize how a notification behaves when it is delivered to a device; sound, vibration, lights etc. |
45
+ | [Channels & Groups](https://notifee.app/react-native/docs/android/channels) | Organize your notifications into channels & groups to allow users to control how notifications are handled on their device |
46
+ | [Foreground Service](https://notifee.app/react-native/docs/android/foreground-service) | Long running background tasks can take advantage of a Android Foreground Services to display an on-going, prominent notification. |
47
+ | [Grouping & Sorting](https://notifee.app/react-native/docs/android/grouping-and-sorting) | Group and sort related notifications in a single notification pane. |
48
+ | [Interaction](https://notifee.app/react-native/docs/android/interaction) | Allow users to interact with your application directly from the notification with actions. |
49
+ | [Progress Indicators](https://notifee.app/react-native/docs/android/progress-indicators) | Show users a progress indicator of an on-going background task, and learn how to keep it updated. |
50
+ | [Styles](https://notifee.app/react-native/docs/android/styles) | Style notifications to show richer content, such as expandable images/text, or message conversations. |
51
+ | [Timers](https://notifee.app/react-native/docs/android/timers) | Display counting timers on your notification, useful for on-going tasks such as a phone call, or event time remaining. |
52
+
53
+ ### iOS
54
+
55
+ Below you'll find guides that cover the supported iOS features.
56
+
57
+ | Topic | |
58
+ | ----------------------------------------------------------------- | ------------------------------------------------------------------------ |
59
+ | [Appearance](https://notifee.app/react-native/docs/ios/appearance) | Change now the notification is displayed to your users. |
60
+ | [Behaviour](https://notifee.app/react-native/docs/ios/behaviour) | Control how notifications behave when they are displayed to a device; sound, crtitial alerts etc. |
61
+ | [Categories](https://notifee.app/react-native/docs/ios/categories) | Create & assign categories to notifications. |
62
+ | [Interaction](https://notifee.app/react-native/docs/ios/interaction) | Handle user interaction with your notifications. | |
63
+ | [Permissions](https://notifee.app/react-native/docs/ios/permissions) | Request permission from your application users to display notifications. | |
64
+
65
+ ### Jest Testing
66
+
67
+ To run jest tests after integrating this module, you will need to mock out the native parts of Notifee or you will get an error that looks like:
68
+
69
+ ```bash
70
+ ● Test suite failed to run
71
+
72
+ Notifee native module not found.
73
+
74
+ 59 | this._nativeModule = NativeModules[this._moduleConfig.nativeModuleName];
75
+ 60 | if (this._nativeModule == null) {
76
+ > 61 | throw new Error('Notifee native module not found.');
77
+ | ^
78
+ 62 | }
79
+ 63 |
80
+ 64 | return this._nativeModule;
81
+ ```
82
+
83
+ Add this to a setup file in your project e.g. `jest.setup.js`:
84
+
85
+ If you don't already have a Jest setup file configured, please add the following to your Jest configuration file and create the new jest.setup.js file in project root:
86
+
87
+ ```js
88
+ setupFiles: ['<rootDir>/jest.setup.js'],
89
+ ```
90
+
91
+ You can then add the following line to that setup file to mock `notifee`:
92
+
93
+ ```js
94
+ jest.mock('@psync/notifee', () => require('@psync/notifee/jest-mock'))
95
+ ```
96
+
97
+ You will also need to add `@notifee` to `transformIgnorePatterns` in your config file (`jest.config.js`):
98
+
99
+ ```bash
100
+ transformIgnorePatterns: [
101
+ 'node_modules/(?!(jest-)?react-native|@react-native|@notifee)'
102
+ ]
103
+ ```
104
+
105
+ ### Detox Testing
106
+
107
+ To utilise Detox's functionality to mock a local notification and trigger notifee's event handlers, you will need a payload with a key `__notifee_notification`:
108
+
109
+ ```js
110
+ {
111
+ title: 'test',
112
+ body: 'Body',
113
+ payload: {
114
+ __notifee_notification: {
115
+ ios: {
116
+ foregroundPresentationOptions: {
117
+ banner: true,
118
+ list: true,
119
+ },
120
+ },
121
+ data: {}
122
+ },
123
+ },
124
+ }
125
+ ```
126
+
127
+ The important part is to make sure you have a `__notifee_notification` object under `payload` with the default properties.
128
+
129
+ ## License
130
+
131
+ - See [LICENSE](/LICENSE)
132
+
133
+ ---
134
+
135
+ <p>
136
+ <img align="left" width="50px" src="https://static.invertase.io/assets/invertase/invertase-rounded.png">
137
+ <p align="left">
138
+ Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>.
139
+ </p>
140
+ </p>
141
+
142
+ ---
@@ -0,0 +1,39 @@
1
+
2
+ require 'json'
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "RNNotifee"
7
+ s.version = package["version"]
8
+ s.description = package["description"]
9
+ s.summary = <<-DESC
10
+ A feature rich local notifications library for React Native Android & iOS.
11
+ DESC
12
+ s.homepage = "https://notifee.app"
13
+ s.license = package['license']
14
+ s.authors = "Invertase Limited"
15
+ s.source = { :git => "https://github.com/invertase/notifee", :tag => "v#{s.version}" }
16
+ s.social_media_url = 'http://twitter.com/notifee_app'
17
+
18
+ s.cocoapods_version = '>= 1.10.0'
19
+ s.ios.deployment_target = '10.0'
20
+
21
+ s.dependency 'React-Core'
22
+ s.source_files = ['ios/RNNotifee/NotifeeApiModule.h', 'ios/RNNotifee/NotifeeApiModule.m']
23
+
24
+ if defined?($NotifeeCoreFromSources) && $NotifeeCoreFromSources == true
25
+ # internal dev flag used by Notifee devs, ignore
26
+ Pod::UI.warn "RNNotifee: Using NotifeeCore from sources."
27
+ s.dependency 'NotifeeCore'
28
+ elsif defined?($NotifeeExtension) && $NotifeeExtension == true
29
+ # App uses Notification Service Extension
30
+ Pod::UI.warn "RNNotifee: using Notification Service Extension."
31
+ s.dependency 'RNNotifeeCore'
32
+ else
33
+ s.subspec "NotifeeCore" do |ss|
34
+ ss.source_files = "ios/NotifeeCore/*.{h,mm,m}"
35
+ end
36
+ end
37
+
38
+ end
39
+
@@ -0,0 +1,33 @@
1
+
2
+ require 'json'
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "RNNotifeeCore"
7
+ s.version = package["version"]
8
+ s.description = package["description"]
9
+ s.summary = <<-DESC
10
+ A feature rich local notifications library for React Native Android & iOS.
11
+ DESC
12
+ s.homepage = "https://notifee.app"
13
+ s.license = package['license']
14
+ s.authors = "Invertase Limited"
15
+ s.source = { :git => "https://github.com/notifee/react-native-notifee", :tag => "v#{s.version}" }
16
+ s.social_media_url = 'http://twitter.com/notifee_app'
17
+
18
+ s.cocoapods_version = '>= 1.10.0'
19
+ s.ios.deployment_target = '10.0'
20
+
21
+ if defined?($NotifeeCoreFromSources) && $NotifeeCoreFromSources == true
22
+ # internal dev flag used by Notifee devs, ignore
23
+ Pod::UI.warn "RNNotifeeCore: Using NotifeeCore from sources."
24
+ s.dependency 'NotifeeCore'
25
+ else
26
+ s.subspec "NotifeeCore" do |ss|
27
+ ss.source_files = "ios/NotifeeCore/*.{h,mm,m}"
28
+ end
29
+ end
30
+
31
+ s.source_files = ['ios/RNNotifee/NotifeeExtensionHelper.h', 'ios/RNNotifee/NotifeeExtensionHelper.m']
32
+ s.public_header_files = ['ios/RNNotifee/NotifeeExtensionHelper.h']
33
+ end
@@ -0,0 +1,10 @@
1
+ # editorconfig
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
@@ -0,0 +1,116 @@
1
+ import java.nio.file.Paths
2
+
3
+ buildscript {
4
+ // The Android Gradle plugin is only required when opening the android folder stand-alone.
5
+ // This avoids unnecessary downloads and potential conflicts when the library is included as a
6
+ // module dependency in an application project.
7
+ if (project == rootProject) {
8
+ repositories {
9
+ google()
10
+ mavenCentral()
11
+ }
12
+
13
+ dependencies {
14
+ classpath("com.android.tools.build:gradle:8.7.3")
15
+ }
16
+ }
17
+ }
18
+
19
+ plugins {
20
+ id "io.invertase.gradle.build" version "1.5"
21
+ }
22
+
23
+ // https://github.com/facebook/react-native/blob/a70354df12ef71aec08583cca4f1fed5fb77d874/ReactAndroid/build.gradle#L168-L201
24
+ def findNodeModulePath(baseDir, packageName) {
25
+ def basePath = baseDir.toPath().normalize()
26
+ // Node's module resolution algorithm searches up to the root directory,
27
+ // after which the base path will be null
28
+ while (basePath) {
29
+ def candidatePath = Paths.get(basePath.toString(), "node_modules", packageName)
30
+ if (candidatePath.toFile().exists()) {
31
+ return candidatePath.toString()
32
+ }
33
+ basePath = basePath.getParent()
34
+ }
35
+ return null
36
+ }
37
+
38
+ def notifeeDir = findNodeModulePath(projectDir, "@psync/notifee") ?: "$rootDir/../node_modules/@psync/notifee"
39
+ println ":${project.name} @psync/notifee found at $notifeeDir"
40
+
41
+ if (project.hasProperty('reactNativeProjects')) {
42
+ reactNativeProjects.each { dependent ->
43
+ project.evaluationDependsOn(dependent)
44
+ }
45
+ } else {
46
+ project.evaluationDependsOn(':app')
47
+ }
48
+
49
+ project.ext {
50
+ set('react-native', [
51
+ versions: [
52
+ android: [
53
+ minSdk : 28,
54
+ targetSdk : 35,
55
+ compileSdk: 36,
56
+ ],
57
+ ],
58
+ ])
59
+ }
60
+
61
+ android {
62
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
63
+ // Check AGP version for backward compatibility w/react-native versions still on gradle plugin 6
64
+ if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
65
+ namespace = "io.invertase.notifee"
66
+ }
67
+
68
+ defaultConfig {
69
+ multiDexEnabled true
70
+ }
71
+ lintOptions {
72
+ disable 'GradleCompatible'
73
+ abortOnError false
74
+ }
75
+ compileOptions {
76
+ sourceCompatibility JavaVersion.VERSION_21
77
+ targetCompatibility JavaVersion.VERSION_17
78
+ }
79
+ buildTypes {
80
+ release {
81
+ consumerProguardFiles 'proguard-rules.pro'
82
+ }
83
+ }
84
+ compileSdkVersion = 34
85
+ }
86
+
87
+ repositories {
88
+ google()
89
+ mavenCentral()
90
+ }
91
+
92
+ dependencies {
93
+ if (findProject(':notifee_core')) {
94
+ implementation findProject(':notifee_core')
95
+ } else {
96
+ implementation(group: 'app.notifee', name:'core', version: '+')
97
+ }
98
+
99
+ implementation("com.google.guava:guava:33.3.1-android") // https://github.com/google/guava
100
+ implementation 'androidx.concurrent:concurrent-futures:1.1.0' // https://developer.android.com/jetpack/androidx/releases/concurrent
101
+ implementation 'androidx.work:work-runtime:2.8.0' // https://developer.android.com/jetpack/androidx/releases/work
102
+ implementation 'org.greenrobot:eventbus:3.3.1' // https://github.com/greenrobot/EventBus/releases
103
+ implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
104
+ }
105
+
106
+ ReactNative.shared.applyPackageVersion()
107
+ ReactNative.shared.applyDefaultExcludes()
108
+ ReactNative.module.applyAndroidVersions()
109
+ ReactNative.module.applyReactNativeDependency("api")
110
+ rootProject.allprojects {
111
+ repositories {
112
+ maven {
113
+ url "$notifeeDir/android/libs"
114
+ }
115
+ }
116
+ }
@@ -0,0 +1 @@
1
+ NOTIFEE=1
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <lint>
3
+ <!-- Disable the given check in this project -->
4
+ <issue id="GradleCompatible" severity="ignore" />
5
+ </lint>
@@ -0,0 +1,82 @@
1
+ -keep class io.invertase.notifee.NotifeeEventSubscriber
2
+ -keep class io.invertase.notifee.NotifeeInitProvider
3
+ -keepnames class io.invertase.notifee.NotifeePackage
4
+ -keepnames class io.invertase.notifee.NotifeeApiModule
5
+
6
+ # We depend on certain classes to exist under their names for dynamic
7
+ # class-loading to work. We use this to handle new arch / old arch backwards
8
+ # compatibility despite the class names moving around
9
+ -keep class com.facebook.react.defaults.DefaultNewArchitectureEntryPoint { *; }
10
+ -keep class com.facebook.react.ReactApplication { *; }
11
+ -keep class com.facebook.react.ReactHost { *; }
12
+ -keep class * extends com.facebook.react.ReactHost { *; }
13
+ -keepnames class com.facebook.react.ReactActivity
14
+
15
+ # Preserve all annotations.
16
+ -keepattributes *Annotation*
17
+
18
+ # Keep the classes/members we need for client functionality.
19
+ -keep @interface androidx.annotation.Keep
20
+ -keep @androidx.annotation.Keep class *
21
+ -keepclasseswithmembers class * {
22
+ @androidx.annotation.Keep <fields>;
23
+ }
24
+ -keepclasseswithmembers class * {
25
+ @androidx.annotation.Keep <methods>;
26
+ }
27
+
28
+ # Keep the classes/members we need for client functionality.
29
+ -keep @interface app.notifee.core.KeepForSdk
30
+ -keep @app.notifee.core.KeepForSdk class *
31
+ -keepclasseswithmembers class * {
32
+ @app.notifee.core.KeepForSdk <fields>;
33
+ }
34
+ -keepclasseswithmembers class * {
35
+ @app.notifee.core.KeepForSdk <methods>;
36
+ }
37
+
38
+ # Preserve all .class method names.
39
+ -keepclassmembernames class * {
40
+ java.lang.Class class$(java.lang.String);
41
+ java.lang.Class class$(java.lang.String, boolean);
42
+ }
43
+
44
+ # Preserve all native method names and the names of their classes.
45
+ -keepclasseswithmembernames class * {
46
+ native <methods>;
47
+ }
48
+
49
+ # Preserve the special static methods that are required in all enumeration
50
+ # classes.
51
+ -keepclassmembers class * extends java.lang.Enum {
52
+ public static **[] values();
53
+ public static ** valueOf(java.lang.String);
54
+ }
55
+
56
+ # --------------------------------
57
+ # LIBRARIES
58
+ # --------------------------------
59
+
60
+ # Work Manager
61
+ -keepclassmembers class * extends androidx.work.ListenableWorker {
62
+ public <init>(android.content.Context,androidx.work.WorkerParameters);
63
+ }
64
+
65
+ # EventBus
66
+ -keepclassmembers class * {
67
+ @org.greenrobot.eventbus.Subscribe <methods>;
68
+ }
69
+ -keep enum org.greenrobot.eventbus.ThreadMode { *; }
70
+
71
+ # Only required if you use AsyncExecutor
72
+ -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
73
+ <init>(java.lang.Throwable);
74
+ }
75
+
76
+ # OkHttp3
77
+ -dontwarn okio.**
78
+ -dontwarn okhttp3.**
79
+ -dontwarn javax.annotation.**
80
+ -dontwarn org.conscrypt.**
81
+ # A resource is loaded with a relative path so the package of this class must be preserved.
82
+ -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
@@ -0,0 +1 @@
1
+ rootProject.name = '@notifee_react_native'
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="io.invertase.notifee">
4
+
5
+ <application>
6
+ <provider
7
+ android:name=".NotifeeInitProvider"
8
+ android:authorities="${applicationId}.notifee-init-provider"
9
+ android:exported="false"
10
+ android:initOrder="-100" />
11
+ </application>
12
+ </manifest>