react-native-notify-kit 9.1.8

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 (212) hide show
  1. package/LICENSE +44 -0
  2. package/README.md +212 -0
  3. package/RNNotifee.podspec +37 -0
  4. package/RNNotifeeCore.podspec +32 -0
  5. package/android/.editorconfig +10 -0
  6. package/android/build.gradle +117 -0
  7. package/android/gradle.properties +1 -0
  8. package/android/libs/app/notifee/core/202108261754/core-202108261754.aar +0 -0
  9. package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.md5 +1 -0
  10. package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha1 +1 -0
  11. package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha256 +1 -0
  12. package/android/libs/app/notifee/core/202108261754/core-202108261754.aar.sha512 +1 -0
  13. package/android/libs/app/notifee/core/202108261754/core-202108261754.pom +9 -0
  14. package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.md5 +1 -0
  15. package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.sha1 +1 -0
  16. package/android/libs/app/notifee/core/202108261754/core-202108261754.pom.sha256 +1 -0
  17. package/android/libs/app/notifee/core/202108261754/core-202108261754.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 +82 -0
  25. package/android/settings.gradle +1 -0
  26. package/android/src/main/AndroidManifest.xml +12 -0
  27. package/android/src/main/kotlin/io/invertase/notifee/HeadlessTask.kt +257 -0
  28. package/android/src/main/kotlin/io/invertase/notifee/NotifeeApiModule.kt +392 -0
  29. package/android/src/main/kotlin/io/invertase/notifee/NotifeeEventSubscriber.kt +117 -0
  30. package/android/src/main/kotlin/io/invertase/notifee/NotifeeInitProvider.kt +43 -0
  31. package/android/src/main/kotlin/io/invertase/notifee/NotifeePackage.kt +37 -0
  32. package/android/src/main/kotlin/io/invertase/notifee/NotifeeReactUtils.kt +118 -0
  33. package/dist/NotifeeApiModule.d.ts +53 -0
  34. package/dist/NotifeeApiModule.js +593 -0
  35. package/dist/NotifeeApiModule.js.map +1 -0
  36. package/dist/NotifeeJSEventEmitter.d.ts +3 -0
  37. package/dist/NotifeeJSEventEmitter.js +9 -0
  38. package/dist/NotifeeJSEventEmitter.js.map +1 -0
  39. package/dist/NotifeeNativeError.d.ts +15 -0
  40. package/dist/NotifeeNativeError.js +56 -0
  41. package/dist/NotifeeNativeError.js.map +1 -0
  42. package/dist/NotifeeNativeModule.d.ts +13 -0
  43. package/dist/NotifeeNativeModule.js +27 -0
  44. package/dist/NotifeeNativeModule.js.map +1 -0
  45. package/dist/NotifeeNativeModule.web.d.ts +12 -0
  46. package/dist/NotifeeNativeModule.web.js +15 -0
  47. package/dist/NotifeeNativeModule.web.js.map +1 -0
  48. package/dist/index.d.ts +8 -0
  49. package/dist/index.js +24 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/specs/NativeNotifeeModule.d.ts +53 -0
  52. package/dist/specs/NativeNotifeeModule.js +6 -0
  53. package/dist/specs/NativeNotifeeModule.js.map +1 -0
  54. package/dist/types/Library.d.ts +21 -0
  55. package/dist/types/Library.js +5 -0
  56. package/dist/types/Library.js.map +1 -0
  57. package/dist/types/Module.d.ts +576 -0
  58. package/dist/types/Module.js +5 -0
  59. package/dist/types/Module.js.map +1 -0
  60. package/dist/types/Notification.d.ts +462 -0
  61. package/dist/types/Notification.js +108 -0
  62. package/dist/types/Notification.js.map +1 -0
  63. package/dist/types/NotificationAndroid.d.ts +1311 -0
  64. package/dist/types/NotificationAndroid.js +406 -0
  65. package/dist/types/NotificationAndroid.js.map +1 -0
  66. package/dist/types/NotificationIOS.d.ts +539 -0
  67. package/dist/types/NotificationIOS.js +89 -0
  68. package/dist/types/NotificationIOS.js.map +1 -0
  69. package/dist/types/NotificationWeb.d.ts +5 -0
  70. package/dist/types/NotificationWeb.js +5 -0
  71. package/dist/types/NotificationWeb.js.map +1 -0
  72. package/dist/types/PowerManagerInfo.d.ts +36 -0
  73. package/dist/types/PowerManagerInfo.js +5 -0
  74. package/dist/types/PowerManagerInfo.js.map +1 -0
  75. package/dist/types/Trigger.d.ts +124 -0
  76. package/dist/types/Trigger.js +48 -0
  77. package/dist/types/Trigger.js.map +1 -0
  78. package/dist/utils/id.d.ts +1 -0
  79. package/dist/utils/id.js +12 -0
  80. package/dist/utils/id.js.map +1 -0
  81. package/dist/utils/index.d.ts +16 -0
  82. package/dist/utils/index.js +31 -0
  83. package/dist/utils/index.js.map +1 -0
  84. package/dist/utils/validate.d.ts +15 -0
  85. package/dist/utils/validate.js +75 -0
  86. package/dist/utils/validate.js.map +1 -0
  87. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.d.ts +2 -0
  88. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js +45 -0
  89. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js.map +1 -0
  90. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.d.ts +2 -0
  91. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js +24 -0
  92. package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js.map +1 -0
  93. package/dist/validators/validate.d.ts +25 -0
  94. package/dist/validators/validate.js +68 -0
  95. package/dist/validators/validate.js.map +1 -0
  96. package/dist/validators/validateAndroidAction.d.ts +2 -0
  97. package/dist/validators/validateAndroidAction.js +46 -0
  98. package/dist/validators/validateAndroidAction.js.map +1 -0
  99. package/dist/validators/validateAndroidChannel.d.ts +2 -0
  100. package/dist/validators/validateAndroidChannel.js +152 -0
  101. package/dist/validators/validateAndroidChannel.js.map +1 -0
  102. package/dist/validators/validateAndroidChannelGroup.d.ts +2 -0
  103. package/dist/validators/validateAndroidChannelGroup.js +39 -0
  104. package/dist/validators/validateAndroidChannelGroup.js.map +1 -0
  105. package/dist/validators/validateAndroidFullScreenAction.d.ts +2 -0
  106. package/dist/validators/validateAndroidFullScreenAction.js +47 -0
  107. package/dist/validators/validateAndroidFullScreenAction.js.map +1 -0
  108. package/dist/validators/validateAndroidInput.d.ts +2 -0
  109. package/dist/validators/validateAndroidInput.js +51 -0
  110. package/dist/validators/validateAndroidInput.js.map +1 -0
  111. package/dist/validators/validateAndroidNotification.d.ts +2 -0
  112. package/dist/validators/validateAndroidNotification.js +541 -0
  113. package/dist/validators/validateAndroidNotification.js.map +1 -0
  114. package/dist/validators/validateAndroidPressAction.d.ts +2 -0
  115. package/dist/validators/validateAndroidPressAction.js +47 -0
  116. package/dist/validators/validateAndroidPressAction.js.map +1 -0
  117. package/dist/validators/validateAndroidStyle.d.ts +22 -0
  118. package/dist/validators/validateAndroidStyle.js +222 -0
  119. package/dist/validators/validateAndroidStyle.js.map +1 -0
  120. package/dist/validators/validateIOSAttachment.d.ts +6 -0
  121. package/dist/validators/validateIOSAttachment.js +96 -0
  122. package/dist/validators/validateIOSAttachment.js.map +1 -0
  123. package/dist/validators/validateIOSCategory.d.ts +2 -0
  124. package/dist/validators/validateIOSCategory.js +118 -0
  125. package/dist/validators/validateIOSCategory.js.map +1 -0
  126. package/dist/validators/validateIOSCategoryAction.d.ts +2 -0
  127. package/dist/validators/validateIOSCategoryAction.js +53 -0
  128. package/dist/validators/validateIOSCategoryAction.js.map +1 -0
  129. package/dist/validators/validateIOSInput.d.ts +2 -0
  130. package/dist/validators/validateIOSInput.js +29 -0
  131. package/dist/validators/validateIOSInput.js.map +1 -0
  132. package/dist/validators/validateIOSNotification.d.ts +2 -0
  133. package/dist/validators/validateIOSNotification.js +205 -0
  134. package/dist/validators/validateIOSNotification.js.map +1 -0
  135. package/dist/validators/validateIOSPermissions.d.ts +2 -0
  136. package/dist/validators/validateIOSPermissions.js +59 -0
  137. package/dist/validators/validateIOSPermissions.js.map +1 -0
  138. package/dist/validators/validateNotification.d.ts +11 -0
  139. package/dist/validators/validateNotification.js +121 -0
  140. package/dist/validators/validateNotification.js.map +1 -0
  141. package/dist/validators/validateTrigger.d.ts +2 -0
  142. package/dist/validators/validateTrigger.js +107 -0
  143. package/dist/validators/validateTrigger.js.map +1 -0
  144. package/dist/version.d.ts +1 -0
  145. package/dist/version.js +3 -0
  146. package/dist/version.js.map +1 -0
  147. package/ios/NotifeeCore/Info.plist +22 -0
  148. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.h +28 -0
  149. package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +76 -0
  150. package/ios/NotifeeCore/NotifeeCore+NSURLSession.h +25 -0
  151. package/ios/NotifeeCore/NotifeeCore+NSURLSession.m +55 -0
  152. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +44 -0
  153. package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +270 -0
  154. package/ios/NotifeeCore/NotifeeCore.h +118 -0
  155. package/ios/NotifeeCore/NotifeeCore.m +843 -0
  156. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.h +34 -0
  157. package/ios/NotifeeCore/NotifeeCoreDelegateHolder.m +70 -0
  158. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.h +39 -0
  159. package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.m +68 -0
  160. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.h +38 -0
  161. package/ios/NotifeeCore/NotifeeCoreExtensionHelper.m +224 -0
  162. package/ios/NotifeeCore/NotifeeCoreUtil.h +81 -0
  163. package/ios/NotifeeCore/NotifeeCoreUtil.m +834 -0
  164. package/ios/RNNotifee/NotifeeApiModule.h +25 -0
  165. package/ios/RNNotifee/NotifeeApiModule.mm +421 -0
  166. package/ios/RNNotifee/NotifeeExtensionHelper.h +37 -0
  167. package/ios/RNNotifee/NotifeeExtensionHelper.m +37 -0
  168. package/ios/RNNotifee.xcodeproj/project.pbxproj +318 -0
  169. package/ios/RNNotifee.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  170. package/ios/RNNotifee.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  171. package/jest-mock.js +162 -0
  172. package/package.json +85 -0
  173. package/react-native.config.js +11 -0
  174. package/src/NotifeeApiModule.ts +823 -0
  175. package/src/NotifeeJSEventEmitter.ts +10 -0
  176. package/src/NotifeeNativeError.ts +68 -0
  177. package/src/NotifeeNativeModule.ts +39 -0
  178. package/src/NotifeeNativeModule.web.ts +25 -0
  179. package/src/index.ts +33 -0
  180. package/src/specs/NativeNotifeeModule.ts +71 -0
  181. package/src/types/Library.ts +28 -0
  182. package/src/types/Module.ts +629 -0
  183. package/src/types/Notification.ts +518 -0
  184. package/src/types/NotificationAndroid.ts +1478 -0
  185. package/src/types/NotificationIOS.ts +683 -0
  186. package/src/types/NotificationWeb.ts +5 -0
  187. package/src/types/PowerManagerInfo.ts +43 -0
  188. package/src/types/Trigger.ts +136 -0
  189. package/src/utils/id.ts +13 -0
  190. package/src/utils/index.ts +46 -0
  191. package/src/utils/validate.ts +90 -0
  192. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfo.ts +61 -0
  193. package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.ts +33 -0
  194. package/src/validators/validate.ts +85 -0
  195. package/src/validators/validateAndroidAction.ts +54 -0
  196. package/src/validators/validateAndroidChannel.ts +188 -0
  197. package/src/validators/validateAndroidChannelGroup.ts +49 -0
  198. package/src/validators/validateAndroidFullScreenAction.ts +65 -0
  199. package/src/validators/validateAndroidInput.ts +67 -0
  200. package/src/validators/validateAndroidNotification.ts +734 -0
  201. package/src/validators/validateAndroidPressAction.ts +65 -0
  202. package/src/validators/validateAndroidStyle.ts +315 -0
  203. package/src/validators/validateIOSAttachment.ts +135 -0
  204. package/src/validators/validateIOSCategory.ts +150 -0
  205. package/src/validators/validateIOSCategoryAction.ts +65 -0
  206. package/src/validators/validateIOSInput.ts +38 -0
  207. package/src/validators/validateIOSNotification.ts +296 -0
  208. package/src/validators/validateIOSPermissions.ts +78 -0
  209. package/src/validators/validateNotification.ts +156 -0
  210. package/src/validators/validateTrigger.ts +142 -0
  211. package/src/version.ts +2 -0
  212. package/tsconfig.json +27 -0
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited
3
+ */
4
+ export default class NotifeeNativeError extends Error {
5
+ code;
6
+ nativeErrorCode;
7
+ nativeErrorMessage;
8
+ jsStack;
9
+ // TODO native error type
10
+ constructor(nativeError, jsStack = '') {
11
+ super();
12
+ const { userInfo } = nativeError;
13
+ this.code = `${userInfo.code || 'unknown'}`;
14
+ Object.defineProperty(this, 'code', {
15
+ enumerable: false,
16
+ value: `${userInfo.code || 'unknown'}`,
17
+ });
18
+ this.jsStack = jsStack;
19
+ Object.defineProperty(this, 'jsStack', {
20
+ enumerable: false,
21
+ value: jsStack,
22
+ });
23
+ Object.defineProperty(this, 'message', {
24
+ enumerable: false,
25
+ value: `[${this.code}] ${userInfo.message || nativeError.message}`,
26
+ });
27
+ Object.defineProperty(this, 'userInfo', {
28
+ enumerable: false,
29
+ value: userInfo,
30
+ });
31
+ this.nativeErrorCode = userInfo.nativeErrorCode || null;
32
+ Object.defineProperty(this, 'nativeErrorCode', {
33
+ enumerable: false,
34
+ value: userInfo.nativeErrorCode || null,
35
+ });
36
+ this.nativeErrorMessage = userInfo.nativeErrorMessage || null;
37
+ Object.defineProperty(this, 'nativeErrorMessage', {
38
+ enumerable: false,
39
+ value: userInfo.nativeErrorMessage || null,
40
+ });
41
+ this.stack = this.getStackWithMessage(`NativeError: ${this.message}`);
42
+ }
43
+ // todo errorEvent type
44
+ static fromEvent(errorEvent, stack) {
45
+ return new NotifeeNativeError({ userInfo: errorEvent }, stack || new Error().stack);
46
+ }
47
+ /**
48
+ * Build a stack trace that includes JS stack prior to calling the native method.
49
+ *
50
+ * @returns {string}
51
+ */
52
+ getStackWithMessage(message) {
53
+ return [message, ...this.jsStack.split('\n').slice(2, 13)].join('\n');
54
+ }
55
+ }
56
+ //# sourceMappingURL=NotifeeNativeError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifeeNativeError.js","sourceRoot":"","sources":["../src/NotifeeNativeError.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,KAAK;IACnC,IAAI,CAAS;IACb,eAAe,CAAS;IACxB,kBAAkB,CAAS;IAC1B,OAAO,CAAS;IAEjC,0BAA0B;IAC1B,YAAY,WAAgB,EAAE,OAAO,GAAG,EAAE;QACxC,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;QAEjC,IAAI,CAAC,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;QAC5C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;YAClC,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,IAAI,SAAS,EAAE;SACvC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACrC,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACrC,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE;SACnE,CAAC,CAAC;QAEH,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE;YACtC,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,IAAI,IAAI,CAAC;QACxD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE;YAC7C,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,QAAQ,CAAC,eAAe,IAAI,IAAI;SACxC,CAAC,CAAC;QAEH,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,IAAI,IAAI,CAAC;QAC9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,EAAE;YAChD,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,QAAQ,CAAC,kBAAkB,IAAI,IAAI;SAC3C,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,uBAAuB;IACvB,MAAM,CAAC,SAAS,CAAC,UAAe,EAAE,KAAc;QAC9C,OAAO,IAAI,kBAAkB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,IAAI,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;IACtF,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,OAAe;QACjC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { Spec } from './specs/NativeNotifeeModule';
2
+ export interface NativeModuleConfig {
3
+ version: string;
4
+ nativeModuleName: string;
5
+ nativeEvents: string[];
6
+ }
7
+ export default class NotifeeNativeModule {
8
+ private _nativeModule;
9
+ private _nativeEmitter;
10
+ constructor(config: NativeModuleConfig);
11
+ get emitter(): import("react-native/Libraries/vendor/emitter/EventEmitter").default;
12
+ get native(): Spec;
13
+ }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited
3
+ */
4
+ import NotifeeJSEventEmitter from './NotifeeJSEventEmitter';
5
+ import { NativeEventEmitter, TurboModuleRegistry } from 'react-native';
6
+ export default class NotifeeNativeModule {
7
+ _nativeModule;
8
+ _nativeEmitter;
9
+ constructor(config) {
10
+ this._nativeModule = TurboModuleRegistry.getEnforcing(config.nativeModuleName);
11
+ // @ts-ignore - change here needs resolution https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49560/files
12
+ this._nativeEmitter = new NativeEventEmitter(this.native);
13
+ for (let i = 0; i < config.nativeEvents.length; i++) {
14
+ const eventName = config.nativeEvents[i];
15
+ this._nativeEmitter.addListener(eventName, (payload) => {
16
+ this.emitter.emit(eventName, payload);
17
+ });
18
+ }
19
+ }
20
+ get emitter() {
21
+ return NotifeeJSEventEmitter;
22
+ }
23
+ get native() {
24
+ return this._nativeModule;
25
+ }
26
+ }
27
+ //# sourceMappingURL=NotifeeNativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifeeNativeModule.js","sourceRoot":"","sources":["../src/NotifeeNativeModule.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAqB,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAS1F,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAC9B,aAAa,CAAO;IACpB,cAAc,CAAqB;IAE3C,YAAmB,MAA0B;QAC3C,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAC,YAAY,CAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAErF,gHAAgH;QAChH,IAAI,CAAC,cAAc,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAyC,CAAC,CAAC;QAC7F,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,OAAY,EAAE,EAAE;gBAC1D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { NativeModulesStatic } from 'react-native';
2
+ export interface NativeModuleConfig {
3
+ version: string;
4
+ nativeModuleName: string;
5
+ nativeEvents: string[];
6
+ }
7
+ export default class NotifeeNativeModule {
8
+ private readonly _moduleConfig;
9
+ constructor(config: NativeModuleConfig);
10
+ get emitter(): import("react-native/Libraries/vendor/emitter/EventEmitter").default;
11
+ get native(): NativeModulesStatic;
12
+ }
@@ -0,0 +1,15 @@
1
+ import NotifeeJSEventEmitter from './NotifeeJSEventEmitter';
2
+ export default class NotifeeNativeModule {
3
+ // @ts-ignore unused value
4
+ _moduleConfig;
5
+ constructor(config) {
6
+ this._moduleConfig = Object.assign({}, config);
7
+ }
8
+ get emitter() {
9
+ return NotifeeJSEventEmitter;
10
+ }
11
+ get native() {
12
+ return {};
13
+ }
14
+ }
15
+ //# sourceMappingURL=NotifeeNativeModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifeeNativeModule.web.js","sourceRoot":"","sources":["../src/NotifeeNativeModule.web.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAQ5D,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,0BAA0B;IACT,aAAa,CAAqB;IAEnD,YAAmB,MAA0B;QAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { ModuleWithStatics } from './types/Module';
2
+ declare const defaultExports: ModuleWithStatics;
3
+ export default defaultExports;
4
+ export * from './types/Library';
5
+ export * from './types/Notification';
6
+ export * from './types/Trigger';
7
+ export * from './types/NotificationIOS';
8
+ export * from './types/NotificationAndroid';
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited
3
+ */
4
+ import NotifeeApiModule from './NotifeeApiModule';
5
+ import { version as SDK_VERSION } from './version';
6
+ import { isIOS, kReactNativeNotifeeNotificationBackgroundEvent, kReactNativeNotifeeNotificationEvent, } from './utils';
7
+ const apiModule = new NotifeeApiModule({
8
+ version: SDK_VERSION,
9
+ nativeModuleName: 'NotifeeApiModule',
10
+ nativeEvents: isIOS
11
+ ? [kReactNativeNotifeeNotificationEvent, kReactNativeNotifeeNotificationBackgroundEvent]
12
+ : [kReactNativeNotifeeNotificationEvent],
13
+ });
14
+ const statics = {
15
+ SDK_VERSION,
16
+ };
17
+ const defaultExports = Object.assign(apiModule, statics);
18
+ export default defaultExports;
19
+ export * from './types/Library';
20
+ export * from './types/Notification';
21
+ export * from './types/Trigger';
22
+ export * from './types/NotificationIOS';
23
+ export * from './types/NotificationAndroid';
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,KAAK,EACL,8CAA8C,EAC9C,oCAAoC,GACrC,MAAM,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC;IACrC,OAAO,EAAE,WAAW;IACpB,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,KAAK;QACjB,CAAC,CAAC,CAAC,oCAAoC,EAAE,8CAA8C,CAAC;QACxF,CAAC,CAAC,CAAC,oCAAoC,CAAC;CAC3C,CAAC,CAAC;AAEH,MAAM,OAAO,GAAkB;IAC7B,WAAW;CACZ,CAAC;AAEF,MAAM,cAAc,GAAsB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC5E,eAAe,cAAc,CAAC;AAE9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ getConstants(): {
4
+ ANDROID_API_LEVEL: number;
5
+ };
6
+ cancelAllNotifications(): Promise<void>;
7
+ cancelDisplayedNotifications(): Promise<void>;
8
+ cancelTriggerNotifications(): Promise<void>;
9
+ cancelAllNotificationsWithIds(ids: Array<string>, notificationType: number, tag: string | null): Promise<void>;
10
+ getDisplayedNotifications(): Promise<Array<Object>>;
11
+ getTriggerNotifications(): Promise<Array<Object>>;
12
+ getTriggerNotificationIds(): Promise<Array<string>>;
13
+ displayNotification(notification: Object): Promise<void>;
14
+ createTriggerNotification(notification: Object, trigger: Object): Promise<void>;
15
+ requestPermission(permissions: Object): Promise<Object>;
16
+ getNotificationSettings(): Promise<Object>;
17
+ getInitialNotification(): Promise<Object | null>;
18
+ createChannel(channelMap: Object): Promise<void>;
19
+ createChannels(channelsArray: Array<Object>): Promise<void>;
20
+ createChannelGroup(channelGroupMap: Object): Promise<void>;
21
+ createChannelGroups(channelGroupsArray: Array<Object>): Promise<void>;
22
+ deleteChannel(channelId: string): Promise<void>;
23
+ deleteChannelGroup(channelGroupId: string): Promise<void>;
24
+ getChannel(channelId: string): Promise<Object | null>;
25
+ getChannels(): Promise<Array<Object>>;
26
+ getChannelGroup(channelGroupId: string): Promise<Object | null>;
27
+ getChannelGroups(): Promise<Array<Object>>;
28
+ isChannelCreated(channelId: string): Promise<boolean>;
29
+ isChannelBlocked(channelId: string): Promise<boolean>;
30
+ openAlarmPermissionSettings(): Promise<void>;
31
+ openNotificationSettings(channelId: string | null): Promise<void>;
32
+ openBatteryOptimizationSettings(): Promise<void>;
33
+ isBatteryOptimizationEnabled(): Promise<boolean>;
34
+ getPowerManagerInfo(): Promise<Object>;
35
+ openPowerManagerSettings(): Promise<void>;
36
+ stopForegroundService(): Promise<void>;
37
+ hideNotificationDrawer(): void;
38
+ addListener(eventName: string): void;
39
+ removeListeners(count: number): void;
40
+ cancelNotification(notificationId: string): Promise<void>;
41
+ cancelDisplayedNotification(notificationId: string): Promise<void>;
42
+ cancelTriggerNotification(notificationId: string): Promise<void>;
43
+ cancelDisplayedNotificationsWithIds(ids: Array<string>): Promise<void>;
44
+ cancelTriggerNotificationsWithIds(ids: Array<string>): Promise<void>;
45
+ getNotificationCategories(): Promise<Array<Object>>;
46
+ setNotificationCategories(categories: Array<Object>): Promise<void>;
47
+ setBadgeCount(count: number): Promise<void>;
48
+ getBadgeCount(): Promise<number>;
49
+ incrementBadgeCount(incrementBy: number): Promise<void>;
50
+ decrementBadgeCount(decrementBy: number): Promise<void>;
51
+ }
52
+ declare const _default: Spec;
53
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited
3
+ */
4
+ import { TurboModuleRegistry } from 'react-native';
5
+ export default TurboModuleRegistry.getEnforcing('NotifeeApiModule');
6
+ //# sourceMappingURL=NativeNotifeeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeNotifeeModule.js","sourceRoot":"","sources":["../../src/specs/NativeNotifeeModule.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiEnD,eAAe,mBAAmB,CAAC,YAAY,CAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * An Error that has occurred in native Android or iOS code converted into a JavaScript Error.
3
+ */
4
+ export interface NativeError extends Error {
5
+ /**
6
+ * Error code, e.g. `invalid-parameter`
7
+ */
8
+ readonly code: string;
9
+ /**
10
+ * Error message
11
+ */
12
+ readonly message: string;
13
+ /**
14
+ * The native returned error code, different per platform
15
+ */
16
+ readonly nativeErrorCode: string | number;
17
+ /**
18
+ * The native returned error message, different per platform
19
+ */
20
+ readonly nativeErrorMessage: string;
21
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=Library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Library.js","sourceRoot":"","sources":["../../src/types/Library.ts"],"names":[],"mappings":"AAAA;;GAEG"}