@aws-amplify/rtn-push-notification 1.2.1-unstable.cfbde4c.0 → 1.2.1

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 (139) hide show
  1. package/android/build.gradle +1 -1
  2. package/{lib → dist/cjs}/apis/addMessageEventListener.js +3 -1
  3. package/dist/cjs/apis/addMessageEventListener.js.map +1 -0
  4. package/{lib → dist/cjs}/apis/addTokenEventListener.js +3 -1
  5. package/dist/cjs/apis/addTokenEventListener.js.map +1 -0
  6. package/{lib → dist/cjs}/apis/completeNotification.js +3 -1
  7. package/dist/cjs/apis/completeNotification.js.map +1 -0
  8. package/{lib → dist/cjs}/apis/getBadgeCount.js +3 -1
  9. package/dist/cjs/apis/getBadgeCount.js.map +1 -0
  10. package/{lib → dist/cjs}/apis/getConstants.js +3 -1
  11. package/dist/cjs/apis/getConstants.js.map +1 -0
  12. package/{lib → dist/cjs}/apis/getLaunchNotification.js +3 -1
  13. package/dist/cjs/apis/getLaunchNotification.js.map +1 -0
  14. package/{lib → dist/cjs}/apis/getPermissionStatus.js +3 -1
  15. package/dist/cjs/apis/getPermissionStatus.js.map +1 -0
  16. package/{lib → dist/cjs}/apis/index.js +3 -1
  17. package/dist/cjs/apis/index.js.map +1 -0
  18. package/{lib → dist/cjs}/apis/registerHeadlessTask.js +3 -1
  19. package/dist/cjs/apis/registerHeadlessTask.js.map +1 -0
  20. package/{lib → dist/cjs}/apis/requestPermissions.js +3 -1
  21. package/dist/cjs/apis/requestPermissions.js.map +1 -0
  22. package/{lib → dist/cjs}/apis/setBadgeCount.js +3 -1
  23. package/dist/cjs/apis/setBadgeCount.js.map +1 -0
  24. package/{lib → dist/cjs}/constants.js +3 -1
  25. package/dist/cjs/constants.js.map +1 -0
  26. package/{lib → dist/cjs}/index.js +5 -3
  27. package/dist/cjs/index.js.map +1 -0
  28. package/{lib → dist/cjs}/nativeModule.js +3 -1
  29. package/dist/cjs/nativeModule.js.map +1 -0
  30. package/dist/cjs/types/index.js +9 -0
  31. package/dist/cjs/types/index.js.map +1 -0
  32. package/{lib → dist/cjs}/types/module.js +3 -1
  33. package/dist/cjs/types/module.js.map +1 -0
  34. package/{lib → dist/cjs}/types/native.js +3 -1
  35. package/dist/cjs/types/native.js.map +1 -0
  36. package/{lib → dist/cjs}/utils/index.js +3 -1
  37. package/dist/cjs/utils/index.js.map +1 -0
  38. package/{lib → dist/cjs}/utils/normalizeNativeMessage.js +7 -4
  39. package/dist/cjs/utils/normalizeNativeMessage.js.map +1 -0
  40. package/{lib → dist/cjs}/utils/normalizeNativePermissionStatus.js +3 -1
  41. package/dist/cjs/utils/normalizeNativePermissionStatus.js.map +1 -0
  42. package/dist/esm/apis/addMessageEventListener.mjs +11 -0
  43. package/dist/esm/apis/addMessageEventListener.mjs.map +1 -0
  44. package/dist/esm/apis/addTokenEventListener.mjs +10 -0
  45. package/dist/esm/apis/addTokenEventListener.mjs.map +1 -0
  46. package/dist/esm/apis/completeNotification.mjs +8 -0
  47. package/dist/esm/apis/completeNotification.mjs.map +1 -0
  48. package/dist/esm/apis/getBadgeCount.mjs +8 -0
  49. package/dist/esm/apis/getBadgeCount.mjs.map +1 -0
  50. package/dist/esm/apis/getConstants.mjs +8 -0
  51. package/dist/esm/apis/getConstants.mjs.map +1 -0
  52. package/dist/esm/apis/getLaunchNotification.mjs +9 -0
  53. package/dist/esm/apis/getLaunchNotification.mjs.map +1 -0
  54. package/dist/esm/apis/getPermissionStatus.mjs +10 -0
  55. package/dist/esm/apis/getPermissionStatus.mjs.map +1 -0
  56. package/dist/esm/apis/index.mjs +11 -0
  57. package/dist/esm/apis/index.mjs.map +1 -0
  58. package/{lib-esm/apis/registerHeadlessTask.js → dist/esm/apis/registerHeadlessTask.mjs} +8 -4
  59. package/dist/esm/apis/registerHeadlessTask.mjs.map +1 -0
  60. package/{lib-esm/apis/requestPermissions.js → dist/esm/apis/requestPermissions.mjs} +6 -2
  61. package/dist/esm/apis/requestPermissions.mjs.map +1 -0
  62. package/dist/esm/apis/setBadgeCount.mjs +8 -0
  63. package/dist/esm/apis/setBadgeCount.mjs.map +1 -0
  64. package/{lib-esm/constants.js → dist/esm/constants.mjs} +7 -3
  65. package/dist/esm/constants.mjs.map +1 -0
  66. package/dist/esm/index.mjs +28 -0
  67. package/dist/esm/index.mjs.map +1 -0
  68. package/{lib-esm/nativeModule.js → dist/esm/nativeModule.mjs} +8 -4
  69. package/dist/esm/nativeModule.mjs.map +1 -0
  70. package/dist/esm/types/index.mjs +2 -0
  71. package/dist/esm/types/index.mjs.map +1 -0
  72. package/dist/esm/types/module.mjs +2 -0
  73. package/dist/esm/types/module.mjs.map +1 -0
  74. package/dist/esm/types/native.mjs +2 -0
  75. package/dist/esm/types/native.mjs.map +1 -0
  76. package/{lib/utils/index.d.ts → dist/esm/utils/index.mjs} +3 -2
  77. package/dist/esm/utils/index.mjs.map +1 -0
  78. package/{lib-esm/utils/normalizeNativeMessage.js → dist/esm/utils/normalizeNativeMessage.mjs} +6 -2
  79. package/dist/esm/utils/normalizeNativeMessage.mjs.map +1 -0
  80. package/{lib-esm/utils/normalizeNativePermissionStatus.js → dist/esm/utils/normalizeNativePermissionStatus.mjs} +4 -1
  81. package/dist/esm/utils/normalizeNativePermissionStatus.mjs.map +1 -0
  82. package/package.json +16 -19
  83. package/src/utils/normalizeNativeMessage.ts +1 -1
  84. package/lib/apis/addMessageEventListener.d.ts +0 -3
  85. package/lib/apis/addTokenEventListener.d.ts +0 -2
  86. package/lib/apis/completeNotification.d.ts +0 -1
  87. package/lib/apis/getBadgeCount.d.ts +0 -1
  88. package/lib/apis/getConstants.d.ts +0 -10
  89. package/lib/apis/getLaunchNotification.d.ts +0 -2
  90. package/lib/apis/getPermissionStatus.d.ts +0 -2
  91. package/lib/apis/index.d.ts +0 -10
  92. package/lib/apis/registerHeadlessTask.d.ts +0 -2
  93. package/lib/apis/requestPermissions.d.ts +0 -2
  94. package/lib/apis/setBadgeCount.d.ts +0 -1
  95. package/lib/constants.d.ts +0 -2
  96. package/lib/index.d.ts +0 -24
  97. package/lib/nativeModule.d.ts +0 -4
  98. package/lib/tsconfig.tsbuildinfo +0 -1
  99. package/lib/types/index.d.ts +0 -2
  100. package/lib/types/index.js +0 -20
  101. package/lib/types/module.d.ts +0 -31
  102. package/lib/types/native.d.ts +0 -69
  103. package/lib/utils/normalizeNativeMessage.d.ts +0 -5
  104. package/lib/utils/normalizeNativePermissionStatus.d.ts +0 -5
  105. package/lib-esm/apis/addMessageEventListener.js +0 -7
  106. package/lib-esm/apis/addTokenEventListener.js +0 -6
  107. package/lib-esm/apis/completeNotification.js +0 -4
  108. package/lib-esm/apis/getBadgeCount.js +0 -4
  109. package/lib-esm/apis/getConstants.js +0 -4
  110. package/lib-esm/apis/getLaunchNotification.js +0 -5
  111. package/lib-esm/apis/getPermissionStatus.js +0 -5
  112. package/lib-esm/apis/index.js +0 -12
  113. package/lib-esm/apis/setBadgeCount.js +0 -4
  114. package/lib-esm/index.js +0 -16
  115. package/lib-esm/tsconfig.tsbuildinfo +0 -1
  116. package/lib-esm/types/index.js +0 -4
  117. package/lib-esm/types/module.js +0 -3
  118. package/lib-esm/types/native.js +0 -3
  119. package/lib-esm/utils/index.js +0 -4
  120. /package/{lib-esm → dist/esm}/apis/addMessageEventListener.d.ts +0 -0
  121. /package/{lib-esm → dist/esm}/apis/addTokenEventListener.d.ts +0 -0
  122. /package/{lib-esm → dist/esm}/apis/completeNotification.d.ts +0 -0
  123. /package/{lib-esm → dist/esm}/apis/getBadgeCount.d.ts +0 -0
  124. /package/{lib-esm → dist/esm}/apis/getConstants.d.ts +0 -0
  125. /package/{lib-esm → dist/esm}/apis/getLaunchNotification.d.ts +0 -0
  126. /package/{lib-esm → dist/esm}/apis/getPermissionStatus.d.ts +0 -0
  127. /package/{lib-esm → dist/esm}/apis/index.d.ts +0 -0
  128. /package/{lib-esm → dist/esm}/apis/registerHeadlessTask.d.ts +0 -0
  129. /package/{lib-esm → dist/esm}/apis/requestPermissions.d.ts +0 -0
  130. /package/{lib-esm → dist/esm}/apis/setBadgeCount.d.ts +0 -0
  131. /package/{lib-esm → dist/esm}/constants.d.ts +0 -0
  132. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  133. /package/{lib-esm → dist/esm}/nativeModule.d.ts +0 -0
  134. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
  135. /package/{lib-esm → dist/esm}/types/module.d.ts +0 -0
  136. /package/{lib-esm → dist/esm}/types/native.d.ts +0 -0
  137. /package/{lib-esm → dist/esm}/utils/index.d.ts +0 -0
  138. /package/{lib-esm → dist/esm}/utils/normalizeNativeMessage.d.ts +0 -0
  139. /package/{lib-esm → dist/esm}/utils/normalizeNativePermissionStatus.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ import { nativeModule } from '../nativeModule.mjs';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ const setBadgeCount = (count) => nativeModule.setBadgeCount?.(count);
