@ammarahmed/notifee-react-native 7.3.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 (215) hide show
  1. package/.gitattributes +3 -0
  2. package/LICENSE +44 -0
  3. package/README.md +131 -0
  4. package/RNNotifee.podspec +39 -0
  5. package/RNNotifeeCore.podspec +33 -0
  6. package/android/build.gradle +116 -0
  7. package/android/gradle.properties +1 -0
  8. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar +0 -0
  9. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.md5 +1 -0
  10. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha1 +1 -0
  11. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha256 +1 -0
  12. package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha512 +1 -0
  13. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom +9 -0
  14. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.md5 +1 -0
  15. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha1 +1 -0
  16. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha256 +1 -0
  17. package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha512 +1 -0
  18. package/android/libs/app/notifee/core/maven-metadata.xml +13 -0
  19. package/android/libs/app/notifee/core/maven-metadata.xml.md5 +1 -0
  20. package/android/libs/app/notifee/core/maven-metadata.xml.sha1 +1 -0
  21. package/android/libs/app/notifee/core/maven-metadata.xml.sha256 +1 -0
  22. package/android/libs/app/notifee/core/maven-metadata.xml.sha512 +1 -0
  23. package/android/lint.xml +5 -0
  24. package/android/proguard-rules.pro +74 -0
  25. package/android/settings.gradle +1 -0
  26. package/android/src/main/AndroidManifest.xml +12 -0
  27. package/android/src/main/java/io/invertase/notifee/NotifeeApiModule.java +349 -0
  28. package/android/src/main/java/io/invertase/notifee/NotifeeEventSubscriber.java +118 -0
  29. package/android/src/main/java/io/invertase/notifee/NotifeeInitProvider.java +55 -0
  30. package/android/src/main/java/io/invertase/notifee/NotifeePackage.java +30 -0
  31. package/android/src/main/java/io/invertase/notifee/NotifeeReactUtils.java +244 -0
  32. package/app.plugin.js +1 -0
  33. package/dist/NotifeeApiModule.d.ts +53 -0
  34. package/dist/NotifeeApiModule.js +607 -0
  35. package/dist/NotifeeApiModule.js.map +1 -0
  36. package/dist/NotifeeJSEventEmitter.d.ts +3 -0
  37. package/dist/NotifeeJSEventEmitter.js +14 -0
  38. package/dist/NotifeeJSEventEmitter.js.map +1 -0
  39. package/dist/NotifeeNativeError.d.ts +15 -0
  40. package/dist/NotifeeNativeError.js +61 -0
  41. package/dist/NotifeeNativeError.js.map +1 -0
  42. package/dist/NotifeeNativeModule.d.ts +14 -0
  43. package/dist/NotifeeNativeModule.js +43 -0
  44. package/dist/NotifeeNativeModule.js.map +1 -0
  45. package/dist/NotifeeNativeModule.web.d.ts +12 -0
  46. package/dist/NotifeeNativeModule.web.js +19 -0
  47. package/dist/NotifeeNativeModule.web.js.map +1 -0
  48. package/dist/index.d.ts +8 -0
  49. package/dist/index.js +43 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/types/Library.d.ts +21 -0
  52. package/dist/types/Library.js +6 -0
  53. package/dist/types/Library.js.map +1 -0
  54. package/dist/types/Module.d.ts +572 -0
  55. package/dist/types/Module.js +6 -0
  56. package/dist/types/Module.js.map +1 -0
  57. package/dist/types/Notification.d.ts +450 -0
  58. package/dist/types/Notification.js +105 -0
  59. package/dist/types/Notification.js.map +1 -0
  60. package/dist/types/NotificationAndroid.d.ts +1276 -0
  61. package/dist/types/NotificationAndroid.js +380 -0
  62. package/dist/types/NotificationAndroid.js.map +1 -0
  63. package/dist/types/NotificationIOS.d.ts +537 -0
  64. package/dist/types/NotificationIOS.js +92 -0
  65. package/dist/types/NotificationIOS.js.map +1 -0
  66. package/dist/types/NotificationWeb.d.ts +5 -0
  67. package/dist/types/NotificationWeb.js +3 -0
  68. package/dist/types/NotificationWeb.js.map +1 -0
  69. package/dist/types/PowerManagerInfo.d.ts +36 -0
  70. package/dist/types/PowerManagerInfo.js +6 -0
  71. package/dist/types/PowerManagerInfo.js.map +1 -0
  72. package/dist/types/Trigger.d.ts +108 -0
  73. package/dist/types/Trigger.js +39 -0
  74. package/dist/types/Trigger.js.map +1 -0
  75. package/dist/utils/id.d.ts +1 -0
  76. package/dist/utils/id.js +16 -0
  77. package/dist/utils/id.js.map +1 -0
  78. package/dist/utils/index.d.ts +16 -0
  79. package/dist/utils/index.js +52 -0
  80. package/dist/utils/index.js.map +1 -0
  81. package/dist/utils/validate.d.ts +15 -0
  82. package/dist/utils/validate.js +93 -0
  83. package/dist/utils/validate.js.map +1 -0
  84. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.d.ts +2 -0
  85. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js +39 -0
  86. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js.map +1 -0
  87. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.d.ts +2 -0
  88. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js +27 -0
  89. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js.map +1 -0
  90. package/dist/validators/validate.d.ts +25 -0
  91. package/dist/validators/validate.js +75 -0
  92. package/dist/validators/validate.js.map +1 -0
  93. package/dist/validators/validateAndroidAction.d.ts +2 -0
  94. package/dist/validators/validateAndroidAction.js +52 -0
  95. package/dist/validators/validateAndroidAction.js.map +1 -0
  96. package/dist/validators/validateAndroidChannel.d.ts +2 -0
  97. package/dist/validators/validateAndroidChannel.js +155 -0
  98. package/dist/validators/validateAndroidChannel.js.map +1 -0
  99. package/dist/validators/validateAndroidChannelGroup.d.ts +2 -0
  100. package/dist/validators/validateAndroidChannelGroup.js +42 -0
  101. package/dist/validators/validateAndroidChannelGroup.js.map +1 -0
  102. package/dist/validators/validateAndroidFullScreenAction.d.ts +2 -0
  103. package/dist/validators/validateAndroidFullScreenAction.js +50 -0
  104. package/dist/validators/validateAndroidFullScreenAction.js.map +1 -0
  105. package/dist/validators/validateAndroidInput.d.ts +2 -0
  106. package/dist/validators/validateAndroidInput.js +54 -0
  107. package/dist/validators/validateAndroidInput.js.map +1 -0
  108. package/dist/validators/validateAndroidNotification.d.ts +2 -0
  109. package/dist/validators/validateAndroidNotification.js +529 -0
  110. package/dist/validators/validateAndroidNotification.js.map +1 -0
  111. package/dist/validators/validateAndroidPressAction.d.ts +2 -0
  112. package/dist/validators/validateAndroidPressAction.js +50 -0
  113. package/dist/validators/validateAndroidPressAction.js.map +1 -0
  114. package/dist/validators/validateAndroidStyle.d.ts +22 -0
  115. package/dist/validators/validateAndroidStyle.js +231 -0
  116. package/dist/validators/validateAndroidStyle.js.map +1 -0
  117. package/dist/validators/validateIOSAttachment.d.ts +6 -0
  118. package/dist/validators/validateIOSAttachment.js +102 -0
  119. package/dist/validators/validateIOSAttachment.js.map +1 -0
  120. package/dist/validators/validateIOSCategory.d.ts +2 -0
  121. package/dist/validators/validateIOSCategory.js +124 -0
  122. package/dist/validators/validateIOSCategory.js.map +1 -0
  123. package/dist/validators/validateIOSCategoryAction.d.ts +2 -0
  124. package/dist/validators/validateIOSCategoryAction.js +59 -0
  125. package/dist/validators/validateIOSCategoryAction.js.map +1 -0
  126. package/dist/validators/validateIOSInput.d.ts +2 -0
  127. package/dist/validators/validateIOSInput.js +32 -0
  128. package/dist/validators/validateIOSInput.js.map +1 -0
  129. package/dist/validators/validateIOSNotification.d.ts +2 -0
  130. package/dist/validators/validateIOSNotification.js +211 -0
  131. package/dist/validators/validateIOSNotification.js.map +1 -0
  132. package/dist/validators/validateIOSPermissions.d.ts +2 -0
  133. package/dist/validators/validateIOSPermissions.js +62 -0
  134. package/dist/validators/validateIOSPermissions.js.map +1 -0
  135. package/dist/validators/validateNotification.d.ts +11 -0
  136. package/dist/validators/validateNotification.js +129 -0
  137. package/dist/validators/validateNotification.js.map +1 -0
  138. package/dist/validators/validateTrigger.d.ts +2 -0
  139. package/dist/validators/validateTrigger.js +104 -0
  140. package/dist/validators/validateTrigger.js.map +1 -0
  141. package/dist/version.d.ts +1 -0
  142. package/dist/version.js.map +1 -0
  143. package/ios/NotifeeCore/Info.plist +22 -0
  144. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.h +28 -0
  145. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +72 -0
  146. package/ios/NotifeeCore/NotifeeCore+NSURLSession.h +25 -0
  147. package/ios/NotifeeCore/NotifeeCore+NSURLSession.m +55 -0
  148. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +37 -0
  149. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +242 -0
  150. package/ios/NotifeeCore/NotifeeCore.h +118 -0
  151. package/ios/NotifeeCore/NotifeeCore.m +784 -0
  152. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.h +34 -0
  153. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.m +70 -0
  154. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.h +39 -0
  155. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.m +68 -0
  156. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.h +38 -0
  157. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.m +224 -0
  158. package/ios/NotifeeCore/NotifeeCoreUtil.h +82 -0
  159. package/ios/NotifeeCore/NotifeeCoreUtil.m +793 -0
  160. package/ios/RNNotifee/NotifeeApiModule.h +25 -0
  161. package/ios/RNNotifee/NotifeeApiModule.m +371 -0
  162. package/ios/RNNotifee/NotifeeExtensionHelper.h +37 -0
  163. package/ios/RNNotifee/NotifeeExtensionHelper.m +37 -0
  164. package/ios/RNNotifee.xcodeproj/project.pbxproj +318 -0
  165. package/jest-mock.js +158 -0
  166. package/package.json +59 -0
  167. package/plugin/build/index.d.ts +3 -0
  168. package/plugin/build/index.js +12 -0
  169. package/plugin/build/index.js.map +1 -0
  170. package/plugin/build/withNotifeeProjectGradlePlugin.d.ts +5 -0
  171. package/plugin/build/withNotifeeProjectGradlePlugin.js +24 -0
  172. package/plugin/build/withNotifeeProjectGradlePlugin.js.map +1 -0
  173. package/plugin/src/index.ts +9 -0
  174. package/plugin/src/withNotifeeProjectGradlePlugin.ts +27 -0
  175. package/plugin/tsconfig.json +9 -0
  176. package/react-native.config.js +11 -0
  177. package/refresh-example.sh +71 -0
  178. package/src/NotifeeApiModule.ts +825 -0
  179. package/src/NotifeeJSEventEmitter.ts +11 -0
  180. package/src/NotifeeNativeError.ts +70 -0
  181. package/src/NotifeeNativeModule.ts +55 -0
  182. package/src/NotifeeNativeModule.web.ts +25 -0
  183. package/src/index.ts +33 -0
  184. package/src/types/Library.ts +28 -0
  185. package/src/types/Module.ts +625 -0
  186. package/src/types/Notification.ts +505 -0
  187. package/src/types/NotificationAndroid.ts +1443 -0
  188. package/src/types/NotificationIOS.ts +681 -0
  189. package/src/types/NotificationWeb.ts +5 -0
  190. package/src/types/PowerManagerInfo.ts +43 -0
  191. package/src/types/Trigger.ts +118 -0
  192. package/src/utils/id.ts +13 -0
  193. package/src/utils/index.ts +47 -0
  194. package/src/utils/validate.ts +92 -0
  195. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfo.ts +45 -0
  196. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.ts +33 -0
  197. package/src/validators/validate.ts +85 -0
  198. package/src/validators/validateAndroidAction.ts +54 -0
  199. package/src/validators/validateAndroidChannel.ts +188 -0
  200. package/src/validators/validateAndroidChannelGroup.ts +49 -0
  201. package/src/validators/validateAndroidFullScreenAction.ts +65 -0
  202. package/src/validators/validateAndroidInput.ts +67 -0
  203. package/src/validators/validateAndroidNotification.ts +704 -0
  204. package/src/validators/validateAndroidPressAction.ts +65 -0
  205. package/src/validators/validateAndroidStyle.ts +315 -0
  206. package/src/validators/validateIOSAttachment.ts +136 -0
  207. package/src/validators/validateIOSCategory.ts +150 -0
  208. package/src/validators/validateIOSCategoryAction.ts +65 -0
  209. package/src/validators/validateIOSInput.ts +38 -0
  210. package/src/validators/validateIOSNotification.ts +296 -0
  211. package/src/validators/validateIOSPermissions.ts +78 -0
  212. package/src/validators/validateNotification.ts +156 -0
  213. package/src/validators/validateTrigger.ts +134 -0
  214. package/src/version.ts +2 -0
  215. package/tsconfig.json +23 -0
