@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,681 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited.
3
+ */
4
+
5
+ import { AuthorizationStatus } from './Notification';
6
+ /**
7
+ * The interface for iOS specific options which are applied to a notification.
8
+ *
9
+ * To learn more about iOS notifications, view the [iOS](/react-native/docs/iOS/introduction)
10
+ * documentation for full examples and usage.
11
+ *
12
+ * @platform ios
13
+ */
14
+ export interface NotificationIOS {
15
+ /**
16
+ * Optional array of [IOSNotificationAttachment](/react-native/reference/iosnotificationattachment) interfaces.
17
+ *
18
+ * Attachments allow audio, image, or video content to be displayed with the notification, enriching the user's experience.
19
+ *
20
+ * View the [Attachments](/react-native/docs/ios/appearances#attachments) documentation for more information
21
+ * and usage examples.
22
+ */
23
+ attachments?: IOSNotificationAttachment[];
24
+
25
+ /**
26
+ * The application badge count number. Set to null to indicate no change, or 0 to hide.
27
+ */
28
+ badgeCount?: number | null;
29
+
30
+ /**
31
+ * The id of a registered `IOSCategory` (via the `setNotificationCategories` API) that will be used to determine the
32
+ * appropriate actions to display for the notification.
33
+ */
34
+ categoryId?: string;
35
+
36
+ /**
37
+ * The launch image that will be used when the app is opened from this notification.
38
+ */
39
+ launchImageName?: string;
40
+
41
+ /**
42
+ * The name of the sound file to be played. The sound must be in the Library/Sounds folder of the
43
+ * app's data container or the Library/Sounds folder of an app group data container.
44
+ *
45
+ * If the file is not found in a container, the system will look in the app's bundle.
46
+ *
47
+ * Use 'default' to use the default system sound.
48
+ */
49
+ sound?: string;
50
+
51
+ /**
52
+ * Value that indicate the importance and delivery timing of a notification.
53
+ *
54
+ * @platform ios iOS >= 15
55
+ */
56
+ interruptionLevel?: IOSNotificationInterruptionLevel;
57
+
58
+ /**
59
+ * If the notification is a critical alert set this property to true; critical alerts will bypass
60
+ * the mute switch and also bypass Do Not Disturb.
61
+ *
62
+ * @platform ios iOS >= 12
63
+ */
64
+ critical?: boolean;
65
+
66
+ /**
67
+ * The optional audio volume of the critical sound; a float value between 0.0 and 1.0.
68
+ *
69
+ * This property is not used unless the `critical: true` option is also set.
70
+ *
71
+ * @platform ios iOS >= 12
72
+ */
73
+ criticalVolume?: number;
74
+
75
+ /**
76
+ * A unique id for the thread or conversation related to this notification.
77
+ * This will be used to visually group notifications together.
78
+ */
79
+ threadId?: string;
80
+
81
+ /**
82
+ * The argument that is inserted in the IOSCategory.summaryFormat for this notification.
83
+ *
84
+ * See `IOSCategory.summaryFormat`.
85
+ *
86
+ * @platform ios iOS >= 12
87
+ */
88
+ summaryArgument?: string;
89
+
90
+ /**
91
+ * A number that indicates how many items in the summary are being represented.
92
+ *
93
+ * For example if a messages app sends one notification for 3 new messages in a group chat,
94
+ * the summaryArgument could be the name of the group chat and the summaryArgumentCount should be 3.
95
+ *
96
+ * If set, value cannot be 0 or less.
97
+ *
98
+ * See `IOSCategory.summaryFormat`.
99
+ *
100
+ * @platform ios iOS >= 12
101
+ */
102
+ summaryArgumentCount?: number;
103
+
104
+ /**
105
+ * The identifier for the window to be opened when the user taps a notification.
106
+ *
107
+ * This value determines the window brought forward when the user taps this notification on iPadOS.
108
+ *
109
+ * @platform ios iOS >= 13
110
+ */
111
+ targetContentId?: string;
112
+
113
+ /**
114
+ * Optional property to customise how notifications are presented when the app is in the foreground.
115
+ *
116
+ * By default, Notifee will show iOS notifications in heads-up mode if your app is currently in the foreground.
117
+ */
118
+ foregroundPresentationOptions?: IOSForegroundPresentationOptions;
119
+
120
+ /**
121
+ * Optional property for communication notifications
122
+ *
123
+ * @platform ios iOS >= 15
124
+ */
125
+ communicationInfo?: IOSCommunicationInfo;
126
+ }
127
+
128
+ /**
129
+ * An interface to support communication notifications on iOS 15 and above
130
+ *
131
+ * @platform ios
132
+ */
133
+ export interface IOSCommunicationInfo {
134
+ conversationId: string;
135
+ body?: string;
136
+ sender: IOSCommunicationInfoPerson;
137
+ }
138
+
139
+ export interface IOSCommunicationInfoPerson {
140
+ id: string;
141
+ displayName: string;
142
+ avatar?: string;
143
+ }
144
+
145
+ /**
146
+ * An interface to customise how notifications are shown when the app is in the foreground.
147
+ *
148
+ * By default, Notifee will show iOS notifications in heads-up mode if your app is currently in the foreground.
149
+ *
150
+ * View the [Foreground Notifications](/react-native/docs/ios/appearance#foreground-notifications) to learn
151
+ * more.
152
+ *
153
+ * @platform ios
154
+ */
155
+ export interface IOSForegroundPresentationOptions {
156
+ /**
157
+ * App in foreground dialog box which indicates when a decision has to be made
158
+ *
159
+ * Defaults to true
160
+ * @deprecated Use `banner` and `list` instead
161
+ */
162
+ alert?: boolean;
163
+
164
+ /**
165
+ * App in foreground notification sound
166
+ *
167
+ * Defaults to true
168
+ */
169
+ sound?: boolean;
170
+
171
+ /**
172
+ * App in foreground badge update
173
+ *
174
+ * Defaults to true
175
+ */
176
+ badge?: boolean;
177
+
178
+ /**
179
+ * Present the notification as a banner
180
+ *
181
+ * For iOS 13 and lower, will be equivalent to setting `alert` to true
182
+ *
183
+ * Defaults to true
184
+ */
185
+ banner?: boolean;
186
+
187
+ /**
188
+ * Show the notification in Notification Center
189
+ *
190
+ * For iOS 13 and lower, will be equivalent to setting `alert` to true
191
+ *
192
+ * Defaults to true
193
+ */
194
+ list?: boolean;
195
+ }
196
+
197
+ /**
198
+ * An interface representing all the available permissions that can be requested by your app via
199
+ * the [`requestPermission`](/react-native/reference/requestpermission) API.
200
+ *
201
+ * View the [Permissions](/react-native/docs/ios/permissions) to learn
202
+ * more.
203
+ *
204
+ * @platform ios
205
+ */
206
+ export interface IOSNotificationPermissions {
207
+ /**
208
+ * Request permission to display alerts.
209
+ *
210
+ * Defaults to true.
211
+ */
212
+ alert?: boolean;
213
+
214
+ /**
215
+ * Request permission to display critical notifications.
216
+ *
217
+ * View the [Critical Notifications](/react-native/docs/ios/behaviour#critical-notifications) documentation for more information
218
+ * and usage examples.
219
+ *
220
+ * Defaults to false.
221
+ */
222
+ criticalAlert?: boolean;
223
+
224
+ /**
225
+ * Request permission to update the application badge.
226
+ *
227
+ * Defaults to true.
228
+ */
229
+ badge?: boolean;
230
+
231
+ /**
232
+ * Request permission to play sounds.
233
+ *
234
+ * Defaults to true.
235
+ */
236
+ sound?: boolean;
237
+
238
+ /**
239
+ * Request permission to display notifications in a CarPlay environment.
240
+ *
241
+ * Defaults to true.
242
+ */
243
+ carPlay?: boolean;
244
+
245
+ /**
246
+ * Request permission to provisionally create non-interrupting notifications.
247
+ *
248
+ * Defaults to false.
249
+ *
250
+ * @platform ios iOS >= 12
251
+ */
252
+ provisional?: boolean;
253
+
254
+ /**
255
+ * Request permission for Siri to automatically read out notification messages over AirPods.
256
+ *
257
+ * Defaults to false.
258
+ *
259
+ * @platform ios iOS >= 13
260
+ */
261
+ announcement?: boolean;
262
+
263
+ // TODO later version
264
+ // /**
265
+ // * Using this permission indicates to iOS that it should display a button for in-app notification
266
+ // * settings. Pressing this button when your application is open will trigger a Notifee
267
+ // * 'ACTION_PRESS' event with a `pressAction.id` of 'notification-settings'
268
+ // * (or via getInitialNotification 'pressAction.id' when app launched)
269
+ // *
270
+ // * Defaults to false.
271
+ // *
272
+ // * @platform ios iOS >= 12
273
+ // */
274
+ // inAppNotificationSettings?: boolean;
275
+ }
276
+
277
+ /**
278
+ * An enum representing the show previews notification setting for this app on the device.
279
+ *
280
+ * Value is greater than 0 if previews are to be shown, compare against an exact value
281
+ * (e.g. WHEN_AUTHENTICATED) for more granular control.
282
+ *
283
+ * @platform ios
284
+ */
285
+ export enum IOSShowPreviewsSetting {
286
+ /**
287
+ * This setting is not supported on this device. Usually this means that the iOS version required
288
+ * for this setting (iOS 11+) has not been met.
289
+ */
290
+ NOT_SUPPORTED = -1,
291
+
292
+ /**
293
+ * Never show previews.
294
+ */
295
+ NEVER = 0,
296
+
297
+ /**
298
+ * Always show previews even if the device is currently locked.
299
+ */
300
+ ALWAYS = 1,
301
+
302
+ /**
303
+ * Only show previews when the device is unlocked.
304
+ */
305
+ WHEN_AUTHENTICATED = 2,
306
+ }
307
+
308
+ /**
309
+ * An enum representing a notification setting for this app on the device.
310
+ *
311
+ * Value is greater than 0 if setting enabled, compare against an exact value (e.g. NOT_SUPPORTED) for more
312
+ * granular control.
313
+ *
314
+ * @platform ios
315
+ */
316
+ export enum IOSNotificationSetting {
317
+ /**
318
+ * This setting is not supported on this device. Usually this means that the iOS version required
319
+ * for this setting has not been met.
320
+ */
321
+ NOT_SUPPORTED = -1,
322
+
323
+ /**
324
+ * This setting is currently disabled by the user.
325
+ */
326
+ DISABLED = 0,
327
+
328
+ /**
329
+ * This setting is currently enabled.
330
+ */
331
+ ENABLED = 1,
332
+ }
333
+
334
+ /**
335
+ * An interface representing the current authorization status and notification-related settings for your app.
336
+ *
337
+ * This interface is returned from [`requestPermission`](/react-native/reference/requestpermission)
338
+ * and [`getNotificationSettings`](/react-native/reference/getnotificationsettings).
339
+ *
340
+ * View the [Observing Settings](/react-native/docs/ios/permissions#observing-settings) documentation to learn more.
341
+ *
342
+ * @platform ios
343
+ */
344
+ export interface IOSNotificationSettings {
345
+ /**
346
+ * Enum describing if notifications will alert the user.
347
+ */
348
+ alert: IOSNotificationSetting;
349
+
350
+ /**
351
+ * Enum describing if notifications can update the application badge.
352
+ */
353
+ badge: IOSNotificationSetting;
354
+
355
+ /**
356
+ * Enum describing if critical notifications are allowed.
357
+ */
358
+ criticalAlert: IOSNotificationSetting;
359
+
360
+ /**
361
+ * Enum describing if notification previews will be shown.
362
+ */
363
+ showPreviews: IOSShowPreviewsSetting;
364
+
365
+ /**
366
+ * Enum describing if notifications can trigger a sound.
367
+ */
368
+ sound: IOSNotificationSetting;
369
+
370
+ /**
371
+ * Enum describing if notifications can be displayed in a CarPlay environment.
372
+ */
373
+ carPlay: IOSNotificationSetting;
374
+
375
+ /**
376
+ * Enum describing if notifications will be displayed on the lock screen.
377
+ */
378
+ lockScreen: IOSNotificationSetting;
379
+
380
+ /**
381
+ * Enum describing if notifications can be announced to the user
382
+ * via 3rd party services such as Siri.
383
+ *
384
+ * For example, if the notification can be automatically read by Siri
385
+ * while the user is wearing AirPods.
386
+ */
387
+ announcement: IOSNotificationSetting;
388
+
389
+ /**
390
+ * Enum describing if notifications will be displayed in the notification center.
391
+ */
392
+ notificationCenter: IOSNotificationSetting;
393
+
394
+ inAppNotificationSettings: IOSNotificationSetting;
395
+
396
+ /**
397
+ * Overall notification authorization status for the application.
398
+ */
399
+ authorizationStatus: AuthorizationStatus;
400
+ }
401
+
402
+ /**
403
+ * TODO docs, used to provide context to Siri
404
+ *
405
+ * @platform ios
406
+ */
407
+ export enum IOSIntentIdentifier {
408
+ START_AUDIO_CALL = 0,
409
+
410
+ START_VIDEO_CALL = 1,
411
+
412
+ SEARCH_CALL_HISTORY = 2,
413
+
414
+ SET_AUDIO_SOURCE_IN_CAR = 3,
415
+
416
+ SET_CLIMATE_SETTINGS_IN_CAR = 4,
417
+
418
+ SET_DEFROSTER_SETTINGS_IN_CAR = 5,
419
+
420
+ SET_SEAT_SETTINGS_IN_CAR = 6,
421
+
422
+ SET_PROFILE_IN_CAR = 7,
423
+
424
+ SAVE_PROFILE_IN_CAR = 8,
425
+
426
+ START_WORKOUT = 9,
427
+
428
+ PAUSE_WORKOUT = 10,
429
+
430
+ END_WORKOUT = 11,
431
+
432
+ CANCEL_WORKOUT = 12,
433
+
434
+ RESUME_WORKOUT = 13,
435
+
436
+ SET_RADIO_STATION = 14,
437
+
438
+ SEND_MESSAGE = 15,
439
+
440
+ SEARCH_FOR_MESSAGES = 16,
441
+
442
+ SET_MESSAGE_ATTRIBUTE = 17,
443
+
444
+ SEND_PAYMENT = 18,
445
+
446
+ REQUEST_PAYMENT = 19,
447
+
448
+ SEARCH_FOR_PHOTOS = 20,
449
+
450
+ START_PHOTO_PLAYBACK = 21,
451
+
452
+ LIST_RIDE_OPTIONS = 22,
453
+
454
+ REQUEST_RIDE = 23,
455
+
456
+ GET_RIDE_STATUS = 24,
457
+ }
458
+
459
+ /**
460
+ * A interface representing a notification category created via [`setNotificationCategories`](/react-native/reference/setnotificationcategories).
461
+ *
462
+ * At minimum, a category must be created with a unique identifier, all other properties are optional.
463
+ *
464
+ * View the [Categories](/react-native/docs/ios/categories) documentation to learn more.
465
+ *
466
+ * @platform ios
467
+ */
468
+ export interface IOSNotificationCategory {
469
+ /**
470
+ * The unique ID for the category.
471
+ */
472
+ id: string;
473
+
474
+ /**
475
+ * Specify a custom format for the summary text, which is visible when notifications are grouped together.
476
+ *
477
+ * View the [Summary Text](/react-native/docs/ios/categories#category-summary-text) documentation to learn more.
478
+ */
479
+ summaryFormat?: string;
480
+
481
+ /**
482
+ * Allow notifications in this category to be displayed in a CarPlay environment.
483
+ *
484
+ * Defaults to `false`.
485
+ */
486
+ allowInCarPlay?: boolean;
487
+
488
+ /*
489
+ * Allow notifications in this category to be announced to the user
490
+ * via 3rd party services such as Siri.
491
+ *
492
+ * For example, if the notification can be automatically read by Siri
493
+ * while the user is wearing AirPods.
494
+ *
495
+ * Defaults to `false`.
496
+ */
497
+ allowAnnouncement?: boolean;
498
+
499
+ /*
500
+ * Show the notification's title, even if the user has disabled notification previews for the app
501
+ *
502
+ * Defaults to `false`.
503
+ */
504
+ hiddenPreviewsShowTitle?: boolean;
505
+
506
+ /*
507
+ * Show the notification's subtitle, even if the user has disabled notification previews for the app
508
+ *
509
+ * Defaults to `false`.
510
+ */
511
+ hiddenPreviewsShowSubtitle?: boolean;
512
+
513
+ /*
514
+ * Show the notification's body, even if the user has disabled notification previews for the app
515
+ *
516
+ * Defaults to `false`.
517
+ */
518
+ hiddenPreviewsBodyPlaceholder?: string;
519
+
520
+ intentIdentifiers?: IOSIntentIdentifier[];
521
+
522
+ /*
523
+ * An array of [IOSNotificationCategoryAction](/react-native/reference/iosnotificationcategoryaction) interfaces.
524
+ *
525
+ * Adds quick actions to a notification. Quick Actions enable users to interact with your application
526
+ * directly from the notification body, providing an overall greater user experience.
527
+ *
528
+ * View the [Quick Actions](react-native/docs/ios/interaction#quick-actions) documentation for more information.
529
+ */
530
+ actions?: IOSNotificationCategoryAction[];
531
+ }
532
+
533
+ /**
534
+ * The interface used to describe a notification quick action for iOS.
535
+ *
536
+ * Quick actions allow users to interact with notifications, allowing you to handle events
537
+ * within your application. When an action completes (e.g. pressing an action, or filling out an input
538
+ * box) an event is sent.
539
+ *
540
+ * View the [Quick Actions](/react-native/docs/ios/interaction#quick-actions) documentation to learn more.
541
+ *
542
+ * @platform ios
543
+ */
544
+ export interface IOSNotificationCategoryAction {
545
+ id: string;
546
+
547
+ /**
548
+ * The title of the action, e.g. "Reply", "Mark as read" etc.
549
+ */
550
+ title: string;
551
+
552
+ /**
553
+ * If provided, the action accepts custom user input.
554
+ *
555
+ * If `true`, the user will be able to provide free text input when the action is pressed.
556
+ *
557
+ * The placeholder and button text can be customized by providing an object
558
+ * of type [`IOSInput`](/react-native/reference/iosinput).
559
+ *
560
+ * View the [Action Input](/react-native/docs/ios/interaction#action-input) documentation to
561
+ * learn more.
562
+ */
563
+ input?: true | IOSInput;
564
+
565
+ /**
566
+ * Makes the action red, indicating that the action is destructive.
567
+ */
568
+ destructive?: boolean; // false
569
+
570
+ /**
571
+ * Whether this action should cause the application to launch in the foreground.
572
+ */
573
+ foreground?: boolean; // false
574
+
575
+ /**
576
+ * Whether this action should require unlocking before being performed.
577
+ */
578
+ authenticationRequired?: boolean; // false
579
+ }
580
+
581
+ /**
582
+ * The interface used to enable advanced user input on a notification.
583
+ *
584
+ * View the [Action input](/react-native/docs/ios/interaction#action-input) documentation to learn more.
585
+ *
586
+ * @platform ios
587
+ */
588
+ export interface IOSInput {
589
+ /**
590
+ * Overrides the default button text "Send", next to the input box.
591
+ */
592
+ buttonText?: string;
593
+
594
+ /**
595
+ * The placeholder text displayed in the text input field for this action.
596
+ */
597
+ placeholderText?: string;
598
+ }
599
+
600
+ /**
601
+ * An interface for describing an iOS Notification Attachment.
602
+ *
603
+ * View the [Attachments](/react-native/docs/ios/appearance#attachments) documentation to learn more.
604
+ *
605
+ * @platform ios
606
+ */
607
+ export interface IOSNotificationAttachment {
608
+ /**
609
+ * A optional unique identifier of the attachment.
610
+ * If no `id` is provided, a unique id is created for you.
611
+ */
612
+ id?: string;
613
+
614
+ /**
615
+ * A URL to the media file to display.
616
+ *
617
+ * The value can be any of the following:
618
+ *
619
+ * - An absolute path to a file on the device
620
+ * - iOS resource
621
+ *
622
+ * For a list of supported file types, see [Supported File Types](https://developer.apple.com/documentation/usernotifications/unnotificationattachment#1682051) on the official Apple documentation for more information.
623
+ */
624
+ url: string;
625
+
626
+ /**
627
+ * An optional hint about an attachment’s file type, as as Uniform Type Identifier (UTI).
628
+ *
629
+ * A list of UTI values can be found [here](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html) e.g. for JPEG you'd use `public.jpeg` as the `typeHint` value.
630
+ *
631
+ * If you do not include this key, the attachment’s filename extension is used to determine its type.
632
+ */
633
+ typeHint?: string;
634
+
635
+ /**
636
+ * When set to `true` the thumbnail will be hidden.
637
+ * Defaults to `false`.
638
+ */
639
+ thumbnailHidden?: boolean;
640
+
641
+ /**
642
+ * An optional clipping rectangle for a thumbnail image.
643
+ */
644
+ thumbnailClippingRect?: IOSAttachmentThumbnailClippingRect;
645
+
646
+ /**
647
+ * The frame number of an animation to use as the thumbnail.
648
+ *
649
+ * For a video, it is the time (in seconds) into the video from which to
650
+ * grab the thumbnail image.
651
+ *
652
+ * For a GIF, it is the frame number of the animation to use
653
+ * as a thumbnail image.
654
+ */
655
+ thumbnailTime?: number;
656
+ }
657
+
658
+ /**
659
+ * The interface used to specify the portion of your image that you want to be displayed as the thumbnail
660
+ *
661
+ * Values are in the range 0.0 to 1.0.
662
+ *
663
+ * For example, specifying an origin (x,y) of (0.25, 0.25) and a size (width, height) of (0.5, 0.5)
664
+ * defines a clipping rectangle that shows only the center portion of the image.
665
+ *
666
+ * @platform ios
667
+ */
668
+ export interface IOSAttachmentThumbnailClippingRect {
669
+ x: number;
670
+ y: number;
671
+ width: number;
672
+ height: number;
673
+ }
674
+
675
+ /**
676
+ * Constants that indicate the importance and delivery timing of a notification.
677
+ * https://developer.apple.com/documentation/usernotifications/unnotificationinterruptionlevel
678
+ *
679
+ * @platform ios
680
+ */
681
+ export type IOSNotificationInterruptionLevel = 'active' | 'critical' | 'passive' | 'timeSensitive';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Empty at the moment but will contain web-specific settings as needed
3
+ */
4
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
5
+ export interface WebNotificationSettings {}