@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,61 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ class NotifeeNativeError extends Error {
7
+ code;
8
+ nativeErrorCode;
9
+ nativeErrorMessage;
10
+ jsStack;
11
+ // TODO native error type
12
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
13
+ constructor(nativeError, jsStack = '') {
14
+ super();
15
+ const { userInfo } = nativeError;
16
+ this.code = `${userInfo.code || 'unknown'}`;
17
+ Object.defineProperty(this, 'code', {
18
+ enumerable: false,
19
+ value: `${userInfo.code || 'unknown'}`,
20
+ });
21
+ this.jsStack = jsStack;
22
+ Object.defineProperty(this, 'jsStack', {
23
+ enumerable: false,
24
+ value: jsStack,
25
+ });
26
+ Object.defineProperty(this, 'message', {
27
+ enumerable: false,
28
+ value: `[${this.code}] ${userInfo.message || nativeError.message}`,
29
+ });
30
+ Object.defineProperty(this, 'userInfo', {
31
+ enumerable: false,
32
+ value: userInfo,
33
+ });
34
+ this.nativeErrorCode = userInfo.nativeErrorCode || null;
35
+ Object.defineProperty(this, 'nativeErrorCode', {
36
+ enumerable: false,
37
+ value: userInfo.nativeErrorCode || null,
38
+ });
39
+ this.nativeErrorMessage = userInfo.nativeErrorMessage || null;
40
+ Object.defineProperty(this, 'nativeErrorMessage', {
41
+ enumerable: false,
42
+ value: userInfo.nativeErrorMessage || null,
43
+ });
44
+ this.stack = this.getStackWithMessage(`NativeError: ${this.message}`);
45
+ }
46
+ // todo errorEvent type
47
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
48
+ static fromEvent(errorEvent, stack) {
49
+ return new NotifeeNativeError({ userInfo: errorEvent }, stack || new Error().stack);
50
+ }
51
+ /**
52
+ * Build a stack trace that includes JS stack prior to calling the native method.
53
+ *
54
+ * @returns {string}
55
+ */
56
+ getStackWithMessage(message) {
57
+ return [message, ...this.jsStack.split('\n').slice(2, 13)].join('\n');
58
+ }
59
+ }
60
+ exports.default = NotifeeNativeError;
61
+ //# sourceMappingURL=NotifeeNativeError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifeeNativeError.js","sourceRoot":"","sources":["../src/NotifeeNativeError.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAIH,MAAqB,kBAAmB,SAAQ,KAAK;IACnC,IAAI,CAAS;IACb,eAAe,CAAS;IACxB,kBAAkB,CAAS;IAC1B,OAAO,CAAS;IAEjC,0BAA0B;IAC1B,6EAA6E;IAC7E,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,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ModuleConfig {
3
+ version: string;
4
+ nativeModuleName: string;
5
+ nativeEvents: string[];
6
+ }
7
+ export default class NotifeeNativeModule {
8
+ private readonly _moduleConfig;
9
+ private _nativeModule;
10
+ private _nativeEmitter;
11
+ constructor(config: NativeModuleConfig);
12
+ get emitter(): EventEmitter;
13
+ get native(): NativeModulesStatic;
14
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const NotifeeJSEventEmitter_1 = __importDefault(require("./NotifeeJSEventEmitter"));
10
+ const react_native_1 = require("react-native");
11
+ class NotifeeNativeModule {
12
+ _moduleConfig;
13
+ _nativeModule;
14
+ _nativeEmitter;
15
+ constructor(config) {
16
+ this._nativeModule = null;
17
+ this._moduleConfig = Object.assign({}, config);
18
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
+ // @ts-ignore - change here needs resolution https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49560/files
20
+ this._nativeEmitter = new react_native_1.NativeEventEmitter(this.native);
21
+ for (let i = 0; i < config.nativeEvents.length; i++) {
22
+ const eventName = config.nativeEvents[i];
23
+ this._nativeEmitter.addListener(eventName, (payload) => {
24
+ this.emitter.emit(eventName, payload);
25
+ });
26
+ }
27
+ }
28
+ get emitter() {
29
+ return NotifeeJSEventEmitter_1.default;
30
+ }
31
+ get native() {
32
+ if (this._nativeModule) {
33
+ return this._nativeModule;
34
+ }
35
+ this._nativeModule = react_native_1.NativeModules[this._moduleConfig.nativeModuleName];
36
+ if (this._nativeModule == null) {
37
+ throw new Error('Notifee native module not found.');
38
+ }
39
+ return this._nativeModule;
40
+ }
41
+ }
42
+ exports.default = NotifeeNativeModule;
43
+ //# sourceMappingURL=NotifeeNativeModule.js.map
@@ -0,0 +1 @@
1
+ {"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ACF;AAnCD,sCAmCC"}
@@ -0,0 +1,12 @@
1
+ import { EventEmitter, 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(): EventEmitter;
11
+ get native(): NativeModulesStatic;
12
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ class NotifeeNativeModule {
5
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-ignore unused value
7
+ _moduleConfig;
8
+ constructor(config) {
9
+ this._moduleConfig = Object.assign({}, config);
10
+ }
11
+ get emitter() {
12
+ return new react_native_1.NativeEventEmitter();
13
+ }
14
+ get native() {
15
+ return {};
16
+ }
17
+ }
18
+ exports.default = NotifeeNativeModule;
19
+ //# sourceMappingURL=NotifeeNativeModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotifeeNativeModule.web.js","sourceRoot":"","sources":["../src/NotifeeNativeModule.web.ts"],"names":[],"mappings":";;AAAA,+CAAqF;AAQrF,MAAqB,mBAAmB;IACtC,6DAA6D;IAC7D,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,IAAI,iCAAkB,EAAE,CAAC;IAClC,CAAC;IAED,IAAW,MAAM;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAhBD,sCAgBC"}
@@ -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,43 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ var __importDefault = (this && this.__importDefault) || function (mod) {
20
+ return (mod && mod.__esModule) ? mod : { "default": mod };
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ const NotifeeApiModule_1 = __importDefault(require("./NotifeeApiModule"));
24
+ const version_1 = require("./version");
25
+ const utils_1 = require("./utils");
26
+ const apiModule = new NotifeeApiModule_1.default({
27
+ version: version_1.version,
28
+ nativeModuleName: 'NotifeeApiModule',
29
+ nativeEvents: utils_1.isIOS
30
+ ? [utils_1.kReactNativeNotifeeNotificationEvent, utils_1.kReactNativeNotifeeNotificationBackgroundEvent]
31
+ : [utils_1.kReactNativeNotifeeNotificationEvent],
32
+ });
33
+ const statics = {
34
+ SDK_VERSION: version_1.version,
35
+ };
36
+ const defaultExports = Object.assign(apiModule, statics);
37
+ exports.default = defaultExports;
38
+ __exportStar(require("./types/Library"), exports);
39
+ __exportStar(require("./types/Notification"), exports);
40
+ __exportStar(require("./types/Trigger"), exports);
41
+ __exportStar(require("./types/NotificationIOS"), exports);
42
+ __exportStar(require("./types/NotificationAndroid"), exports);
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;AAEH,0EAAkD;AAElD,uCAAmD;AACnD,mCAIiB;AAEjB,MAAM,SAAS,GAAG,IAAI,0BAAgB,CAAC;IACrC,OAAO,EAAE,iBAAW;IACpB,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,aAAK;QACjB,CAAC,CAAC,CAAC,4CAAoC,EAAE,sDAA8C,CAAC;QACxF,CAAC,CAAC,CAAC,4CAAoC,CAAC;CAC3C,CAAC,CAAC;AAEH,MAAM,OAAO,GAAkB;IAC7B,WAAW,EAAX,iBAAW;CACZ,CAAC;AAEF,MAAM,cAAc,GAAsB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC5E,kBAAe,cAAc,CAAC;AAE9B,kDAAgC;AAChC,uDAAqC;AACrC,kDAAgC;AAChC,0DAAwC;AACxC,8DAA4C"}
@@ -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,6 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2016-present Invertase Limited
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=Library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Library.js","sourceRoot":"","sources":["../../src/types/Library.ts"],"names":[],"mappings":";AAAA;;GAEG"}