6
+
7
+ export { setBadgeCount };
8
+ //# sourceMappingURL=setBadgeCount.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setBadgeCount.mjs","sources":["../../../src/apis/setBadgeCount.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { nativeModule } from '../nativeModule';\nexport const setBadgeCount = (count) => nativeModule.setBadgeCount?.(count);\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,aAAa,GAAG,CAAC,KAAK,KAAK,YAAY,CAAC,aAAa,GAAG,KAAK;;;;"}
@@ -1,9 +1,13 @@
1
+ import { Platform } from 'react-native';
2
+
1
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
4
  // SPDX-License-Identifier: Apache-2.0
3
- import { Platform } from 'react-native';
4
5
  // General
5
- export const PACKAGE_NAME = '@aws-amplify/rtn-push-notification';
6
- export const LINKING_ERROR = `The ${PACKAGE_NAME} package doesn't seem to be linked. Make sure: \n\n` +
6
+ const PACKAGE_NAME = '@aws-amplify/rtn-push-notification';
7
+ const LINKING_ERROR = `The ${PACKAGE_NAME} package doesn't seem to be linked. Make sure: \n\n` +
7
8
  Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
8
9
  '- You rebuilt the app after installing the package\n' +
9
10
  '- You are not using Expo Go\n';
11
+
12
+ export { LINKING_ERROR, PACKAGE_NAME };
13
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sources":["../../src/constants.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Platform } from 'react-native';\n// General\nexport const PACKAGE_NAME = '@aws-amplify/rtn-push-notification';\nexport const LINKING_ERROR = `The ${PACKAGE_NAME} package doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACY,MAAC,YAAY,GAAG,qCAAqC;AACrD,MAAC,aAAa,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,mDAAmD,CAAC;AACrG,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC3E,IAAI,sDAAsD;AAC1D,IAAI;;;;"}
@@ -0,0 +1,28 @@
1
+ import { addMessageEventListener } from './apis/addMessageEventListener.mjs';
2
+ import { addTokenEventListener } from './apis/addTokenEventListener.mjs';
3
+ import { completeNotification } from './apis/completeNotification.mjs';
4
+ import { getBadgeCount } from './apis/getBadgeCount.mjs';
5
+ import { getConstants } from './apis/getConstants.mjs';
6
+ import { getLaunchNotification } from './apis/getLaunchNotification.mjs';
7
+ import { getPermissionStatus } from './apis/getPermissionStatus.mjs';
8
+ import { registerHeadlessTask } from './apis/registerHeadlessTask.mjs';
9
+ import { requestPermissions } from './apis/requestPermissions.mjs';
10
+ import { setBadgeCount } from './apis/setBadgeCount.mjs';
11
+
12
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
+ // SPDX-License-Identifier: Apache-2.0
14
+ const module = {
15
+ addMessageEventListener,
16
+ addTokenEventListener,
17
+ completeNotification,
18
+ getBadgeCount,
19
+ getConstants,
20
+ getLaunchNotification,
21
+ getPermissionStatus,
22
+ registerHeadlessTask,
23
+ requestPermissions,
24
+ setBadgeCount,
25
+ };
26
+
27
+ export { module };
28
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { addMessageEventListener, addTokenEventListener, completeNotification, getBadgeCount, getConstants, getLaunchNotification, getPermissionStatus, registerHeadlessTask, requestPermissions, setBadgeCount, } from './apis';\nconst module = {\n addMessageEventListener,\n addTokenEventListener,\n completeNotification,\n getBadgeCount,\n getConstants,\n getLaunchNotification,\n getPermissionStatus,\n registerHeadlessTask,\n requestPermissions,\n setBadgeCount,\n};\nexport { module };\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;AAEK,MAAC,MAAM,GAAG;AACf,IAAI,uBAAuB;AAC3B,IAAI,qBAAqB;AACzB,IAAI,oBAAoB;AACxB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AACxB,IAAI,kBAAkB;AACtB,IAAI,aAAa;AACjB;;;;"}
@@ -1,12 +1,16 @@
1
+ import { NativeModules, NativeEventEmitter } from 'react-native';
2
+ import { LINKING_ERROR } from './constants.mjs';
3
+
1
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
5
  // SPDX-License-Identifier: Apache-2.0
