@aws-amplify/rtn-push-notification 1.2.1-api-v6-models.c1977f8.0 → 1.2.1-api-v6-models.891fe0d.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 (103) hide show
  1. package/android/build.gradle +16 -1
  2. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  3. package/android/src/hasPackageName/AndroidManifest.xml +22 -0
  4. package/android/src/main/AndroidManifest.xml +1 -2
  5. package/lib/apis/addMessageEventListener.d.ts +1 -1
  6. package/lib/apis/addMessageEventListener.js +4 -3
  7. package/lib/apis/addTokenEventListener.js +3 -2
  8. package/lib/apis/completeNotification.js +3 -2
  9. package/lib/apis/getBadgeCount.js +3 -2
  10. package/lib/apis/getConstants.js +3 -2
  11. package/lib/apis/getLaunchNotification.js +3 -2
  12. package/lib/apis/getPermissionStatus.js +3 -2
  13. package/lib/apis/index.js +11 -11
  14. package/lib/apis/registerHeadlessTask.js +5 -4
  15. package/lib/apis/requestPermissions.d.ts +1 -1
  16. package/lib/apis/requestPermissions.js +8 -3
  17. package/lib/apis/setBadgeCount.js +3 -2
  18. package/lib/constants.js +1 -1
  19. package/lib/index.d.ts +2 -2
  20. package/lib/index.js +1 -1
  21. package/lib/nativeModule.js +1 -1
  22. package/lib/tsconfig.tsbuildinfo +1 -0
  23. package/lib/types/index.js +16 -1
  24. package/lib/types/module.d.ts +6 -1
  25. package/lib/types/module.js +0 -1
  26. package/lib/types/native.d.ts +9 -9
  27. package/lib/types/native.js +0 -1
  28. package/lib/utils/index.js +3 -3
  29. package/lib/utils/normalizeNativeMessage.d.ts +2 -6
  30. package/lib/utils/normalizeNativeMessage.js +6 -5
  31. package/lib/utils/normalizeNativePermissionStatus.js +3 -2
  32. package/lib-esm/apis/addMessageEventListener.d.ts +1 -1
  33. package/lib-esm/apis/addMessageEventListener.js +0 -1
  34. package/lib-esm/apis/addTokenEventListener.js +0 -1
  35. package/lib-esm/apis/completeNotification.js +0 -1
  36. package/lib-esm/apis/getBadgeCount.js +0 -1
  37. package/lib-esm/apis/getConstants.js +0 -1
  38. package/lib-esm/apis/getLaunchNotification.js +0 -1
  39. package/lib-esm/apis/getPermissionStatus.js +0 -1
  40. package/lib-esm/apis/index.js +0 -1
  41. package/lib-esm/apis/registerHeadlessTask.js +0 -1
  42. package/lib-esm/apis/requestPermissions.d.ts +1 -1
  43. package/lib-esm/apis/requestPermissions.js +6 -3
  44. package/lib-esm/apis/setBadgeCount.js +0 -1
  45. package/lib-esm/constants.js +0 -1
  46. package/lib-esm/index.d.ts +2 -2
  47. package/lib-esm/index.js +0 -1
  48. package/lib-esm/nativeModule.js +0 -1
  49. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  50. package/lib-esm/types/index.js +2 -1
  51. package/lib-esm/types/module.d.ts +6 -1
  52. package/lib-esm/types/module.js +1 -1
  53. package/lib-esm/types/native.d.ts +9 -9
  54. package/lib-esm/types/native.js +1 -1
  55. package/lib-esm/utils/index.js +0 -1
  56. package/lib-esm/utils/normalizeNativeMessage.d.ts +2 -6
  57. package/lib-esm/utils/normalizeNativeMessage.js +1 -2
  58. package/lib-esm/utils/normalizeNativePermissionStatus.js +0 -1
  59. package/package.json +49 -7
  60. package/src/apis/requestPermissions.ts +7 -2
  61. package/src/types/module.ts +6 -0
  62. package/src/types/native.ts +1 -1
  63. package/src/utils/normalizeNativeMessage.ts +1 -1
  64. package/lib/apis/addMessageEventListener.js.map +0 -1
  65. package/lib/apis/addTokenEventListener.js.map +0 -1
  66. package/lib/apis/completeNotification.js.map +0 -1
  67. package/lib/apis/getBadgeCount.js.map +0 -1
  68. package/lib/apis/getConstants.js.map +0 -1
  69. package/lib/apis/getLaunchNotification.js.map +0 -1
  70. package/lib/apis/getPermissionStatus.js.map +0 -1
  71. package/lib/apis/index.js.map +0 -1
  72. package/lib/apis/registerHeadlessTask.js.map +0 -1
  73. package/lib/apis/requestPermissions.js.map +0 -1
  74. package/lib/apis/setBadgeCount.js.map +0 -1
  75. package/lib/constants.js.map +0 -1
  76. package/lib/index.js.map +0 -1
  77. package/lib/nativeModule.js.map +0 -1
  78. package/lib/types/index.js.map +0 -1
  79. package/lib/types/module.js.map +0 -1
  80. package/lib/types/native.js.map +0 -1
  81. package/lib/utils/index.js.map +0 -1
  82. package/lib/utils/normalizeNativeMessage.js.map +0 -1
  83. package/lib/utils/normalizeNativePermissionStatus.js.map +0 -1
  84. package/lib-esm/apis/addMessageEventListener.js.map +0 -1
  85. package/lib-esm/apis/addTokenEventListener.js.map +0 -1
  86. package/lib-esm/apis/completeNotification.js.map +0 -1
  87. package/lib-esm/apis/getBadgeCount.js.map +0 -1
  88. package/lib-esm/apis/getConstants.js.map +0 -1
  89. package/lib-esm/apis/getLaunchNotification.js.map +0 -1
  90. package/lib-esm/apis/getPermissionStatus.js.map +0 -1
  91. package/lib-esm/apis/index.js.map +0 -1
  92. package/lib-esm/apis/registerHeadlessTask.js.map +0 -1
  93. package/lib-esm/apis/requestPermissions.js.map +0 -1
  94. package/lib-esm/apis/setBadgeCount.js.map +0 -1
  95. package/lib-esm/constants.js.map +0 -1
  96. package/lib-esm/index.js.map +0 -1
  97. package/lib-esm/nativeModule.js.map +0 -1
  98. package/lib-esm/types/index.js.map +0 -1
  99. package/lib-esm/types/module.js.map +0 -1
  100. package/lib-esm/types/native.js.map +0 -1
  101. package/lib-esm/utils/index.js.map +0 -1
  102. package/lib-esm/utils/normalizeNativeMessage.js.map +0 -1
  103. package/lib-esm/utils/normalizeNativePermissionStatus.js.map +0 -1
