@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,572 @@
1
+ import { Event, ForegroundServiceTask, InitialNotification, Notification } from './Notification';
2
+ import { Trigger } from './Trigger';
3
+ import { AndroidChannel, AndroidChannelGroup, NativeAndroidChannel, NativeAndroidChannelGroup } from './NotificationAndroid';
4
+ import { IOSNotificationCategory, IOSNotificationPermissions } from './NotificationIOS';
5
+ import { PowerManagerInfo } from './PowerManagerInfo';
6
+ import { DisplayedNotification, NotificationSettings, TriggerNotification } from '..';
7
+ export interface Module {
8
+ /**
9
+ * API used to cancel all notifications.
10
+ *
11
+ * The `cancelAllNotifications` API removes any displayed notifications from the users device and
12
+ * any pending trigger notifications.
13
+ *
14
+ * This method does not cancel Android [Foreground Service](/react-native/docs/android/foreground-service)
15
+ * notifications.
16
+ */
17
+ cancelAllNotifications(notificationIds?: string[]): Promise<void>;
18
+ /**
19
+ * API used to cancel any displayed notifications.
20
+ *
21
+ * This method does not cancel Android [Foreground Service](/react-native/docs/android/foreground-service)
22
+ * notifications.
23
+ */
24
+ cancelDisplayedNotifications(notificationIds?: string[]): Promise<void>;
25
+ /**
26
+ * API used to cancel any trigger notifications.
27
+ */
28
+ cancelTriggerNotifications(notificationIds?: string[]): Promise<void>;
29
+ /**
30
+ * API used to cancel a single notification.
31
+ *
32
+ * The `cancelNotification` API removes any displayed notifications or ones with triggers
33
+ * set for the specified ID.
34
+ *
35
+ * This method does not cancel [Foreground Service](/react-native/docs/android/foreground-service)
36
+ * notifications.
37
+ *
38
+ * @param notificationId The unique notification ID. This is automatically generated and returned
39
+ * when creating a notification, or has been set manually via the `id` property.
40
+ *
41
+ * @param tag The tag set when creating the notification. This is only relative to Android.
42
+ */
43
+ cancelNotification(notificationId: string, tag?: string): Promise<void>;
44
+ /**
45
+ * API used to cancel a single displayed notification.
46
+ *
47
+ *
48
+ * This method does not cancel [Foreground Service](/react-native/docs/android/foreground-service)
49
+ * notifications.
50
+ *
51
+ * @param notificationId The unique notification ID. This is automatically generated and returned
52
+ * when creating a notification, or has been set manually via the `id` property.
53
+ *
54
+ * @param tag The tag set when creating the notification. This is only relative to Android.
55
+ */
56
+ cancelDisplayedNotification(notificationId: string, tag?: string): Promise<void>;
57
+ /**
58
+ * API used to cancel a single trigger notification.
59
+ *
60
+ *
61
+ * @param notificationId The unique notification ID. This is automatically generated and returned
62
+ * when creating a notification, or has been set manually via the `id` property.
63
+ */
64
+ cancelTriggerNotification(notificationId: string): Promise<void>;
65
+ /**
66
+ * API to create and update channels on supported Android devices.
67
+ *
68
+ * Creates a new Android channel. Channels are used to collectively assign notifications to
69
+ * a single responsible channel. Users can manage settings for channels, e.g. disabling sound or vibration.
70
+ * Channels can be further organized into groups (see `createChannelGroup`).
71
+ *
72
+ * By providing a `groupId` property, channels can be assigned to groups created with
73
+ * [`createChannelGroup`](/react-native/reference/createchannelgroup).
74
+ *
75
+ * The channel ID is returned once the operation has completed.
76
+ *
77
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
78
+ *
79
+ * @platform android
80
+ * @param channel The [`AndroidChannel`](/react-native/reference/androidchannel) interface used to create/update a group.
81
+ */
82
+ createChannel(channel: AndroidChannel): Promise<string>;
83
+ /**
84
+ * API to create and update multiple channels on supported Android devices.
85
+ *
86
+ * This API is used to perform a single operation to create or update channels. See the
87
+ * [`createChannel`](/react-native/reference/createchannel) documentation for more information.
88
+ *
89
+ * @platform android
90
+ * @param channels An array of [`AndroidChannel`](/react-native/reference/androidchannel) interfaces.
91
+ */
92
+ createChannels(channels: AndroidChannel[]): Promise<void>;
93
+ /**
94
+ * API to create or update a channel group on supported Android devices.
95
+ *
96
+ * Creates a new Android channel group. Groups are used to further organize the appearance of your
97
+ * channels in the settings UI. Groups allow users to easily identify and control multiple
98
+ * notification channels.
99
+ *
100
+ * Channels can be assigned to groups during creation using the
101
+ * [`createChannel`](/react-native/reference/createchannel) method.
102
+ *
103
+ * The channel group ID is returned once the operation has completed.
104
+ *
105
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
106
+ *
107
+ * @platform android
108
+ * @param channelGroup The [`AndroidChannelGroup`](/react-native/reference/androidchannelgroup)
109
+ * interface used to create/update a group.
110
+ */
111
+ createChannelGroup(channelGroup: AndroidChannelGroup): Promise<string>;
112
+ /**
113
+ * API to create and update multiple channel groups on supported Android devices.
114
+ *
115
+ * This API is used to perform a single operation to create or update channel groups. See the
116
+ * [`createChannelGroup`](/react-native/reference/createchannelgroup) documentation for more information.
117
+ *
118
+ * @platform android
119
+ * @param channelGroups An array of [`AndroidChannelGroup`](/react-native/reference/androidchannelgroup) interfaces.
120
+ */
121
+ createChannelGroups(channelGroups: AndroidChannelGroup[]): Promise<void>;
122
+ /**
123
+ * API used to delete a channel by ID on supported Android devices.
124
+ *
125
+ * Channels can be deleted using this API by providing the channel ID. Channel information (including
126
+ * the ID) can be retrieved from the [`getChannels`](/react-native/reference/getchannels) API.
127
+ *
128
+ * > When a channel is deleted, notifications assigned to that channel will fail to display.
129
+ *
130
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
131
+ *
132
+ * @platform android
133
+ * @param channelId The unique channel ID to delete.
134
+ */
135
+ deleteChannel(channelId: string): Promise<void>;
136
+ /**
137
+ * API used to delete a channel group by ID on supported Android devices.
138
+ *
139
+ * Channel groups can be deleted using this API by providing the channel ID. Channel information (including
140
+ * the ID) can be retrieved from the [`getChannels`](/react-native/reference/getchannels) API.
141
+ *
142
+ * Deleting a group does not delete channels which are assigned to the group, they will instead be
143
+ * unassigned the group and continue to function as expected.
144
+ *
145
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
146
+ *
147
+ * @platform android
148
+ * @param channelGroupId The unique channel group ID to delete.
149
+ */
150
+ deleteChannelGroup(channelGroupId: string): Promise<void>;
151
+ /**
152
+ * API used to immediately display or update a notification on the users device.
153
+ *
154
+ * This API is used to display a notification on the users device. All
155
+ * channels/categories should be created before triggering this method during the apps lifecycle.
156
+ *
157
+ * View the [Displaying a Notification](/react-native/docs/displaying-a-notification)
158
+ * documentation for more information.
159
+ *
160
+ * @param notification The [`Notification`](/react-native/reference/notification) interface used
161
+ * to create a notification for both Android & iOS.
162
+ */
163
+ displayNotification(notification: Notification): Promise<string>;
164
+ /**
165
+ * API used to open the Android Alarm special access settings for the application.
166
+ *
167
+ * On Android >= 12 / API >= 31, the alarm special access settings screen is displayed, otherwise,
168
+ * this is a no-op & instantly resolves.
169
+ *
170
+ * View the [Trigger](/react-native/docs/android/triggers#android-12-limitations) documentation for more information.
171
+ *
172
+ * @platform android
173
+ */
174
+ openAlarmPermissionSettings(): Promise<void>;
175
+ /**
176
+ * API used to create a trigger notification.
177
+ *
178
+ * All channels/categories should be created before calling this method during the apps lifecycle.
179
+ *
180
+ * View the [Triggers](/react-native/docs/triggers) documentation for more information.
181
+ *
182
+ * @param notification The [`Notification`](/react-native/reference/notification) interface used
183
+ * to create a notification.
184
+ *
185
+ * @param trigger The [`Trigger`](/react-native/reference/trigger) interface used
186
+ * to create a trigger.
187
+ */
188
+ createTriggerNotification(notification: Notification, trigger: Trigger): Promise<string>;
189
+ /**
190
+ * API used to return the ids of trigger notifications that are pending.
191
+ *
192
+ * View the [Triggers](/react-native/docs/triggers) documentation for more information.
193
+ */
194
+ getTriggerNotificationIds(): Promise<string[]>;
195
+ /**
196
+ * API used to return the notifications that are displayed.
197
+ */
198
+ getDisplayedNotifications(): Promise<DisplayedNotification[]>;
199
+ /**
200
+ * API used to return the trigger notifications that are pending.
201
+ */
202
+ getTriggerNotifications(): Promise<TriggerNotification[]>;
203
+ /**
204
+ * API used to return a channel on supported Android devices.
205
+ *
206
+ * This API is used to return a `NativeAndroidChannel`. Returns `null` if no channel could be matched to
207
+ * the given ID.
208
+ *
209
+ * A "native channel" also includes additional properties about the channel at the time it's
210
+ * retrieved from the device. View the [`NativeAndroidChannel`](/react-native/reference/nativeandroidchannel)
211
+ * documentation for more information.
212
+ *
213
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
214
+ *
215
+ * @platform android
216
+ * @param channelId The channel ID created with [`createChannel`](/react-native/reference/createchannel). If
217
+ * a unknown channel ID is provided, `null` is returned.
218
+ */
219
+ getChannel(channelId: string): Promise<NativeAndroidChannel | null>;
220
+ /**
221
+ * API used to check if a channel is created.
222
+ *
223
+ * On iOS, this will default to true
224
+ *
225
+ * @platform android
226
+ */
227
+ isChannelCreated(channelId: string): Promise<boolean>;
228
+ /**
229
+ * API used to check if a channel is blocked.
230
+ *
231
+ * On iOS, this will default to false
232
+ *
233
+ * @platform android
234
+ */
235
+ isChannelBlocked(channelId: string): Promise<boolean>;
236
+ /**
237
+ * API used to return all channels on supported Android devices.
238
+ *
239
+ * This API is used to return a `NativeAndroidChannel`. Returns an empty array if no channels
240
+ * exist.
241
+ *
242
+ * A "native channel" also includes additional properties about the channel at the time it's
243
+ * retrieved from the device. View the [`NativeAndroidChannel`](/react-native/reference/nativeandroidchannel)
244
+ * documentation for more information.
245
+ *
246
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
247
+ *
248
+ * @platform android
249
+ */
250
+ getChannels(): Promise<NativeAndroidChannel[]>;
251
+ /**
252
+ * API used to return a channel group on supported Android devices.
253
+ *
254
+ * This API is used to return an `NativeAndroidChannelGroup`. Returns `null` if no channel could be matched to
255
+ * the given ID.
256
+ *
257
+ * A "native channel group" also includes additional properties about the channel group at the time it's
258
+ * retrieved from the device. View the [`NativeAndroidChannelGroup`](/react-native/reference/nativeandroidchannelgroup)
259
+ * documentation for more information.
260
+ *
261
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
262
+ *
263
+ * @platform android
264
+ * @param channelGroupId The channel ID created with [`createChannelGroup`](/react-native/reference/createchannelgroup). If
265
+ * a unknown channel group ID is provided, `null` is returned.
266
+ */
267
+ getChannelGroup(channelGroupId: string): Promise<NativeAndroidChannelGroup | null>;
268
+ /**
269
+ * API used to return all channel groups on supported Android devices.
270
+ *
271
+ * This API is used to return a `NativeAndroidChannelGroup`. Returns an empty array if no channel
272
+ * groups exist.
273
+ *
274
+ * A "native channel group" also includes additional properties about the channel group at the time it's
275
+ * retrieved from the device. View the [`NativeAndroidChannelGroup`](/react-native/reference/nativeandroidchannelgroup)
276
+ * documentation for more information.
277
+ *
278
+ * View the [Channels & Groups](/react-native/docs/android/channels) documentation for more information.
279
+ *
280
+ * @platform android
281
+ */
282
+ getChannelGroups(): Promise<NativeAndroidChannelGroup[]>;
283
+ /**
284
+ * API used to fetch the notification which causes the application to open.
285
+ *
286
+ * This API can be used to fetch which notification & press action has caused the application to
287
+ * open. The call returns a `null` value when the application wasn't launched by a notification.
288
+ *
289
+ * Once the initial notification has been consumed by this API, it is removed and will no longer
290
+ * be available. It will also be removed if the user relaunches the application.
291
+ *
292
+ * View the [App open events](/react-native/docs/events#app-open-events) documentation for more
293
+ * information and example usage.
294
+ *
295
+ * Deprecated for iOS in favour of `onForegroundEvent` - you can still use this method on iOS
296
+ * but you will also receive a `onForegroundEvent`
297
+ */
298
+ getInitialNotification(): Promise<InitialNotification | null>;
299
+ /**
300
+ * API used to handle events when the application is in a background state.
301
+ *
302
+ * Applications in a background state will use an event handler registered by this API method
303
+ * to send events. The handler must return a Promise once complete and only a single event handler
304
+ * can be registered for the application.
305
+ *
306
+ * View the [Background events](/react-native/docs/events#background-events) documentation for more
307
+ * information and example usage.
308
+ *
309
+ * To listen to foreground events, see the [`onForegroundEvent`](/react-native/reference/onforegroundevent) documentation.
310
+ *
311
+ * @param observer A Function which returns a Promise, called on a new event when the application
312
+ * is in a background state.
313
+ */
314
+ onBackgroundEvent(observer: (event: Event) => Promise<void>): void;
315
+ /**
316
+ * API used to handle events when the application is in a foreground state.
317
+ *
318
+ * Applications in a foreground state will use an event handler registered by this API method
319
+ * to send events. Multiple foreground observers can be registered throughout the applications
320
+ * lifecycle. The method returns a function, used to unsubscribe from further events,
321
+ *
322
+ * View the [Foreground events](/react-native/docs/events#foreground-events) documentation for more
323
+ * information and example usage.
324
+ *
325
+ * To listen to background events, see the [`onBackgroundEvent`](/react-native/reference/onbackgroundevent) documentation.
326
+ *
327
+ * @param observer A Function which returns a Promise, called on a new event when the application
328
+ * is in a foreground state.
329
+ */
330
+ onForegroundEvent(observer: (event: Event) => void): () => void;
331
+ /**
332
+ * API used to open the Android System settings for the application.
333
+ *
334
+ * If the API version is >= 26:
335
+ * - With no `channelId`, the notification settings screen is displayed.
336
+ * - With a `channelId`, the notification settings screen for the specific channel is displayed.
337
+ *
338
+ * If the API version is < 26, the application settings screen is displayed. The `channelId`
339
+ * is ignored.
340
+ *
341
+ * If an invalid `channelId` is provided (e.g. does not exist), the settings screen will redirect
342
+ * back to your application.
343
+ *
344
+ * On iOS, this is a no-op & instantly resolves.
345
+ *
346
+ * @platform android
347
+ * @param channelId The ID of the channel which will be opened. Can be ignored/omitted to display the
348
+ * overall notification settings.
349
+ */
350
+ openNotificationSettings(channelId?: string): Promise<void>;
351
+ /**
352
+ * API used to register a foreground service on Android devices.
353
+ *
354
+ * This method is used to register a long running task which can be used with Foreground Service
355
+ * notifications.
356
+ *
357
+ * Only a single foreground service can exist for the application, and calling this method more
358
+ * than once will update the existing task runner.
359
+ *
360
+ * View the [Foreground Service](/react-native/docs/android/foreground-service) documentation for
361
+ * more information.
362
+ *
363
+ * @platform android
364
+ * @param task The runner function which runs for the duration of the service's lifetime.
365
+ */
366
+ registerForegroundService(task: ForegroundServiceTask): void;
367
+ /**
368
+ * Call this to stop the foreground service that is running
369
+ *
370
+ * @platform android
371
+ *
372
+ */
373
+ stopForegroundService(): Promise<void>;
374
+ /**
375
+ * Request specific notification permissions for your application on the current device.
376
+ *
377
+ * Both iOS & Android return an `NotificationSettings` interface. To check whether overall
378
+ * permission was granted, check the `authorizationStatus` property in the response:
379
+ *
380
+ * ```js
381
+ * import notifee, { AuthorizationStatus } from '@notifee/react-native';
382
+ *
383
+ * const settings = await notifee.requestPermission(...);
384
+ *
385
+ * if (settings.authorizationStatus === AuthorizationStatus.DENIED) {
386
+ * console.log('User denied permissions request');
387
+ * } else if (settings.authorizationStatus === AuthorizationStatus.AUTHORIZED) {
388
+ * console.log('User granted permissions request');
389
+ * } else if (settings.authorizationStatus === AuthorizationStatus.PROVISIONAL) {
390
+ * console.log('User provisionally granted permissions request');
391
+ * }
392
+ * ```
393
+ *
394
+ * For iOS specific settings, use the `ios` properties to view which specific permissions were
395
+ * authorized.
396
+ *
397
+ * On Android, `authorizationStatus` will return only either `AuthorizationStatus.DENIED` or `AuthorizationStatus.AUTHORIZED`
398
+ * and all of the properties on the `ios` interface response return as `AUTHORIZED`.
399
+ *
400
+ * @param permissions
401
+ */
402
+ requestPermission(permissions?: IOSNotificationPermissions): Promise<NotificationSettings>;
403
+ /**
404
+ * Set the notification categories to be used on this Apple device.
405
+ *
406
+ * @platform ios
407
+ *
408
+ * @param categories
409
+ */
410
+ setNotificationCategories(categories: IOSNotificationCategory[]): Promise<void>;
411
+ /**
412
+ * Gets the currently set notification categories on this Apple device.
413
+ *
414
+ * Returns an empty array on Android.
415
+ *
416
+ *@platform ios
417
+ */
418
+ getNotificationCategories(): Promise<IOSNotificationCategory[]>;
419
+ /**
420
+ * Get the current notification settings for this application on the current device.
421
+ * On Android, `authorizationStatus` will return only either `AuthorizationStatus.DENIED` or `AuthorizationStatus.AUTHORIZED`
422
+ * and all of the properties on the `IOSNotificationSettings` interface response return as `AUTHORIZED`.
423
+ */
424
+ getNotificationSettings(): Promise<NotificationSettings>;
425
+ /**
426
+ * Get the current badge count value for this application on the current device.
427
+ *
428
+ * Returns `0` on Android.
429
+ *
430
+ * @platform ios
431
+ */
432
+ getBadgeCount(): Promise<number>;
433
+ /**
434
+ * Set the badge count value for this application on the current device.
435
+ *
436
+ * If set to zero, the badge count is removed from the device. The count must also
437
+ * be a positive number.
438
+ *
439
+ * @platform ios
440
+ *
441
+ * @param count The number value to set as the badge count.
442
+ */
443
+ setBadgeCount(count: number): Promise<void>;
444
+ /**
445
+ * Increments the badge count for this application on the current device by a specified
446
+ * value.
447
+ *
448
+ * Defaults to an increment of `1`.
449
+ *
450
+ * @platform ios
451
+ *
452
+ * @param incrementBy The value to increment the badge count by.
453
+ */
454
+ incrementBadgeCount(incrementBy?: number): Promise<void>;
455
+ /**
456
+ * Decrements the badge count for this application on the current device by a specified
457
+ * value.
458
+ *
459
+ * Defaults to an decrement of `1`.
460
+ *
461
+ * @platform ios
462
+ */
463
+ decrementBadgeCount(decrementBy?: number): Promise<void>;
464
+ /**
465
+ * API used to open the Android System settings for the application.
466
+ *
467
+ * If the API version is >= 23, the battery optimization settings screen is displayed, otherwise,
468
+ * this is a no-op & instantly resolves.
469
+ *
470
+ * View the [Background Restrictions](/react-native/docs/android/behaviour#background-restrictions) documentation for more information.
471
+ *
472
+ * @platform android
473
+ */
474
+ openBatteryOptimizationSettings(): Promise<void>;
475
+ /**
476
+ * API used to check if battery optimization is enabled for your application.
477
+ *
478
+ * Supports API versions >= 23.
479
+ *
480
+ * View the [Background Restrictions](/react-native/docs/android/behaviour#background-restrictions) documentation for more information.
481
+ *
482
+ * @platform android
483
+ */
484
+ isBatteryOptimizationEnabled(): Promise<boolean>;
485
+ /**
486
+ * API used to get information about the device and its power manager settings, including manufacturer, model, version and activity.
487
+ *
488
+ * If `activity` is `null`, `openPowerManagerSettings()` will be noop.
489
+ *
490
+ * On iOS, an instance of `PowerManagerInfo` will be returned with `activity` set to `null`.
491
+ *
492
+ * View the [Background Restrictions](/react-native/docs/android/background-restrictions) documentation for more information.
493
+ *
494
+ * ```js
495
+ * import notifee from `@notifee/react-native`;
496
+ *
497
+ * const powerManagerInfo = await notifee.getPowerManagerInfo();
498
+ *
499
+ * if (powerManagerInfo.activity) {
500
+ * // 1. ask the user to adjust their Power Manager settings
501
+ * // ...
502
+ *
503
+ * // 2. open settings
504
+ * await notifee.openPowerManagerSettings();
505
+ * }
506
+ * ```
507
+ *
508
+ * @platform android
509
+ */
510
+ getPowerManagerInfo(): Promise<PowerManagerInfo>;
511
+ /**
512
+ * API used to navigate to the appropriate Android System settings for the device.
513
+ *
514
+ * Call `getPowerManagerInfo()` first to find out if the user's device is supported.
515
+ *
516
+ * View the [Background Restrictions](/react-native/docs/android/background-restrictions) documentation for more information.
517
+ *
518
+ * ```js
519
+ * import notifee from `@notifee/react-native`;
520
+ *
521
+ * const powerManagerInfo = await notifee.getPowerManagerInfo
522
+ *
523
+ * if (powerManagerInfo.activity) {
524
+ * // 1. ask the user to adjust their Power Manager settings
525
+ * // ...
526
+ *
527
+ * // 2. if yes, navigate them to settings
528
+ * await notifee.openPowerManagerSettings();
529
+ * }
530
+ * ```
531
+ *
532
+ * @platform android
533
+ */
534
+ openPowerManagerSettings(): Promise<void>;
535
+ /**
536
+ * API used to hide the notification drawer, for example,
537
+ * when the user presses one of the quick actions on the notification, you may wish to hide the drawer.
538
+ *
539
+ * Please use this functionality carefully as it could potentially be quite intrusive to the user.
540
+ *
541
+ * Requires the following permission to be added to your `AndroidManifest.xml`:
542
+ * ```xml
543
+ * <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
544
+ * ```
545
+ *
546
+ * ```js
547
+ * import notifee from `@notifee/react-native`;
548
+ *
549
+ * notifee.hideNotificationDrawer();
550
+ * ```
551
+ *
552
+ * @platform android
553
+ */
554
+ hideNotificationDrawer(): void;
555
+ }
556
+ /**
557
+ * Interface describing the static properties available on the default `@notifee/react-native` export.
558
+ *
559
+ * ```js
560
+ * import notifee from `@notifee/react-native`;
561
+ *
562
+ * console.log(notifee.SDK_VERSION);
563
+ * ```
564
+ */
565
+ export interface ModuleStatics {
566
+ /**
567
+ * Returns the current Notifee SDK version in use.
568
+ */
569
+ SDK_VERSION: string;
570
+ }
571
+ export interface ModuleWithStatics extends Module, ModuleStatics {
572
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=Module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Module.js","sourceRoot":"","sources":["../../src/types/Module.ts"],"names":[],"mappings":";AAAA;;GAEG"}