3
- import { NativeModules, NativeEventEmitter } from 'react-native';
4
- import { LINKING_ERROR } from './constants';
5
- export const nativeModule = NativeModules.AmplifyRTNPushNotification
6
+ const nativeModule = NativeModules.AmplifyRTNPushNotification
6
7
  ? NativeModules.AmplifyRTNPushNotification
7
8
  : new Proxy({}, {
8
9
  get() {
9
10
  throw new Error(LINKING_ERROR);
10
11
  },
11
12
  });
12
- export const nativeEventEmitter = new NativeEventEmitter(nativeModule);
13
+ const nativeEventEmitter = new NativeEventEmitter(nativeModule);
14
+
15
+ export { nativeEventEmitter, nativeModule };
16
+ //# sourceMappingURL=nativeModule.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeModule.mjs","sources":["../../src/nativeModule.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NativeModules, NativeEventEmitter } from 'react-native';\nimport { LINKING_ERROR } from './constants';\nexport const nativeModule = NativeModules.AmplifyRTNPushNotification\n ? NativeModules.AmplifyRTNPushNotification\n : new Proxy({}, {\n get() {\n throw new Error(LINKING_ERROR);\n },\n });\nexport const nativeEventEmitter = new NativeEventEmitter(nativeModule);\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,YAAY,GAAG,aAAa,CAAC,0BAA0B;AACpE,MAAM,aAAa,CAAC,0BAA0B;AAC9C,MAAM,IAAI,KAAK,CAAC,EAAE,EAAE;AACpB,QAAQ,GAAG,GAAG;AACd,YAAY,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;AAC3C,SAAS;AACT,KAAK,EAAE;AACK,MAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,YAAY;;;;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
- export { normalizeNativeMessage } from './normalizeNativeMessage';
2
- export { normalizeNativePermissionStatus } from './normalizeNativePermissionStatus';
1
+ export { normalizeNativeMessage } from './normalizeNativeMessage.mjs';
2
+ export { normalizeNativePermissionStatus } from './normalizeNativePermissionStatus.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,10 +1,11 @@
1
+ import isEmpty from 'lodash/isEmpty.js';
2
+
1
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
4
  // SPDX-License-Identifier: Apache-2.0
3
- import { isEmpty } from 'lodash';
4
5
  /**
5
6
  * @internal
6
7
  */