@@ -1,3 +1,8 @@
1
+ import com.android.Version
2
+
3
+ def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
4
+ def androidManifestPath = agpVersion >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasPackageName/AndroidManifest.xml'
5
+
1
6
  buildscript {
2
7
  def kotlin_version = rootProject.ext.has('kotlinVersion')
3
8
  ? rootProject.ext.get('kotlinVersion')
@@ -10,7 +15,7 @@ buildscript {
10
15
 
11
16
  dependencies {
12
17
  if (project == rootProject) {
13
- classpath 'com.android.tools.build:gradle:7.3.1'
18
+ classpath 'com.android.tools.build:gradle:8.0.2'
14
19
  }
15
20
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16
21
  classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
@@ -26,6 +31,10 @@ def getExtOrDefault(prop) {
26
31
  }
27
32
 
28
33
  android {
34
+ if (agpVersion >= 7) {
35
+ namespace 'com.amazonaws.amplify'
36
+ }
37
+
29
38
  compileSdkVersion getExtOrDefault('compileSdkVersion')
30
39
 
31
40
  defaultConfig {
@@ -33,6 +42,12 @@ android {
33
42
  targetSdkVersion getExtOrDefault('targetSdkVersion')
34
43
  }
35
44
 
45
+ sourceSets {
46
+ main {
47
+ manifest.srcFile androidManifestPath
48
+ }
49
+ }
50
+
36
51
  compileOptions {
37
52
  sourceCompatibility JavaVersion.VERSION_1_8
38
53
  targetCompatibility JavaVersion.VERSION_1_8
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.amazonaws.amplify.rtnpushnotification">
4
+
5
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
6
+ <application>
7
+ <activity
8
+ android:name=".PushNotificationLaunchActivity"
9
+ android:launchMode="singleInstance"
10
+ android:exported="false" />
11
+
12
+ <service android:name=".PushNotificationHeadlessTaskService" />
13
+
14
+ <service
15
+ android:name=".PushNotificationFirebaseMessagingService"
16
+ android:exported="false">
17
+ <intent-filter>
18
+ <action android:name="com.google.firebase.MESSAGING_EVENT" />
19
+ </intent-filter>
20
+ </service>
21
+ </application>
22
+ </manifest>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.amazonaws.amplify.rtnpushnotification">
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
4
3
 
5
4
  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
6
5
  <application>
@@ -1,3 +1,3 @@
1
1
  import { EmitterSubscription } from 'react-native';
2
2
  import { PushNotificationMessage } from '../types';
3
- export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string | undefined) => void) => EmitterSubscription;
3
+ export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string) => void) => EmitterSubscription;
@@ -2,9 +2,10 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.addMessageEventListener = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
7
  const utils_1 = require("../utils");
7
- exports.addMessageEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, (nativeMessage) => {
8
- listener(utils_1.normalizeNativeMessage(nativeMessage), nativeMessage.completionHandlerId);
8
+ const addMessageEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, (nativeMessage) => {
9
+ listener((0, utils_1.normalizeNativeMessage)(nativeMessage), nativeMessage.completionHandlerId);
9
10
  });
10
- //# sourceMappingURL=addMessageEventListener.js.map
11
+ exports.addMessageEventListener = addMessageEventListener;
@@ -2,8 +2,9 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.addTokenEventListener = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.addTokenEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, ({ token }) => {
7
+ const addTokenEventListener = (event, listener) => nativeModule_1.nativeEventEmitter.addListener(event, ({ token }) => {
7
8
  listener(token);
8
9
  });
9
- //# sourceMappingURL=addTokenEventListener.js.map
10
+ exports.addTokenEventListener = addTokenEventListener;
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.completeNotification = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.completeNotification = (completionHandlerId) => nativeModule_1.nativeModule.completeNotification?.(completionHandlerId);
7
- //# sourceMappingURL=completeNotification.js.map
7
+ const completeNotification = (completionHandlerId) => nativeModule_1.nativeModule.completeNotification?.(completionHandlerId);
8
+ exports.completeNotification = completeNotification;
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getBadgeCount = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.getBadgeCount = () => nativeModule_1.nativeModule.getBadgeCount?.();
7
- //# sourceMappingURL=getBadgeCount.js.map
7
+ const getBadgeCount = () => nativeModule_1.nativeModule.getBadgeCount?.();
8
+ exports.getBadgeCount = getBadgeCount;
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getConstants = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.getConstants = () => nativeModule_1.nativeModule.getConstants();
7
- //# sourceMappingURL=getConstants.js.map
7
+ const getConstants = () => nativeModule_1.nativeModule.getConstants();
8
+ exports.getConstants = getConstants;
@@ -2,7 +2,8 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getLaunchNotification = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
7
  const utils_1 = require("../utils");
7
- exports.getLaunchNotification = async () => utils_1.normalizeNativeMessage((await nativeModule_1.nativeModule.getLaunchNotification()) ?? undefined);
8
- //# sourceMappingURL=getLaunchNotification.js.map
8
+ const getLaunchNotification = async () => (0, utils_1.normalizeNativeMessage)((await nativeModule_1.nativeModule.getLaunchNotification()) ?? undefined);
9
+ exports.getLaunchNotification = getLaunchNotification;
@@ -2,7 +2,8 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getPermissionStatus = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
7
  const utils_1 = require("../utils");
7
- exports.getPermissionStatus = async () => utils_1.normalizeNativePermissionStatus(await nativeModule_1.nativeModule.getPermissionStatus());
8
- //# sourceMappingURL=getPermissionStatus.js.map
8
+ const getPermissionStatus = async () => (0, utils_1.normalizeNativePermissionStatus)(await nativeModule_1.nativeModule.getPermissionStatus());
9
+ exports.getPermissionStatus = getPermissionStatus;
package/lib/apis/index.js CHANGED
@@ -2,24 +2,24 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.setBadgeCount = exports.requestPermissions = exports.registerHeadlessTask = exports.getPermissionStatus = exports.getLaunchNotification = exports.getConstants = exports.getBadgeCount = exports.completeNotification = exports.addTokenEventListener = exports.addMessageEventListener = void 0;
5
6
  var addMessageEventListener_1 = require("./addMessageEventListener");
6
- exports.addMessageEventListener = addMessageEventListener_1.addMessageEventListener;
7
+ Object.defineProperty(exports, "addMessageEventListener", { enumerable: true, get: function () { return addMessageEventListener_1.addMessageEventListener; } });
7
8
  var addTokenEventListener_1 = require("./addTokenEventListener");
8
- exports.addTokenEventListener = addTokenEventListener_1.addTokenEventListener;
9
+ Object.defineProperty(exports, "addTokenEventListener", { enumerable: true, get: function () { return addTokenEventListener_1.addTokenEventListener; } });
9
10
  var completeNotification_1 = require("./completeNotification");
10
- exports.completeNotification = completeNotification_1.completeNotification;
11
+ Object.defineProperty(exports, "completeNotification", { enumerable: true, get: function () { return completeNotification_1.completeNotification; } });
11
12
  var getBadgeCount_1 = require("./getBadgeCount");
12
- exports.getBadgeCount = getBadgeCount_1.getBadgeCount;
13
+ Object.defineProperty(exports, "getBadgeCount", { enumerable: true, get: function () { return getBadgeCount_1.getBadgeCount; } });
13
14
  var getConstants_1 = require("./getConstants");
14
- exports.getConstants = getConstants_1.getConstants;
15
+ Object.defineProperty(exports, "getConstants", { enumerable: true, get: function () { return getConstants_1.getConstants; } });
15
16
  var getLaunchNotification_1 = require("./getLaunchNotification");
16
- exports.getLaunchNotification = getLaunchNotification_1.getLaunchNotification;
17
+ Object.defineProperty(exports, "getLaunchNotification", { enumerable: true, get: function () { return getLaunchNotification_1.getLaunchNotification; } });
17
18
  var getPermissionStatus_1 = require("./getPermissionStatus");
18
- exports.getPermissionStatus = getPermissionStatus_1.getPermissionStatus;
19
+ Object.defineProperty(exports, "getPermissionStatus", { enumerable: true, get: function () { return getPermissionStatus_1.getPermissionStatus; } });
19
20
  var registerHeadlessTask_1 = require("./registerHeadlessTask");
20
- exports.registerHeadlessTask = registerHeadlessTask_1.registerHeadlessTask;
21
+ Object.defineProperty(exports, "registerHeadlessTask", { enumerable: true, get: function () { return registerHeadlessTask_1.registerHeadlessTask; } });
21
22
  var requestPermissions_1 = require("./requestPermissions");
22
- exports.requestPermissions = requestPermissions_1.requestPermissions;
23
+ Object.defineProperty(exports, "requestPermissions", { enumerable: true, get: function () { return requestPermissions_1.requestPermissions; } });
23
24
  var setBadgeCount_1 = require("./setBadgeCount");
24
- exports.setBadgeCount = setBadgeCount_1.setBadgeCount;
25
- //# sourceMappingURL=index.js.map
25
+ Object.defineProperty(exports, "setBadgeCount", { enumerable: true, get: function () { return setBadgeCount_1.setBadgeCount; } });
@@ -2,15 +2,16 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.registerHeadlessTask = void 0;
5
6
  const react_native_1 = require("react-native");
6
7
  const getConstants_1 = require("./getConstants");
7
8
  const utils_1 = require("../utils");
8
- exports.registerHeadlessTask = (task) => {
9
- const { NativeHeadlessTaskKey } = getConstants_1.getConstants();
9
+ const registerHeadlessTask = (task) => {
10
+ const { NativeHeadlessTaskKey } = (0, getConstants_1.getConstants)();
10
11
  if (NativeHeadlessTaskKey) {
11
12
  react_native_1.AppRegistry.registerHeadlessTask(NativeHeadlessTaskKey, () => async (nativeMessage) => {
12
- await task(utils_1.normalizeNativeMessage(nativeMessage));
13
+ await task((0, utils_1.normalizeNativeMessage)(nativeMessage));
13
14
  });
14
15
  }
15
16
  };
16
- //# sourceMappingURL=registerHeadlessTask.js.map
17
+ exports.registerHeadlessTask = registerHeadlessTask;
@@ -1,2 +1,2 @@
1
1
  import { PushNotificationPermissions } from '../types';
2
- export declare const requestPermissions: (permissions?: PushNotificationPermissions) => Promise<boolean>;
2
+ export declare const requestPermissions: ({ alert, badge, sound }?: PushNotificationPermissions) => Promise<boolean>;
@@ -2,10 +2,15 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.requestPermissions = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.requestPermissions = async (permissions = {
7
+ const requestPermissions = async ({ alert = true, badge = true, sound = true } = {
7
8
  alert: true,
8
9
  badge: true,
9
10
  sound: true,
10
- }) => nativeModule_1.nativeModule.requestPermissions(permissions);
11
- //# sourceMappingURL=requestPermissions.js.map
11
+ }) => nativeModule_1.nativeModule.requestPermissions({
12
+ alert,
13
+ badge,
14
+ sound,
15
+ });
16
+ exports.requestPermissions = requestPermissions;
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.setBadgeCount = void 0;
5
6
  const nativeModule_1 = require("../nativeModule");
6
- exports.setBadgeCount = (count) => nativeModule_1.nativeModule.setBadgeCount?.(count);
7
- //# sourceMappingURL=setBadgeCount.js.map
7
+ const setBadgeCount = (count) => nativeModule_1.nativeModule.setBadgeCount?.(count);
8
+ exports.setBadgeCount = setBadgeCount;
package/lib/constants.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LINKING_ERROR = exports.PACKAGE_NAME = void 0;
3
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
5
  // SPDX-License-Identifier: Apache-2.0
5
6
  const react_native_1 = require("react-native");
@@ -9,4 +10,3 @@ exports.LINKING_ERROR = `The ${exports.PACKAGE_NAME} package doesn't seem to be
9
10
  react_native_1.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
10
11
  '- You rebuilt the app after installing the package\n' +
11
12
  '- You are not using Expo Go\n';
12
- //# sourceMappingURL=constants.js.map
package/lib/index.d.ts CHANGED
@@ -17,8 +17,8 @@ declare const module: {
17
17
  getLaunchNotification: () => Promise<import("./types").PushNotificationMessage | null>;
18
18
  getPermissionStatus: () => Promise<import("./types").PushNotificationPermissionStatus>;
19
19
  registerHeadlessTask: (task: (message: import("./types").PushNotificationMessage | null) => Promise<void>) => void;
20
- requestPermissions: (permissions?: import("./types").PushNotificationPermissions) => Promise<boolean>;
20
+ requestPermissions: ({ alert, badge, sound }?: import("./types").PushNotificationPermissions) => Promise<boolean>;
21
21
  setBadgeCount: (count: number) => void;
22
22
  };
23
- export declare type PushNotificationModule = typeof module;
23
+ export type PushNotificationModule = typeof module;
24
24
  export { module };
package/lib/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.module = void 0;
5
6
  const apis_1 = require("./apis");
6
7
  const module = {
7
8
  addMessageEventListener: apis_1.addMessageEventListener,
@@ -16,4 +17,3 @@ const module = {
16
17
  setBadgeCount: apis_1.setBadgeCount,
17
18
  };
18
19
  exports.module = module;
19
- //# sourceMappingURL=index.js.map
@@ -2,6 +2,7 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.nativeEventEmitter = exports.nativeModule = void 0;
5
6
  const react_native_1 = require("react-native");
6
7
  const constants_1 = require("./constants");
7
8
  exports.nativeModule = react_native_1.NativeModules.AmplifyRTNPushNotification
@@ -12,4 +13,3 @@ exports.nativeModule = react_native_1.NativeModules.AmplifyRTNPushNotification
12
13
  },
13
14
  });
14
15
  exports.nativeEventEmitter = new react_native_1.NativeEventEmitter(exports.nativeModule);
15
- //# sourceMappingURL=nativeModule.js.map
@@ -0,0 +1 @@
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,5 +1,20 @@
1
1
  "use strict";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
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
+ };
4
18
  Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=index.js.map
19
+ __exportStar(require("./module"), exports);
20
+ __exportStar(require("./native"), exports);
@@ -1,3 +1,8 @@
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
+ */
1
6
  export interface PushNotificationPermissions extends Partial<Record<string, boolean>> {
2
7
  alert?: boolean;
3
8
  badge?: boolean;
@@ -13,7 +18,7 @@ export interface PushNotificationMessage {
13
18
  apnsOptions?: ApnsPlatformOptions;
14
19
  data?: Record<string, unknown>;
15
20
  }
16
- export declare type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
21
+ export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
17
22
  interface ApnsPlatformOptions {
18
23
  subtitle?: string;
19
24
  }
@@ -2,4 +2,3 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=module.js.map
@@ -18,14 +18,14 @@ export interface PushNotificationNativeModule extends NativeModule {
18
18
  getPermissionStatus: () => Promise<NativePermissionStatus>;
19
19
  requestPermissions: (permissions: PushNotificationPermissions) => Promise<boolean>;
20
20
  }
21
- export declare type NativeAction = {
21
+ export type NativeAction = {
22
22
  deeplink?: string;
23
23
  url?: string;
24
24
  };
25
- export declare type NativeMessage = (ApnsMessage | FcmMessage) & {
25
+ export type NativeMessage = (ApnsMessage | FcmMessage) & {
26
26
  token?: never;
27
27
  };
28
- export declare type NativePermissionStatus = AndroidPermissionStatus | IosPermissionStatus;
28
+ export type NativePermissionStatus = AndroidPermissionStatus | IosPermissionStatus;
29
29
  export interface NormalizedValues {
30
30
  body?: string;
31
31
  imageUrl?: string;
@@ -34,7 +34,7 @@ export interface NormalizedValues {
34
34
  options?: Pick<PushNotificationMessage, 'apnsOptions' | 'fcmOptions'>;
35
35
  data?: Record<string, unknown>;
36
36
  }
37
- export declare type ApnsMessage = {
37
+ export type ApnsMessage = {
38
38
  aps: {
39
39
  alert?: {
40
40
  body?: string;
@@ -49,8 +49,8 @@ export declare type ApnsMessage = {
49
49
  rawData?: never;
50
50
  completionHandlerId?: string;
51
51
  };
52
- export declare type IosPermissionStatus = 'NotDetermined' | 'Authorized' | 'Denied';
53
- export declare type FcmMessage = {
52
+ export type IosPermissionStatus = 'NotDetermined' | 'Authorized' | 'Denied';
53
+ export type FcmMessage = {
54
54
  action?: NativeAction;
55
55
  aps?: never;
56
56
  body?: string;
@@ -60,10 +60,10 @@ export declare type FcmMessage = {
60
60
  channelId?: string;
61
61
  messageId?: string;
62
62
  senderId?: string;
63
- sendTime?: string;
63
+ sendTime?: number;
64
64
  completionHandlerId?: never;
65
65
  };
66
- export declare type AndroidPermissionStatus = 'ShouldRequest' | 'ShouldExplainThenRequest' | 'Granted' | 'Denied';
67
- export declare type TokenPayload = {
66
+ export type AndroidPermissionStatus = 'ShouldRequest' | 'ShouldExplainThenRequest' | 'Granted' | 'Denied';
67
+ export type TokenPayload = {
68
68
  token: string;
69
69
  };
@@ -2,4 +2,3 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=native.js.map
@@ -2,8 +2,8 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.normalizeNativePermissionStatus = exports.normalizeNativeMessage = void 0;
5
6
  var normalizeNativeMessage_1 = require("./normalizeNativeMessage");
6
- exports.normalizeNativeMessage = normalizeNativeMessage_1.normalizeNativeMessage;
7
+ Object.defineProperty(exports, "normalizeNativeMessage", { enumerable: true, get: function () { return normalizeNativeMessage_1.normalizeNativeMessage; } });
7
8
  var normalizeNativePermissionStatus_1 = require("./normalizeNativePermissionStatus");
8
- exports.normalizeNativePermissionStatus = normalizeNativePermissionStatus_1.normalizeNativePermissionStatus;
9
- //# sourceMappingURL=index.js.map
9
+ Object.defineProperty(exports, "normalizeNativePermissionStatus", { enumerable: true, get: function () { return normalizeNativePermissionStatus_1.normalizeNativePermissionStatus; } });
@@ -1,9 +1,5 @@
1
- import { ApnsMessage, FcmMessage, PushNotificationMessage } from '../types';
1
+ import { NativeMessage, PushNotificationMessage } from '../types';
2
2
  /**
3
3
  * @internal
4
4
  */
5
- export declare const normalizeNativeMessage: (nativeMessage?: (ApnsMessage & {
6
- token?: undefined;
7
- }) | (FcmMessage & {
8
- token?: undefined;
9
- }) | undefined) => PushNotificationMessage | null;
5
+ export declare const normalizeNativeMessage: (nativeMessage?: NativeMessage) => PushNotificationMessage | null;
@@ -2,11 +2,12 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.normalizeNativeMessage = void 0;
5
6
  const lodash_1 = require("lodash");
6
7
  /**
7
8
  * @internal
8
9
  */
9
- exports.normalizeNativeMessage = (nativeMessage) => {
10
+ const normalizeNativeMessage = (nativeMessage) => {
10
11
  let normalized;
11
12
  if (isApnsMessage(nativeMessage)) {
12
13
  normalized = normalizeApnsMessage(nativeMessage);
@@ -27,6 +28,7 @@ exports.normalizeNativeMessage = (nativeMessage) => {
27
28
  ...options,
28
29
  };
29
30
  };
31
+ exports.normalizeNativeMessage = normalizeNativeMessage;
30
32
  const normalizeApnsMessage = (apnsMessage) => {
31
33
  const { aps, data } = apnsMessage;
32
34
  const { body, title } = aps.alert ?? {};
@@ -57,17 +59,16 @@ const getFcmAction = (action) => {
57
59
  const getApnsOptions = ({ aps, }) => {
58
60
  const { subtitle } = aps.alert ?? {};
59
61
  const apnsOptions = { ...(subtitle && { subtitle }) };
60
- return { ...(!lodash_1.isEmpty(apnsOptions) && { apnsOptions }) };
62
+ return { ...(!(0, lodash_1.isEmpty)(apnsOptions) && { apnsOptions }) };
61
63
  };
62
- const getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime = '', }) => {
64
+ const getFcmOptions = ({ channelId = '', messageId = '', senderId = '', sendTime = new Date().getTime(), }) => {
63
65
  const fcmOptions = {
64
66
  channelId,
65
67
  messageId,
66
68
  senderId,
67
69
  sendTime: new Date(sendTime),
68
70
  };
69
- return { ...(!lodash_1.isEmpty(fcmOptions) && { fcmOptions }) };
71
+ return { ...(!(0, lodash_1.isEmpty)(fcmOptions) && { fcmOptions }) };
70
72
  };
71
73
  const isApnsMessage = (nativeMessage) => !!nativeMessage?.aps;
72
74
  const isFcmMessage = (nativeMessage) => !!nativeMessage?.rawData;
73
- //# sourceMappingURL=normalizeNativeMessage.js.map
@@ -2,10 +2,11 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.normalizeNativePermissionStatus = void 0;
5
6
  /**
6
7
  * @internal
7
8
  */
8
- exports.normalizeNativePermissionStatus = (nativeStatus) => {
9
+ const normalizeNativePermissionStatus = (nativeStatus) => {
9
10
  switch (nativeStatus) {
10
11
  case 'ShouldRequest':
11
12
  return 'shouldRequest';
@@ -19,4 +20,4 @@ exports.normalizeNativePermissionStatus = (nativeStatus) => {
19
20
  return 'denied';
20
21
  }
21
22
  };
22
- //# sourceMappingURL=normalizeNativePermissionStatus.js.map
23
+ exports.normalizeNativePermissionStatus = normalizeNativePermissionStatus;
@@ -1,3 +1,3 @@
1
1
  import { EmitterSubscription } from 'react-native';
2
2
  import { PushNotificationMessage } from '../types';
3
- export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string | undefined) => void) => EmitterSubscription;
3
+ export declare const addMessageEventListener: (event: string, listener: (message: PushNotificationMessage | null, completionHandlerId?: string) => void) => EmitterSubscription;
@@ -5,4 +5,3 @@ import { normalizeNativeMessage } from '../utils';
5
5
  export const addMessageEventListener = (event, listener) => nativeEventEmitter.addListener(event, (nativeMessage) => {
6
6
  listener(normalizeNativeMessage(nativeMessage), nativeMessage.completionHandlerId);
7
7
  });
8
- //# sourceMappingURL=addMessageEventListener.js.map
@@ -4,4 +4,3 @@ import { nativeEventEmitter } from '../nativeModule';
4
4
  export const addTokenEventListener = (event, listener) => nativeEventEmitter.addListener(event, ({ token }) => {
5
5
  listener(token);
6
6
  });
7
- //# sourceMappingURL=addTokenEventListener.js.map
@@ -2,4 +2,3 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { nativeModule } from '../nativeModule';
4
4
  export const completeNotification = (completionHandlerId) => nativeModule.completeNotification?.(completionHandlerId);
5
- //# sourceMappingURL=completeNotification.js.map
@@ -2,4 +2,3 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { nativeModule } from '../nativeModule';
4
4
  export const getBadgeCount = () => nativeModule.getBadgeCount?.();
5
- //# sourceMappingURL=getBadgeCount.js.map
@@ -2,4 +2,3 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { nativeModule } from '../nativeModule';
4
4
  export const getConstants = () => nativeModule.getConstants();
5
- //# sourceMappingURL=getConstants.js.map