@@ -0,0 +1,450 @@
1
+ import { IOSNotificationSettings, NotificationIOS } from './NotificationIOS';
2
+ import { NativeAndroidChannel, NativeAndroidChannelGroup, NotificationAndroid, AndroidLaunchActivityFlag } from './NotificationAndroid';
3
+ import { AndroidNotificationSettings, Trigger } from '..';
4
+ import { WebNotificationSettings } from './NotificationWeb';
5
+ /**
6
+ * Interface for building a local notification for both Android & iOS devices.
7
+ *
8
+ * To learn more about displaying a notification, view the [Displaying a Notification](/react-native/docs/displaying-a-notification)
9
+ * documentation.
10
+ *
11
+ */
12
+ export interface Notification {
13
+ /**
14
+ * A unique identifier for your notification.
15
+ *
16
+ * Notifications with the same ID will be created as the same instance, allowing you to update
17
+ * a notification which already exists on the device.
18
+ *
19
+ * Defaults to a random string if not provided.
20
+ */
21
+ id?: string;
22
+ /**
23
+ * The notification title which appears above the body text.
24
+ */
25
+ title?: string | undefined;
26
+ /**
27
+ * The notification subtitle, which appears on a new line below/next the title.
28
+ */
29
+ subtitle?: string | undefined;
30
+ /**
31
+ * The main body content of a notification.
32
+ */
33
+ body?: string | undefined;
34
+ /**
35
+ * Additional data to store on the notification. Only `string` values can be stored.
36
+ *
37
+ * Data can be used to provide additional context to your notification which can be retrieved
38
+ * at a later point in time (e.g. via an event).
39
+ */
40
+ data?: {
41
+ [key: string]: string | object | number;
42
+ };
43
+ /**
44
+ * Android specific notification options. See the [`NotificationAndroid`](/react-native/reference/notificationandroid)
45
+ * interface for more information and default options which are applied to a notification.
46
+ *
47
+ * @platform android
48
+ */
49
+ android?: NotificationAndroid;
50
+ /**
51
+ * iOS specific notification options. See the [`NotificationIOS`](/react-native/reference/notificationios)
52
+ * interface for more information and default options which are applied to a notification.
53
+ *
54
+ * @platform ios
55
+ */
56
+ ios?: NotificationIOS;
57
+ /**
58
+ * Will be populated if it's a remote notification
59
+ *
60
+ * @platform ios
61
+ */
62
+ readonly remote?: {
63
+ messageId: string;
64
+ senderId: string;
65
+ mutableContent?: number;
66
+ contentAvailable?: number;
67
+ };
68
+ }
69
+ /**
70
+ * An interface representing a notification & action that launched the current app / or Android activity.
71
+ *
72
+ * View the [App open events](/react-native/docs/events#app-open-events) documentation to learn more.
73
+ *
74
+ * This interface is returned from [`getInitialNotification`](/react-native/reference/getinitialnotification) when
75
+ * an initial notification is available.
76
+ *
77
+ * Deprecated for iOS in favour of `onForegroundEvent`
78
+ *
79
+ * @platform android
80
+ */
81
+ export interface InitialNotification {
82
+ /**
83
+ * The notification which the user interacted with, which caused the application to open.
84
+ */
85
+ notification: Notification;
86
+ /**
87
+ * The press action which the user interacted with, on the notification, which caused the application to open.
88
+ */
89
+ pressAction: NotificationPressAction;
90
+ /**
91
+ * The input from a notification action.
92
+ *
93
+ * The input detail is available when the [`EventType`](/react-native/reference/eventtype) is:
94
+ *
95
+ * - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
96
+ * - The notification quick action has input enabled. View [`AndroidInput`](/react-native/reference/androidinput) for more details.
97
+ *
98
+ * @platform android API Level >= 20
99
+ */
100
+ input?: string;
101
+ }
102
+ /**
103
+ * An interface representing a notification that is currently displayed in the notification tray.
104
+ */
105
+ export interface DisplayedNotification {
106
+ /**
107
+ * ID of the notification
108
+ */
109
+ id?: string;
110
+ /**
111
+ * Date the notification was shown to the user
112
+ */
113
+ date?: string;
114
+ /**
115
+ * The payload that was used to create the notification (if available)
116
+ */
117
+ notification: Notification;
118
+ /**
119
+ * The trigger that was used to schedule the notification (if available)
120
+ *
121
+ * @platform iOS
122
+ */
123
+ trigger: Trigger;
124
+ }
125
+ /**
126
+ * An interface representing a notification that is pending.
127
+ */
128
+ export interface TriggerNotification {
129
+ /**
130
+ * The notification
131
+ */
132
+ notification: Notification;
133
+ /**
134
+ * The trigger that is used to schedule the notification
135
+ */
136
+ trigger: Trigger;
137
+ }
138
+ /**
139
+ * An interface representing a Notifee event.
140
+ *
141
+ * View the [Events](/react-native/docs/events) documentation to learn more about foreground and
142
+ * background events.
143
+ */
144
+ export interface Event {
145
+ /**
146
+ * The type of notification event.
147
+ */
148
+ type: EventType;
149
+ /**
150
+ * An object containing event detail.
151
+ */
152
+ detail: EventDetail;
153
+ }
154
+ /**
155
+ * A representation of a Foreground Service task registered via [`registerForegroundService`](/react-native/reference/registerforegroundservice).
156
+ *
157
+ * The task must resolve a promise once complete, and in turn removes the notification.
158
+ *
159
+ * View the [Foreground Service](/react-native/docs/android/foreground-service) documentation to
160
+ * learn more.
161
+ *
162
+ * @platform android
163
+ */
164
+ export declare type ForegroundServiceTask = (notification: Notification) => Promise<void>;
165
+ /**
166
+ * The interface used to describe a press action for a notification.
167
+ *
168
+ * There are various ways a user can interact with a notification, the most common being pressing
169
+ * the notification, pressing an action or providing text input. This interface defines what happens
170
+ * when a user performs such interaction.
171
+ *
172
+ * On Android; when provided to a notification action, the action will only open you application if
173
+ * a `launchActivity` and/or a `mainComponent` is provided.
174
+ */
175
+ export interface NotificationPressAction {
176
+ /**
177
+ * The unique ID for the action.
178
+ *
179
+ * The `id` property is used to differentiate between user press actions. When listening to notification
180
+ * events, the ID can be read from the `event.detail.pressAction` object.
181
+ */
182
+ id: string;
183
+ /**
184
+ * The custom Android Activity to launch on a press action.
185
+ *
186
+ * This property can be used in advanced scenarios to launch a custom Android Activity when the user
187
+ * performs a press action.
188
+ *
189
+ * View the [Android Interaction](/react-native/docs/android/interaction) docs to learn more.
190
+ *
191
+ * @platform android
192
+ */
193
+ launchActivity?: string;
194
+ /**
195
+ * Custom flags that are added to the Android [Intent](https://developer.android.com/reference/android/content/Intent.html) that launches your Activity.
196
+ *
197
+ * These are only required if you need to customise the behaviour of how your activities are launched; by default these are not required.
198
+ *
199
+ * @platform android
200
+ */
201
+ launchActivityFlags?: AndroidLaunchActivityFlag[];
202
+ /**
203
+ * A custom registered React component to launch on press action.
204
+ *
205
+ * This property can be used to open a custom React component when the user performs a press action.
206
+ * For this to correctly function on Android, a minor native code change is required.
207
+ *
208
+ * View the [Press Action](/react-native/docs/android/interaction#press-action) document to learn more.
209
+ *
210
+ * @platform android
211
+ */
212
+ mainComponent?: string;
213
+ }
214
+ /**
215
+ * The interface used to describe a full-screen action for a notification.
216
+ *
217
+ * By setting a `fullScreenAction`, when the notification is displayed, it will launch a full-screen intent.
218
+ *
219
+ * On Android; when provided to a notification action, the action will only open you application if
220
+ * a `launchActivity` and/or a `mainComponent` is provided.
221
+ *
222
+ * Please see the [FullScreen Action](/react-native/docs/android/behaviour#full-screen-action) document to learn more.
223
+ */
224
+ export interface NotificationFullScreenAction {
225
+ /**
226
+ * The unique ID for the action.
227
+ *
228
+ * The `id` property is used to differentiate between full-screen actions. When listening to notification
229
+ * events, the ID can be read from the `event.detail.notification.android.fullScreenAction` object.
230
+ */
231
+ id: string;
232
+ /**
233
+ * The custom Android Activity to launch on a full-screen action.
234
+ *
235
+ * This property can be used in advanced scenarios to launch a custom Android Activity when the user
236
+ * performs a full-screen action.
237
+ *
238
+ * View the [Android Full Screen](/react-native/docs/android/behviour#full-screen-action) docs to learn more.
239
+ *
240
+ * @platform android
241
+ */
242
+ launchActivity?: string;
243
+ /**
244
+ * Custom flags that are added to the Android [Intent](https://developer.android.com/reference/android/content/Intent.html) that launches your Activity.
245
+ *
246
+ * These are only required if you need to customise the behaviour of how your activities are launched; by default these are not required.
247
+ *
248
+ * @platform android
249
+ */
250
+ launchActivityFlags?: AndroidLaunchActivityFlag[];
251
+ /**
252
+ * A custom registered React component to launch on press action.
253
+ *
254
+ * This property can be used to open a custom React component when the notification is displayed.
255
+ * For this to correctly function on Android, a minor native code change is required.
256
+ *
257
+ * View the [Full-screen Action](/react-native/docs/android/behviour#full-screen-action) document to learn more.
258
+ *
259
+ * @platform android
260
+ */
261
+ mainComponent?: string;
262
+ }
263
+ /**
264
+ * An enum representing an event type, defined on [`Event`](/react-native/reference/event).
265
+ *
266
+ * View the [Events](/react-native/docs/events) documentation to learn more about foreground and
267
+ * background events.
268
+ */
269
+ export declare enum EventType {
270
+ /**
271
+ * An unknown event was received.
272
+ *
273
+ * This event type is a failsafe to catch any unknown events from the device. Please
274
+ * report an issue with a reproduction so it can be correctly handled.
275
+ */
276
+ UNKNOWN = -1,
277
+ /**
278
+ * Event type is sent when the user dismisses a notification. This is triggered via the user swiping
279
+ * the notification from the notification shade.
280
+ *
281
+ * On Android, the event is also sent when performing "Clear all" notifications unlike on iOS.
282
+ *
283
+ * This event is **not** sent when a notification is cancelled or times out.
284
+ */
285
+ DISMISSED = 0,
286
+ /**
287
+ * Event type is sent when a notification has been pressed by the user.
288
+ *
289
+ * On Android, notifications must include an `android.pressAction` property for this event to trigger.
290
+ *
291
+ * On iOS, this event is always sent when the user presses a notification.
292
+ */
293
+ PRESS = 1,
294
+ /**
295
+ * Event type is sent when a user presses a notification action.
296
+ */
297
+ ACTION_PRESS = 2,
298
+ /**
299
+ * Event type sent when a notification has been delivered to the device. For trigger notifications,
300
+ * this event is sent at the point when the trigger executes, not when a the trigger notification is created.
301
+ *
302
+ * It's important to note even though a notification has been delivered, it may not be shown to the
303
+ * user. For example, they may have notifications disabled on the device/channel/app.
304
+ */
305
+ DELIVERED = 3,
306
+ /**
307
+ * Event is sent when the user changes the notification blocked state for the entire application or
308
+ * when the user opens the application settings.
309
+ *
310
+ * @platform android API Level >= 28
311
+ */
312
+ APP_BLOCKED = 4,
313
+ /**
314
+ * Event type is sent when the user changes the notification blocked state for a channel in the application.
315
+ *
316
+ * @platform android API Level >= 28
317
+ */
318
+ CHANNEL_BLOCKED = 5,
319
+ /**
320
+ * Event type is sent when the user changes the notification blocked state for a channel group in the application.
321
+ *
322
+ * @platform android API Level >= 28
323
+ */
324
+ CHANNEL_GROUP_BLOCKED = 6,
325
+ /**
326
+ * Event type is sent when a notification trigger is created.
327
+ */
328
+ TRIGGER_NOTIFICATION_CREATED = 7
329
+ }
330
+ /**
331
+ * An interface representing the different detail values which can be provided with a notification event.
332
+ *
333
+ * View the [Events](/react-native/docs/events) documentation to learn more.
334
+ */
335
+ export interface EventDetail {
336
+ /**
337
+ * The notification this event relates to.
338
+ *
339
+ * The notification details is available when the [`EventType`](/react-native/reference/eventtype) is one of:
340
+ *
341
+ * - [`EventType.DISMISSED`](/react-native/reference/eventtype#dismissed)
342
+ * - [`EventType.PRESS`](/react-native/reference/eventtype#press)
343
+ * - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
344
+ * - [`EventType.DELIVERED`](/react-native/reference/eventtype#delivered)
345
+ * - [`EventType.TRIGGER_NOTIFICATION_CREATED`](/react-native/reference/eventtype#trigger_notification_created)
346
+ */
347
+ notification?: Notification;
348
+ /**
349
+ * The press action which triggered the event.
350
+ *
351
+ * If a press action caused the event, this property will be available allowing you to retrieve the
352
+ * action ID and perform logic.
353
+ *
354
+ * The press action details is available when the [`EventType`](/react-native/reference/eventtype) is one of:
355
+ *
356
+ * - [`EventType.PRESS`](/react-native/reference/eventtype#press)
357
+ * - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
358
+ */
359
+ pressAction?: NotificationPressAction;
360
+ /**
361
+ * The input from a notification action.
362
+ *
363
+ * The input detail is available when the [`EventType`](/react-native/reference/eventtype) is:
364
+ *
365
+ * - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
366
+ * - The notification quick action has input enabled. View [`AndroidInput`](/react-native/reference/androidinput) for more details.
367
+ *
368
+ * @platform android API Level >= 20
369
+ */
370
+ input?: string;
371
+ /**
372
+ * The channel that had its block state changed.
373
+ *
374
+ * Note that if the channel no longer exists during the time the event was sent the channel property will be undefined.
375
+ *
376
+ * The channel detail is available when the event type is [`EventType.CHANNEL_BLOCKED`](/react-native/reference/eventtype#channel_blocked).
377
+ *
378
+ * @platform android API Level >= 28
379
+ */
380
+ channel?: NativeAndroidChannel;
381
+ /**
382
+ * The channel group that had its block state changed.
383
+ *
384
+ * Note that if the channel no longer exists during the time the event was sent the channel group property will be undefined.
385
+ *
386
+ * The channel group detail is available when the event type is [`EventType.CHANNEL_GROUP_BLOCKED`](/react-native/reference/eventtype#channel_group_blocked).
387
+ *
388
+ * @platform android API Level >= 28
389
+ */
390
+ channelGroup?: NativeAndroidChannelGroup;
391
+ /**
392
+ * The notification blocked status of your entire application.
393
+ *
394
+ * The blocked detail is available when the event type is [`EventType.APP_BLOCKED`](/react-native/reference/eventtype#app_blocked).
395
+ *
396
+ * @platform android API Level >= 28
397
+ */
398
+ blocked?: boolean;
399
+ }
400
+ /**
401
+ * An enum representing the notification authorization status for this app on the device.
402
+ *
403
+ * Value is greater than 0 if authorized, compare against an exact status (e.g. PROVISIONAL) for a more
404
+ * granular status.
405
+ *
406
+ */
407
+ export declare enum AuthorizationStatus {
408
+ /**
409
+ * The app user has not yet chosen whether to allow the application to create notifications. Usually
410
+ * this status is returned prior to the first call of `requestPermission`.
411
+ *
412
+ * @platform ios
413
+ */
414
+ NOT_DETERMINED = -1,
415
+ /**
416
+ * The app is not authorized to create notifications.
417
+ */
418
+ DENIED = 0,
419
+ /**
420
+ * The app is authorized to create notifications.
421
+ */
422
+ AUTHORIZED = 1,
423
+ /**
424
+ * The app is currently authorized to post non-interrupting user notifications
425
+ * @platform ios iOS >= 12
426
+ */
427
+ PROVISIONAL = 2
428
+ }
429
+ export interface NotificationSettings {
430
+ /**
431
+ * Overall notification authorization status for the application.
432
+ * On Android, `authorizationStatus` will return only either `AuthorizationStatus.DENIED` or `AuthorizationStatus.AUTHORIZED`.
433
+ */
434
+ authorizationStatus: AuthorizationStatus;
435
+ /**
436
+ * Overall notification settings for the application in iOS.
437
+ * On non-iOS platforms, this will be populated with default values
438
+ */
439
+ ios: IOSNotificationSettings;
440
+ /**
441
+ * Overall notification settings for the application in android.
442
+ * On non-Android platforms, this will be populated with default values
443
+ */
444
+ android: AndroidNotificationSettings;
445
+ /**
446
+ * Overall notification settings for the application in web.
447
+ * On non-Web platforms, this will be populated with default values
448
+ */
449
+ web: WebNotificationSettings;
450
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AuthorizationStatus = exports.EventType = void 0;
7
+ /**
8
+ * An enum representing an event type, defined on [`Event`](/react-native/reference/event).
9
+ *
10
+ * View the [Events](/react-native/docs/events) documentation to learn more about foreground and
11
+ * background events.
12
+ */
13
+ var EventType;
14
+ (function (EventType) {
15
+ /**
16
+ * An unknown event was received.
17
+ *
18
+ * This event type is a failsafe to catch any unknown events from the device. Please
19
+ * report an issue with a reproduction so it can be correctly handled.
20
+ */
21
+ EventType[EventType["UNKNOWN"] = -1] = "UNKNOWN";
22
+ /**
23
+ * Event type is sent when the user dismisses a notification. This is triggered via the user swiping
24
+ * the notification from the notification shade.
25
+ *
26
+ * On Android, the event is also sent when performing "Clear all" notifications unlike on iOS.
27
+ *
28
+ * This event is **not** sent when a notification is cancelled or times out.
29
+ */
30
+ EventType[EventType["DISMISSED"] = 0] = "DISMISSED";
31
+ /**
32
+ * Event type is sent when a notification has been pressed by the user.
33
+ *
34
+ * On Android, notifications must include an `android.pressAction` property for this event to trigger.
35
+ *
36
+ * On iOS, this event is always sent when the user presses a notification.
37
+ */
38
+ EventType[EventType["PRESS"] = 1] = "PRESS";
39
+ /**
40
+ * Event type is sent when a user presses a notification action.
41
+ */
42
+ EventType[EventType["ACTION_PRESS"] = 2] = "ACTION_PRESS";
43
+ /**
44
+ * Event type sent when a notification has been delivered to the device. For trigger notifications,
45
+ * this event is sent at the point when the trigger executes, not when a the trigger notification is created.
46
+ *
47
+ * It's important to note even though a notification has been delivered, it may not be shown to the
48
+ * user. For example, they may have notifications disabled on the device/channel/app.
49
+ */
50
+ EventType[EventType["DELIVERED"] = 3] = "DELIVERED";
51
+ /**
52
+ * Event is sent when the user changes the notification blocked state for the entire application or
53
+ * when the user opens the application settings.
54
+ *
55
+ * @platform android API Level >= 28
56
+ */
57
+ EventType[EventType["APP_BLOCKED"] = 4] = "APP_BLOCKED";
58
+ /**
59
+ * Event type is sent when the user changes the notification blocked state for a channel in the application.
60
+ *
61
+ * @platform android API Level >= 28
62
+ */
63
+ EventType[EventType["CHANNEL_BLOCKED"] = 5] = "CHANNEL_BLOCKED";
64
+ /**
65
+ * Event type is sent when the user changes the notification blocked state for a channel group in the application.
66
+ *
67
+ * @platform android API Level >= 28
68
+ */
69
+ EventType[EventType["CHANNEL_GROUP_BLOCKED"] = 6] = "CHANNEL_GROUP_BLOCKED";
70
+ /**
71
+ * Event type is sent when a notification trigger is created.
72
+ */
73
+ EventType[EventType["TRIGGER_NOTIFICATION_CREATED"] = 7] = "TRIGGER_NOTIFICATION_CREATED";
74
+ })(EventType = exports.EventType || (exports.EventType = {}));
75
+ /**
76
+ * An enum representing the notification authorization status for this app on the device.
77
+ *
78
+ * Value is greater than 0 if authorized, compare against an exact status (e.g. PROVISIONAL) for a more
79
+ * granular status.
80
+ *
81
+ */
82
+ var AuthorizationStatus;
83
+ (function (AuthorizationStatus) {
84
+ /**
85
+ * The app user has not yet chosen whether to allow the application to create notifications. Usually
86
+ * this status is returned prior to the first call of `requestPermission`.
87
+ *
88
+ * @platform ios
89
+ */
90
+ AuthorizationStatus[AuthorizationStatus["NOT_DETERMINED"] = -1] = "NOT_DETERMINED";
91
+ /**
92
+ * The app is not authorized to create notifications.
93
+ */
94
+ AuthorizationStatus[AuthorizationStatus["DENIED"] = 0] = "DENIED";
95
+ /**
96
+ * The app is authorized to create notifications.
97
+ */
98
+ AuthorizationStatus[AuthorizationStatus["AUTHORIZED"] = 1] = "AUTHORIZED";
99
+ /**
100
+ * The app is currently authorized to post non-interrupting user notifications
101
+ * @platform ios iOS >= 12
102
+ */
103
+ AuthorizationStatus[AuthorizationStatus["PROVISIONAL"] = 2] = "PROVISIONAL";
104
+ })(AuthorizationStatus = exports.AuthorizationStatus || (exports.AuthorizationStatus = {}));
105
+ //# sourceMappingURL=Notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../src/types/Notification.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAwSH;;;;;GAKG;AACH,IAAY,SAoEX;AApED,WAAY,SAAS;IACnB;;;;;OAKG;IACH,gDAAY,CAAA;IAEZ;;;;;;;OAOG;IACH,mDAAa,CAAA;IAEb;;;;;;OAMG;IACH,2CAAS,CAAA;IAET;;OAEG;IACH,yDAAgB,CAAA;IAEhB;;;;;;OAMG;IACH,mDAAa,CAAA;IAEb;;;;;OAKG;IACH,uDAAe,CAAA;IAEf;;;;OAIG;IACH,+DAAmB,CAAA;IAEnB;;;;OAIG;IACH,2EAAyB,CAAA;IAEzB;;OAEG;IACH,yFAAgC,CAAA;AAClC,CAAC,EApEW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAoEpB;AA8ED;;;;;;GAMG;AACH,IAAY,mBAwBX;AAxBD,WAAY,mBAAmB;IAC7B;;;;;OAKG;IACH,kFAAmB,CAAA;IAEnB;;OAEG;IACH,iEAAU,CAAA;IAEV;;OAEG;IACH,yEAAc,CAAA;IAEd;;;OAGG;IACH,2EAAe,CAAA;AACjB,CAAC,EAxBW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAwB9B"}