7
- export const normalizeNativeMessage = (nativeMessage) => {
8
+ const normalizeNativeMessage = (nativeMessage) => {
8
9
  let normalized;
9
10
  if (isApnsMessage(nativeMessage)) {
10
11
  normalized = normalizeApnsMessage(nativeMessage);
@@ -68,3 +69,6 @@ const getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime
68
69
  };
69
70
  const isApnsMessage = (nativeMessage) => !!nativeMessage?.aps;
70
71
  const isFcmMessage = (nativeMessage) => !!nativeMessage?.rawData;
72
+
73
+ export { normalizeNativeMessage };
74
+ //# sourceMappingURL=normalizeNativeMessage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeNativeMessage.mjs","sources":["../../../src/utils/normalizeNativeMessage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport isEmpty from 'lodash/isEmpty.js';\n/**\n * @internal\n */\nexport const normalizeNativeMessage = (nativeMessage) => {\n let normalized;\n if (isApnsMessage(nativeMessage)) {\n normalized = normalizeApnsMessage(nativeMessage);\n }\n else if (isFcmMessage(nativeMessage)) {\n normalized = normalizeFcmMessage(nativeMessage);\n }\n else {\n return null;\n }\n const { body, imageUrl, title, action, options, data } = normalized;\n return {\n body,\n data,\n imageUrl,\n title,\n ...action,\n ...options,\n };\n};\nconst normalizeApnsMessage = (apnsMessage) => {\n const { aps, data } = apnsMessage;\n const { body, title } = aps.alert ?? {};\n const action = getApnsAction(data?.pinpoint) ?? {};\n const imageUrl = data?.['media-url'];\n const options = getApnsOptions(apnsMessage);\n return { body, imageUrl, title, action, options, data };\n};\nconst normalizeFcmMessage = (fcmMessage) => {\n const { body, imageUrl, rawData: data, title } = fcmMessage;\n const action = getFcmAction(fcmMessage.action) ?? {};\n const options = getFcmOptions(fcmMessage);\n return { body, imageUrl, title, action, options, data };\n};\nconst getApnsAction = (action) => {\n if (action?.deeplink) {\n return { deeplinkUrl: action.deeplink };\n }\n};\nconst getFcmAction = (action) => {\n if (action?.url) {\n return { goToUrl: action.url };\n }\n if (action?.deeplink) {\n return { deeplinkUrl: action.deeplink };\n }\n};\nconst getApnsOptions = ({ aps, }) => {\n const { subtitle } = aps.alert ?? {};\n const apnsOptions = { ...(subtitle && { subtitle }) };\n return { ...(!isEmpty(apnsOptions) && { apnsOptions }) };\n};\nconst getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime = new Date().getTime(), }) => {\n const fcmOptions = {\n channelId,\n messageId,\n senderId,\n sendTime: new Date(sendTime),\n };\n return { ...(!isEmpty(fcmOptions) && { fcmOptions }) };\n};\nconst isApnsMessage = (nativeMessage) => !!nativeMessage?.aps;\nconst isFcmMessage = (nativeMessage) => !!nativeMessage?.rawData;\n"],"names":[],"mappings":"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"}
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * @internal
5
5
  */
6
- export const normalizeNativePermissionStatus = (nativeStatus) => {
6
+ const normalizeNativePermissionStatus = (nativeStatus) => {
7
7
  switch (nativeStatus) {
8
8
  case 'ShouldRequest':
9
9
  return 'shouldRequest';
@@ -17,3 +17,6 @@ export const normalizeNativePermissionStatus = (nativeStatus) => {
17
17
  return 'denied';
18
18
  }
19
19
  };
20
+
21
+ export { normalizeNativePermissionStatus };
22
+ //# sourceMappingURL=normalizeNativePermissionStatus.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeNativePermissionStatus.mjs","sources":["../../../src/utils/normalizeNativePermissionStatus.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nexport const normalizeNativePermissionStatus = (nativeStatus) => {\n switch (nativeStatus) {\n case 'ShouldRequest':\n return 'shouldRequest';\n case 'NotDetermined':\n case 'ShouldExplainThenRequest':\n return 'shouldExplainThenRequest';\n case 'Authorized':\n case 'Granted':\n return 'granted';\n case 'Denied':\n return 'denied';\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,+BAA+B,GAAG,CAAC,YAAY,KAAK;AACjE,IAAI,QAAQ,YAAY;AACxB,QAAQ,KAAK,eAAe;AAC5B,YAAY,OAAO,eAAe,CAAC;AACnC,QAAQ,KAAK,eAAe,CAAC;AAC7B,QAAQ,KAAK,0BAA0B;AACvC,YAAY,OAAO,0BAA0B,CAAC;AAC9C,QAAQ,KAAK,YAAY,CAAC;AAC1B,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,SAAS,CAAC;AAC7B,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,QAAQ,CAAC;AAC5B,KAAK;AACL;;;;"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@aws-amplify/rtn-push-notification",
3
- "version": "1.2.1-unstable.cfbde4c.0+cfbde4c",
3
+ "version": "1.2.1",
4
4
  "description": "React Native module for aws-amplify push notifications",
5
- "main": "./lib/index.js",
6
- "module": "./lib-esm/index.js",
7
- "typings": "./lib-esm/index.d.ts",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.mjs",
7
+ "react-native": "./src/index.ts",
8
+ "typings": "./dist/esm/index.d.ts",
8
9
  "sideEffects": false,
9
10
  "publishConfig": {
10
11
  "access": "public"
@@ -12,24 +13,22 @@
12
13
  "scripts": {
13
14
  "test": "npm run lint && jest -w 1 --coverage",
14
15
  "test:android": "./android/gradlew test -p ./android",
15
- "build-with-test": "npm run clean && npm test && tsc && webpack",
16
- "build:cjs": "rimraf lib && tsc -m commonjs --outDir lib && webpack && webpack --config ./webpack.config.dev.js",
17
- "build:esm": "rimraf lib-esm && tsc -m esnext --outDir lib-esm",
18
- "build:cjs:watch": "rimraf lib && tsc -m commonjs --outDir lib --watch",
19
- "build:esm:watch": "rimraf lib-esm && tsc -m esnext --outDir lib-esm --watch",
20
- "build": "npm run clean && npm run build:esm && npm run build:cjs",
16
+ "build-with-test": "npm run clean && npm test && tsc",
17
+ "build:esm-cjs": "rollup -c rollup.config.mjs",
18
+ "build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
19
+ "build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
20
+ "build": "npm run clean && npm run build:esm-cjs",
21
21
  "clean": "rimraf lib-esm lib dist",
22
22
  "format": "echo \"Not implemented\"",
23
23
  "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
24
24
  "ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 99"
25
25
  },
26
26
  "devDependencies": {
27
+ "@rollup/plugin-typescript": "11.1.5",
27
28
  "@types/react-native": "0.70.0",
29
+ "rollup": "3.29.4",
28
30
  "typescript": "5.0.2"
29
31
  },
30
- "react-native": {
31
- "./lib/index": "./lib-esm/index.js"
32
- },
33
32
  "repository": {
34
33
  "type": "git",
35
34
  "url": "https://github.com/aws-amplify/amplify-js.git"
@@ -44,8 +43,8 @@
44
43
  "Amplify*.podspec",
45
44
  "android",
46
45
  "ios",
47
- "lib",
48
- "lib-esm",
46
+ "dist/cjs",
47
+ "dist/esm",
49
48
  "src"
50
49
  ],
51
50
  "jest": {
@@ -84,10 +83,8 @@
84
83
  },
85
84
  "coveragePathIgnorePatterns": [
86
85
  "node_modules",
87
- "dist",
88
- "lib",
89
- "lib-esm"
86
+ "dist"
90
87
  ]
91
88
  },
92
- "gitHead": "cfbde4c7962de77bd43ba20811b84c4d7d333b42"
89
+ "gitHead": "f1408db3f570c4a18ada40cecbe7e68a0b31f1fe"
93
90
  }
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { isEmpty } from 'lodash';
4
+ import isEmpty from 'lodash/isEmpty.js';
5
5
  import {
6
6
  ApnsMessage,
7
7
  FcmMessage,
@@ -1,3 +0,0 @@
1
- import { EmitterSubscription } from 'react-native';
2
- import { PushNotificationMessage } from '../types';
3
- export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string) => void) => EmitterSubscription;
@@ -1,2 +0,0 @@
1
- import { EmitterSubscription } from 'react-native';
2
- export declare const addTokenEventListener: (event: string, listener: (token: string) => void) => EmitterSubscription;
@@ -1 +0,0 @@
1
- export declare const completeNotification: (completionHandlerId: string) => void;
@@ -1 +0,0 @@
1
- export declare const getBadgeCount: () => void | Promise<number | null>;
@@ -1,10 +0,0 @@
1
- export declare const getConstants: () => {
2
- NativeEvent: {
3
- BACKGROUND_MESSAGE_RECEIVED?: string | undefined;
4
- FOREGROUND_MESSAGE_RECEIVED: string;
5
- LAUNCH_NOTIFICATION_OPENED: string;
6
- NOTIFICATION_OPENED: string;
7
- TOKEN_RECEIVED: string;
8
- };
9
- NativeHeadlessTaskKey?: string | undefined;
10
- };
@@ -1,2 +0,0 @@
1
- import { PushNotificationMessage } from '../types';
2
- export declare const getLaunchNotification: () => Promise<PushNotificationMessage | null>;
@@ -1,2 +0,0 @@
1
- import { PushNotificationPermissionStatus } from '../types';
2
- export declare const getPermissionStatus: () => Promise<PushNotificationPermissionStatus>;
@@ -1,10 +0,0 @@
1
- export { addMessageEventListener } from './addMessageEventListener';
2
- export { addTokenEventListener } from './addTokenEventListener';
3
- export { completeNotification } from './completeNotification';
4
- export { getBadgeCount } from './getBadgeCount';
5
- export { getConstants } from './getConstants';
6
- export { getLaunchNotification } from './getLaunchNotification';
7
- export { getPermissionStatus } from './getPermissionStatus';
8
- export { registerHeadlessTask } from './registerHeadlessTask';
9
- export { requestPermissions } from './requestPermissions';
10
- export { setBadgeCount } from './setBadgeCount';
@@ -1,2 +0,0 @@
1
- import { PushNotificationMessage } from '../types';
2
- export declare const registerHeadlessTask: (task: (message: PushNotificationMessage | null) => Promise<void>) => void;
@@ -1,2 +0,0 @@
1
- import { PushNotificationPermissions } from '../types';
2
- export declare const requestPermissions: ({ alert, badge, sound }?: PushNotificationPermissions) => Promise<boolean>;
@@ -1 +0,0 @@
1
- export declare const setBadgeCount: (count: number) => void;
@@ -1,2 +0,0 @@
1
- export declare const PACKAGE_NAME = "@aws-amplify/rtn-push-notification";
2
- export declare const LINKING_ERROR: string;
package/lib/index.d.ts DELETED
@@ -1,24 +0,0 @@
1
- export { PushNotificationMessage, PushNotificationPermissionStatus, PushNotificationPermissions, } from './types';
2
- declare const module: {
3
- addMessageEventListener: (event: string, listener: (message: import("./types").PushNotificationMessage | null, completionHandlerId?: string | undefined) => void) => import("react-native").EmitterSubscription;
4
- addTokenEventListener: (event: string, listener: (token: string) => void) => import("react-native").EmitterSubscription;
5
- completeNotification: (completionHandlerId: string) => void;
6
- getBadgeCount: () => void | Promise<number | null>;
7
- getConstants: () => {
8
- NativeEvent: {
9
- BACKGROUND_MESSAGE_RECEIVED?: string | undefined;
10
- FOREGROUND_MESSAGE_RECEIVED: string;
11
- LAUNCH_NOTIFICATION_OPENED: string;
12
- NOTIFICATION_OPENED: string;
13
- TOKEN_RECEIVED: string;
14
- };
15
- NativeHeadlessTaskKey?: string | undefined;
16
- };
17
- getLaunchNotification: () => Promise<import("./types").PushNotificationMessage | null>;
18
- getPermissionStatus: () => Promise<import("./types").PushNotificationPermissionStatus>;
19
- registerHeadlessTask: (task: (message: import("./types").PushNotificationMessage | null) => Promise<void>) => void;
20
- requestPermissions: ({ alert, badge, sound }?: import("./types").PushNotificationPermissions) => Promise<boolean>;
21
- setBadgeCount: (count: number) => void;
22
- };
23
- export type PushNotificationModule = typeof module;
24
- export { module };
@@ -1,4 +0,0 @@
1
- import { NativeEventEmitter } from 'react-native';
2
- import { PushNotificationNativeModule } from './types';
3
- export declare const nativeModule: PushNotificationNativeModule;
4
- export declare const nativeEventEmitter: NativeEventEmitter;
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@types/react-native/globals.d.ts","../node_modules/@types/react-native/legacy-properties.d.ts","../node_modules/@types/react-native/BatchedBridge.d.ts","../node_modules/@types/react-native/Codegen.d.ts","../node_modules/@types/react-native/Devtools.d.ts","../node_modules/@types/react-native/LaunchScreen.d.ts","../node_modules/@types/react/ts5.0/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/prop-types/index.d.ts","../node_modules/@types/scheduler/tracing.d.ts","../node_modules/@types/react/ts5.0/index.d.ts","../node_modules/@types/react-native/index.d.ts","../src/constants.ts","../src/types/module.ts","../src/types/native.ts","../src/types/index.ts","../src/nativeModule.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../src/utils/normalizeNativeMessage.ts","../src/utils/normalizeNativePermissionStatus.ts","../src/utils/index.ts","../src/apis/addMessageEventListener.ts","../src/apis/addTokenEventListener.ts","../src/apis/completeNotification.ts","../src/apis/getBadgeCount.ts","../src/apis/getConstants.ts","../src/apis/getLaunchNotification.ts","../src/apis/getPermissionStatus.ts","../src/apis/registerHeadlessTask.ts","../src/apis/requestPermissions.ts","../src/apis/setBadgeCount.ts","../src/apis/index.ts","../src/index.ts","../../../node_modules/@types/events/index.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/base.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"95f22ce5f9dbcfc757ff850e7326a1ba1bc69806f1e70f48caefa824819d6f4f","affectsGlobalScope":true},{"version":"a76bbd53b4eafb985c6200962d1c9ec1ded8fa80c06ade7488be971e9eaa0e2d","affectsGlobalScope":true},"840dd3c9c22dc9f99d2cd7861d105f2275ba34b40c01a65f3a0f33b07b09ab4b",{"version":"efd32b1ab5e3897f64ed3d0f236657c3c9c7bcc669449e608ebee1ad9dbe396a","affectsGlobalScope":true},"ec8c27fd889adbf6a774c7915d25030f19adf16143bce0cbc42b566762e0b5a9","7fb3279c4bf36d993b1e8b339cded5908f7b2ec1b6e0ac2feaa842b5b6b143f1","234b97ac9af46707f2315ff395a9b340d37b7dbc8290d91f5d6bd97189d220f3",{"version":"0bd5e7096c7bc02bf70b2cc017fc45ef489cb19bd2f32a71af39ff5787f1b56a","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","8c6aac56e9dddb1f02d8e75478b79da0d25a1d0e38e75d5b8947534f61f3785e","5f8f00356f6a82e21493b2d57b2178f11b00cf8960df00bd37bdcae24c9333ca",{"version":"a694c85180021f7681f98dbde94b648b4e1483ad6fad4afc1d217619613f833a","affectsGlobalScope":true},{"version":"ec098916e691815f53433757e1b42b2c759b244027341ce52f51f68a4290cedc","affectsGlobalScope":true},{"version":"ad63f36e6b2b8bc81210018822b92a0a6aac0fa146ff1b4dd1f1756f910e6a38","signature":"af07bd1cc663dea0aaee9d2bbb8747edd005c603b2b496092b7c12eb0e9467ba"},{"version":"80f14a6f48880f4740bdec4beea7554cafd35870da0ce5508f0fcb666f17cbae","signature":"3b8ca1a74249f4e58e2012857e6b153954b80dd0d7ad0d6a2bd5db332f60be61"},{"version":"22ff79c193c7d425a9ec3ad451ae3eb30aeaf9c1f374b0df8906bcfb65b4722b","signature":"11b2f8da4815926e445ea2fb5b1c6b5dfba0e106a5764cc709e7eae14b3f8b6d"},{"version":"eb275b6026e1b89c5a948d6b789018f295c08d3ebb326c278b39bb898aacea0b","signature":"495145ff7a10f8dfdfcd5a85b641eabdffb504bc84d979fbb459de8a2a096a40"},{"version":"843d6dbabae3b4bd6fcb57287c4364d4d07acce351537faecb701952a4de0d5b","signature":"6510d3e1a557b12a29bb09210a0336c14d2edcbc130b862ee2a3f35ae03f54bb"},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},{"version":"3e0f22dc99e53928eeef56e3cf59bf9b9178735726a8523afa9a9cba95f561ce","signature":"93d1427f4f6fcde3dccdb5f6d8729c918330a335bb9a9f50f4337a518436ec19"},{"version":"565bcee4eab10c7c7b6072086c0ec6be4c075c70f7a8c06e20aee360e92864c8","signature":"8f45aa7fd7b455c02ffe0942b9a8c7cad3d8fa0368a97accaf754695d78e8b22"},{"version":"74ed1d7aedb506b6fcf08da40c5547b3d90a1bbe1c7f9b788af9154a6fa364a5","signature":"6075db412fa82ddb92b3ba6e273731e0285e5526950007ac617618f714ed2576"},{"version":"14f71fc0d5cddee2b25fb1e6e34a16b74477697a25d1e39b84ab9ad7aa562306","signature":"573ea4ca6792e46121e672d0d030da1252963c58854e98c347a1fa07ec34bc9d"},{"version":"70006c7d64656bf04d398d6188ef93d3d545a45c0f78203e89ec910b381f54b6","signature":"90e5dac1da43d2080be5171752d3fcc1fa503cc46263fca43b56979e508cf9e4"},{"version":"f27c6ffc94ce1debc8b46a34bdcb90fc90400841a15cb4df474149fbd22ba3ef","signature":"a9ffec24475367b03e7c293e9d02d33e22962cbda10b6129207dda18da0cfed6"},{"version":"f2c3fe3276aabfbd252e6c53c93c7a2d2ca3f2e034cd4d2b0b87de7aa41b6405","signature":"8510fdad58d17bd4d7a5cdef9d2c5b342e3d3106a8e25725ad3a97c8bfecad43"},{"version":"26e3f8327ba70ae7cb667cf88cbb0812bfdfe095cbe984996b8ce3f10d28aff2","signature":"59bb79a1ef176e353316dd1f499cfc9413d734e08b374480422fca91409e10e5"},{"version":"a095b440048e15932b88c300b142881ee2e6b0053dbc7eec58c483ef9da6c059","signature":"0cf256af183775b09e98271b84afd8c6655fea1abdc92ad7fe3149a643722f5a"},{"version":"f56ad54283e8d995cffa319d107ff3bbe7a2eadb9058306389ebfe3fdeea73c7","signature":"468e3b775d115f243b9b050b4a0a14d5d5319eb6a11631abb87a3af106d1e166"},{"version":"d7503fb99d03e628fb5b3805edf84ec623450d72423db46179cfc4fa60c649df","signature":"f2017f5610f1507e63f8f53c30ebca0f0a9a89fc8048b532a69253b3320f8c97"},{"version":"ed2ad7986be2f42eb71520f24882082e05b84641536fecf62aabf94c02fe79f1","signature":"0b091d5d86c48a1638cde9c24c40072fd7cbc8383596a2a60fa8c5740e8e3465"},{"version":"a59751c9afb49dea0bfa44bfa020ae3662be01ccc994c0c68e51d349ad52abf3","signature":"0723d06ffaee4c650470960527472a592f2e461956222b3f07cc012f5862681a"},{"version":"9cac713000bef957ae9bbf21746f06784b93eb1b362d6383e5c2316e1688c653","signature":"7df266f6512f80f7bed470b2225886f7c3759053ded4a49bec7ae2e0e19b7ecc"},{"version":"bfff0f1d3bd943a4d12a09b9bf634e6650a2e25c9ab387e43220c63886b40d10","signature":"50da250cfd99d5497756be8380f1bc6d28a3b3f5c529256f6bccf7f3b01e2555"},"93d28b4eb12c68fccc1f2fc04a4ef83ea3b2a03b18055d3bf29cab267aa7042e","7e49dbf1543b3ee54853ade4c5e9fa460b6a4eca967efe6bf943e0c505d087ed",{"version":"4450cc7b485b116b876cfe3e57d82b76464d6aee1ecefe0bf5ffc03ad9f13cf7","affectsGlobalScope":true},"9f0963be7caec23db8944f66bacb623a7bc7391520125845087241a270e9b3ce"],"root":[[73,77],[91,105]],"options":{"declaration":true,"downlevelIteration":true,"esModuleInterop":true,"importHelpers":false,"module":1,"noEmitOnError":true,"noImplicitAny":true,"outDir":"./","skipLibCheck":true,"strict":true,"target":99},"fileIdsList":[[108,109],[78,80,81,82,83,84,85,86,87,88,89,90,108,109],[78,79,81,82,83,84,85,86,87,88,89,90,108,109],[79,80,81,82,83,84,85,86,87,88,89,90,108,109],[78,79,80,82,83,84,85,86,87,88,89,90,108,109],[78,79,80,81,83,84,85,86,87,88,89,90,108,109],[78,79,80,81,82,84,85,86,87,88,89,90,108,109],[78,79,80,81,82,83,85,86,87,88,89,90,108,109],[78,79,80,81,82,83,84,86,87,88,89,90,108,109],[78,79,80,81,82,83,84,85,87,88,89,90,108,109],[78,79,80,81,82,83,84,85,86,88,89,90,108,109],[78,79,80,81,82,83,84,85,86,87,89,90,108,109],[78,79,80,81,82,83,84,85,86,87,88,90,108,109],[78,79,80,81,82,83,84,85,86,87,88,89,108,109],[107,108,109],[108],[62,72,108,109],[65,108,109],[61,62,63,64,65,66,71,108,109],[67,68,69,70,108,109],[62,72,76,77,93,108,109],[62,72,76,77,108,109],[77,108,109],[76,77,93,108,109],[94,95,96,97,98,99,100,101,102,103,108,109],[62,72,76,93,98,108,109],[76,77,108,109],[76,104,108,109],[62,72,73,76,108,109],[74,75,108,109],[62,72,74,108,109],[91,92,108,109],[76,90,108,109],[76,108,109],[62,72,76],[62,72],[76],[94,95,96,97,98,99,100,101,102,103],[74,75],[62,72,74],[91,92]],"referencedMap":[[106,1],[79,2],[80,3],[78,4],[81,5],[82,6],[83,7],[84,8],[85,9],[86,10],[87,11],[88,12],[89,13],[90,14],[108,15],[109,16],[107,1],[69,1],[63,1],[64,17],[65,18],[66,1],[61,1],[72,19],[62,17],[67,1],[71,20],[70,1],[68,1],[59,1],[60,1],[12,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[56,1],[54,1],[55,1],[57,1],[10,1],[1,1],[11,1],[58,1],[94,21],[95,22],[96,23],[97,23],[98,23],[99,24],[100,24],[104,25],[101,26],[102,27],[103,23],[73,17],[105,28],[77,29],[76,30],[74,1],[75,31],[93,32],[91,33],[92,34]],"exportedModulesMap":[[106,1],[79,2],[80,3],[78,4],[81,5],[82,6],[83,7],[84,8],[85,9],[86,10],[87,11],[88,12],[89,13],[90,14],[108,15],[109,16],[107,1],[69,1],[63,1],[64,17],[65,18],[66,1],[61,1],[72,19],[62,17],[67,1],[71,20],[70,1],[68,1],[59,1],[60,1],[12,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[56,1],[54,1],[55,1],[57,1],[10,1],[1,1],[11,1],[58,1],[94,35],[95,36],[99,37],[100,37],[104,38],[101,37],[102,37],[105,35],[77,35],[76,39],[75,40],[93,41],[91,37],[92,37]],"semanticDiagnosticsPerFile":[106,79,80,78,81,82,83,84,85,86,87,88,89,90,108,109,107,69,63,64,65,66,61,72,62,67,71,70,68,59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,94,95,96,97,98,99,100,104,101,102,103,73,105,77,76,74,75,93,91,92]},"version":"5.0.2"}
@@ -1,2 +0,0 @@
1
- export * from './module';
2
- export * from './native';
@@ -1,20 +0,0 @@
1
- "use strict";
2
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- // SPDX-License-Identifier: Apache-2.0
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
- };
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- __exportStar(require("./module"), exports);
20
- __exportStar(require("./native"), exports);
@@ -1,31 +0,0 @@
1
- /**
2
- * Types here are duplicated to the push notificaiton category within Amplify as it is not possible to share a
3
- * source of truth with a package that may conditionally not exist for developers not using push notifications.
4
- * Modifications made to these types should be reflected in the Amplify library and vice-versa!
5
- */
6
- export interface PushNotificationPermissions extends Partial<Record<string, boolean>> {
7
- alert?: boolean;
8
- badge?: boolean;
9
- sound?: boolean;
10
- }
11
- export interface PushNotificationMessage {
12
- title?: string;
13
- body?: string;
14
- imageUrl?: string;
15
- deeplinkUrl?: string;
16
- goToUrl?: string;
17
- fcmOptions?: FcmPlatformOptions;
18
- apnsOptions?: ApnsPlatformOptions;
19
- data?: Record<string, unknown>;
20
- }
21
- export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
22
- interface ApnsPlatformOptions {
23
- subtitle?: string;
24
- }
25
- interface FcmPlatformOptions {
26
- channelId: string;
27
- messageId: string;
28
- senderId: string;
29
- sendTime: Date;
30
- }
31
- export {};
@@ -1,69 +0,0 @@
1
- import { NativeModule } from 'react-native';
2
- import { PushNotificationMessage, PushNotificationPermissions } from './module';
3
- export interface PushNotificationNativeModule extends NativeModule {
4
- completeNotification?: (completionHandlerId: string) => void;
5
- getConstants: () => {
6
- NativeEvent: {
7
- BACKGROUND_MESSAGE_RECEIVED?: string;
8
- FOREGROUND_MESSAGE_RECEIVED: string;
9
- LAUNCH_NOTIFICATION_OPENED: string;
10
- NOTIFICATION_OPENED: string;
11
- TOKEN_RECEIVED: string;
12
- };
13
- NativeHeadlessTaskKey?: string;
14
- };
15
- getLaunchNotification: () => Promise<NativeMessage | null>;
16
- getBadgeCount?: () => Promise<number>;
17
- setBadgeCount?: (count: number) => void;
18
- getPermissionStatus: () => Promise<NativePermissionStatus>;
19
- requestPermissions: (permissions: PushNotificationPermissions) => Promise<boolean>;
20
- }
21
- export type NativeAction = {
22
- deeplink?: string;
23
- url?: string;
24
- };
25
- export type NativeMessage = (ApnsMessage | FcmMessage) & {
26
- token?: never;
27
- };
28
- export type NativePermissionStatus = AndroidPermissionStatus | IosPermissionStatus;
29
- export interface NormalizedValues {
30
- body?: string;
31
- imageUrl?: string;
32
- title?: string;
33
- action?: Pick<PushNotificationMessage, 'goToUrl' | 'deeplinkUrl'>;
34
- options?: Pick<PushNotificationMessage, 'apnsOptions' | 'fcmOptions'>;
35
- data?: Record<string, unknown>;
36
- }
37
- export type ApnsMessage = {
38
- aps: {
39
- alert?: {
40
- body?: string;
41
- title?: string;
42
- subtitle?: string;
43
- };
44
- };
45
- data?: {
46
- pinpoint?: NativeAction;
47
- 'media-url'?: string;
48
- };
49
- rawData?: never;
50
- completionHandlerId?: string;
51
- };
52
- export type IosPermissionStatus = 'NotDetermined' | 'Authorized' | 'Denied';
53
- export type FcmMessage = {
54
- action?: NativeAction;
55
- aps?: never;
56
- body?: string;
57
- imageUrl?: string;
58
- rawData?: Record<string, unknown>;
59
- title?: string;
60
- channelId?: string;
61
- messageId?: string;
62
- senderId?: string;
63
- sendTime?: number;
64
- completionHandlerId?: never;
65
- };
66
- export type AndroidPermissionStatus = 'ShouldRequest' | 'ShouldExplainThenRequest' | 'Granted' | 'Denied';
67
- export type TokenPayload = {
68
- token: string;
69
- };
@@ -1,5 +0,0 @@
1
- import { NativeMessage, PushNotificationMessage } from '../types';
2
- /**
3
- * @internal
4
- */
5
- export declare const normalizeNativeMessage: (nativeMessage?: NativeMessage) => PushNotificationMessage | null;
@@ -1,5 +0,0 @@
1
- import { NativePermissionStatus, PushNotificationPermissionStatus } from '../types';
2
- /**
3
- * @internal
4
- */
5
- export declare const normalizeNativePermissionStatus: (nativeStatus: NativePermissionStatus) => PushNotificationPermissionStatus;
@@ -1,7 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeEventEmitter } from '../nativeModule';
4
- import { normalizeNativeMessage } from '../utils';
5
- export const addMessageEventListener = (event, listener) => nativeEventEmitter.addListener(event, (nativeMessage) => {
6
- listener(normalizeNativeMessage(nativeMessage), nativeMessage.completionHandlerId);
7
- });
@@ -1,6 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeEventEmitter } from '../nativeModule';
4
- export const addTokenEventListener = (event, listener) => nativeEventEmitter.addListener(event, ({ token }) => {
5
- listener(token);
6
- });
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeModule } from '../nativeModule';
4
- export const completeNotification = (completionHandlerId) => nativeModule.completeNotification?.(completionHandlerId);
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeModule } from '../nativeModule';
4
- export const getBadgeCount = () => nativeModule.getBadgeCount?.();
@@ -1,4 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeModule } from '../nativeModule';
4
- export const getConstants = () => nativeModule.getConstants();
@@ -1,5 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { nativeModule } from '../nativeModule';
4
- import { normalizeNativeMessage } from '../utils';
5
- export const getLaunchNotification = async () => normalizeNativeMessage((await nativeModule.getLaunchNotification()) ?? undefined);