@aws-amplify/notifications 2.0.1-console-preview.8d88eef.0 → 2.0.1-console-preview.be08038.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 (122) hide show
  1. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -4
  2. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +4 -4
  3. package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +8 -10
  4. package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
  5. package/lib/pushNotifications/errors/errorHelpers.d.ts +1 -0
  6. package/lib/pushNotifications/errors/errorHelpers.js +4 -0
  7. package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +7 -3
  8. package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -0
  9. package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -0
  10. package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +8 -4
  11. package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +8 -7
  12. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +2 -0
  13. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -1
  14. package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -1
  15. package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +2 -0
  16. package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -0
  17. package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -1
  18. package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +3 -4
  19. package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +0 -4
  20. package/lib/pushNotifications/providers/pinpoint/utils/index.js +0 -10
  21. package/lib/pushNotifications/utils/index.d.ts +4 -0
  22. package/lib/pushNotifications/utils/index.js +14 -0
  23. package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.js +1 -1
  24. package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.js +1 -1
  25. package/lib/tsconfig.build.tsbuildinfo +330 -425
  26. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -4
  27. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +4 -4
  28. package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +3 -4
  29. package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +1 -1
  30. package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
  31. package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +1 -0
  32. package/lib-esm/pushNotifications/errors/errorHelpers.js +4 -0
  33. package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +7 -3
  34. package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -0
  35. package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -0
  36. package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +6 -2
  37. package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +2 -1
  38. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +2 -0
  39. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -1
  40. package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -1
  41. package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +2 -0
  42. package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -0
  43. package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -1
  44. package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +1 -2
  45. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +0 -4
  46. package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +0 -4
  47. package/lib-esm/pushNotifications/utils/index.d.ts +4 -0
  48. package/lib-esm/pushNotifications/utils/index.js +6 -0
  49. package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.js +1 -1
  50. package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.js +1 -1
  51. package/lib-esm/tsconfig.build.tsbuildinfo +228 -233
  52. package/package.json +4 -4
  53. package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +4 -4
  54. package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +3 -4
  55. package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +1 -3
  56. package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +1 -1
  57. package/src/pushNotifications/errors/errorHelpers.ts +5 -0
  58. package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +5 -1
  59. package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +5 -2
  60. package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +5 -2
  61. package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +4 -6
  62. package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +5 -3
  63. package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +5 -2
  64. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +5 -1
  65. package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +5 -1
  66. package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +5 -2
  67. package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +5 -2
  68. package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +5 -1
  69. package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +1 -2
  70. package/src/pushNotifications/providers/pinpoint/utils/index.ts +0 -4
  71. package/src/pushNotifications/utils/index.ts +7 -0
  72. package/src/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.ts +1 -1
  73. package/src/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.ts +1 -1
  74. package/lib/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
  75. package/lib/inAppMessaging/sessionTracker/SessionTracker.js +0 -67
  76. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
  77. package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -52
  78. package/lib/inAppMessaging/sessionTracker/index.d.ts +0 -3
  79. package/lib/inAppMessaging/sessionTracker/index.js +0 -7
  80. package/lib/inAppMessaging/sessionTracker/types.d.ts +0 -6
  81. package/lib/inAppMessaging/sessionTracker/types.js +0 -4
  82. package/lib/pushNotifications/Platform/index.d.ts +0 -2
  83. package/lib/pushNotifications/Platform/index.js +0 -25
  84. package/lib/pushNotifications/Platform/index.native.d.ts +0 -2
  85. package/lib/pushNotifications/Platform/index.native.js +0 -7
  86. package/lib/pushNotifications/Platform/types.d.ts +0 -5
  87. package/lib/pushNotifications/Platform/types.js +0 -4
  88. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
  89. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js +0 -64
  90. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
  91. package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -49
  92. package/lib-esm/inAppMessaging/sessionTracker/index.d.ts +0 -3
  93. package/lib-esm/inAppMessaging/sessionTracker/index.js +0 -4
  94. package/lib-esm/inAppMessaging/sessionTracker/types.d.ts +0 -6
  95. package/lib-esm/inAppMessaging/sessionTracker/types.js +0 -2
  96. package/lib-esm/pushNotifications/Platform/index.d.ts +0 -2
  97. package/lib-esm/pushNotifications/Platform/index.js +0 -23
  98. package/lib-esm/pushNotifications/Platform/index.native.d.ts +0 -2
  99. package/lib-esm/pushNotifications/Platform/index.native.js +0 -5
  100. package/lib-esm/pushNotifications/Platform/types.d.ts +0 -5
  101. package/lib-esm/pushNotifications/Platform/types.js +0 -2
  102. package/src/inAppMessaging/sessionTracker/SessionTracker.native.ts +0 -60
  103. package/src/inAppMessaging/sessionTracker/SessionTracker.ts +0 -78
  104. package/src/inAppMessaging/sessionTracker/index.ts +0 -6
  105. package/src/inAppMessaging/sessionTracker/types.ts +0 -11
  106. package/src/pushNotifications/Platform/index.native.ts +0 -9
  107. package/src/pushNotifications/Platform/index.ts +0 -22
  108. package/src/pushNotifications/Platform/types.ts +0 -15
  109. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts +0 -0
  110. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.js +0 -0
  111. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.d.ts +0 -0
  112. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.d.ts +0 -0
  113. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.d.ts +0 -0
  114. /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.js +0 -0
  115. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts +0 -0
  116. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.js +0 -0
  117. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.d.ts +0 -0
  118. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.d.ts +0 -0
  119. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.d.ts +0 -0
  120. /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.js +0 -0
  121. /package/src/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.ts +0 -0
  122. /package/src/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.ts +0 -0
@@ -40,10 +40,10 @@
40
40
  * },
41
41
  * options: {
42
42
  * address: 'device-address',
43
- * optOut: 'NONE',
44
- * userAttributes: {
45
- * interests: ['food']
46
- * },
43
+ * optOut: 'NONE',
44
+ * userAttributes: {
45
+ * interests: ['food']
46
+ * },
47
47
  * },
48
48
  * });
49
49
  */
@@ -47,10 +47,10 @@ import { assertIsInitialized } from '../../../utils';
47
47
  * },
48
48
  * options: {
49
49
  * address: 'device-address',
50
- * optOut: 'NONE',
51
- * userAttributes: {
52
- * interests: ['food']
53
- * },
50
+ * optOut: 'NONE',
51
+ * userAttributes: {
52
+ * interests: ['food']
53
+ * },
54
54
  * },
55
55
  * });
56
56
  */
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import SessionTracker from '../../../sessionTracker';
3
+ import { sessionListener } from '@aws-amplify/core/internals/utils';
4
4
  import { addEventListener } from '../../../../eventListeners';
5
5
  import { recordAnalyticsEvent } from '../utils/helpers';
6
6
  import { PinpointMessageEvent } from '../types';
@@ -23,9 +23,8 @@ export function initializeInAppMessaging() {
23
23
  if (isInitialized()) {
24
24
  return;
25
25
  }
26
- // set up the session tracker and start it
27
- var sessionTracker = new SessionTracker(sessionStateChangeHandler);
28
- sessionTracker.start();
26
+ // register with the session listener
27
+ sessionListener.addStateChangeListener(sessionStateChangeHandler, true);
29
28
  // wire up default Pinpoint message event handling
30
29
  addEventListener('messageDisplayed', function (message) {
31
30
  recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_DISPLAYED, message);
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __read } from "tslib";
4
4
  import { ConsoleLogger } from '@aws-amplify/core';
5
- import { InAppMessagingAction, } from '@aws-amplify/core/internals/utils';
5
+ import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
6
6
  import isEmpty from 'lodash/isEmpty';
7
7
  import { record as recordCore } from '@aws-amplify/core/internals/providers/pinpoint';
8
8
  import { resolveConfig } from './resolveConfig';
@@ -1,6 +1,6 @@
1
1
  import { InAppMessage, InAppMessagingEvent } from '../../../types';
2
2
  import type { InAppMessageCampaign as PinpointInAppMessage } from '@aws-amplify/core/internals/aws-clients/pinpoint';
3
- import { SessionState } from '../../../sessionTracker';
3
+ import { SessionState } from '@aws-amplify/core/internals/utils';
4
4
  export declare function processInAppMessages(messages: PinpointInAppMessage[], event: InAppMessagingEvent): Promise<InAppMessage[]>;
5
5
  export declare function sessionStateChangeHandler(state: SessionState): void;
6
6
  export declare function incrementMessageCounts(messageId: string): Promise<void>;
@@ -6,3 +6,4 @@ export declare enum PushNotificationValidationErrorCode {
6
6
  NotInitialized = "NotInitialized"
7
7
  }
8
8
  export declare const assert: AssertionFunction<PushNotificationValidationErrorCode>;
9
+ export declare const assertIsInitialized: () => void;
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  var _a;
4
4
  import { createAssertionFunction, } from '@aws-amplify/core/internals/utils';
5
+ import { isInitialized } from '../utils';
5
6
  import { PushNotificationError } from './PushNotificationError';
6
7
  export var PushNotificationValidationErrorCode;
7
8
  (function (PushNotificationValidationErrorCode) {
@@ -26,3 +27,6 @@ var pushNotificationValidationErrorMap = (_a = {},
26
27
  },
27
28
  _a);
28
29
  export var assert = createAssertionFunction(pushNotificationValidationErrorMap, PushNotificationError);
30
+ export var assertIsInitialized = function () {
31
+ assert(isInitialized(), PushNotificationValidationErrorCode.NotInitialized);
32
+ };
@@ -2,7 +2,11 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __awaiter, __generator } from "tslib";
4
4
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
5
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
6
  var getBadgeCountNative = loadAmplifyPushNotification().getBadgeCount;
6
- export var getBadgeCount = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
7
- return [2 /*return*/, getBadgeCountNative()];
8
- }); }); };
7
+ export var getBadgeCount = function () { return __awaiter(void 0, void 0, void 0, function () {
8
+ return __generator(this, function (_a) {
9
+ assertIsInitialized();
10
+ return [2 /*return*/, getBadgeCountNative()];
11
+ });
12
+ }); };
@@ -1,7 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  var getLaunchNotificationNative = loadAmplifyPushNotification().getLaunchNotification;
5
6
  export var getLaunchNotification = function () {
7
+ assertIsInitialized();
6
8
  return getLaunchNotificationNative();
7
9
  };
@@ -1,7 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  var getPermissionStatusNative = loadAmplifyPushNotification().getPermissionStatus;
5
6
  export var getPermissionStatus = function () {
7
+ assertIsInitialized();
6
8
  return getPermissionStatusNative();
7
9
  };
@@ -3,14 +3,18 @@
3
3
  import { __awaiter, __generator } from "tslib";
4
4
  import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
5
5
  import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
6
- import { getChannelType, getPushNotificationUserAgentString, resolveConfig, resolveCredentials, } from '../utils';
6
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
7
+ import { resolveConfig, resolveCredentials } from '../../../utils';
8
+ import { getChannelType, getPushNotificationUserAgentString } from '../utils';
7
9
  export var identifyUser = function (_a) {
8
10
  var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
9
11
  return __awaiter(void 0, void 0, void 0, function () {
10
12
  var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
11
13
  return __generator(this, function (_e) {
12
14
  switch (_e.label) {
13
- case 0: return [4 /*yield*/, resolveCredentials()];
15
+ case 0:
16
+ assertIsInitialized();
17
+ return [4 /*yield*/, resolveCredentials()];
14
18
  case 1:
15
19
  _b = _e.sent(), credentials = _b.credentials, identityId = _b.identityId;
16
20
  _c = resolveConfig(), appId = _c.appId, region = _c.region;
@@ -6,7 +6,8 @@ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
6
6
  import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
7
7
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
8
8
  import { addEventListener, notifyEventListeners, notifyEventListenersAndAwaitHandlers, } from '../../../../eventListeners';
9
- import { createMessageEventRecorder, getChannelType, getPushNotificationUserAgentString, getToken, initialize, isInitialized, resolveConfig, resolveCredentials, setToken, } from '../utils';
9
+ import { getToken, initialize, isInitialized, resolveConfig, resolveCredentials, setToken, } from '../../../utils';
10
+ import { createMessageEventRecorder, getChannelType, getPushNotificationUserAgentString, } from '../utils';
10
11
  var _a = loadAmplifyPushNotification(), addMessageEventListener = _a.addMessageEventListener, addTokenEventListener = _a.addTokenEventListener, completeNotification = _a.completeNotification, getConstants = _a.getConstants, registerHeadlessTask = _a.registerHeadlessTask;
11
12
  var logger = new ConsoleLogger('Notifications.PushNotification');
12
13
  var BACKGROUND_TASK_TIMEOUT = 25; // seconds
@@ -1,6 +1,8 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { addEventListener } from '../../../../eventListeners';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  export var onNotificationOpened = function (input) {
6
+ assertIsInitialized();
5
7
  return addEventListener('notificationOpened', input);
6
8
  };
@@ -1,4 +1,8 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { addEventListener } from '../../../../eventListeners';
4
- export var onNotificationReceivedInBackground = function (input) { return addEventListener('backgroundMessageReceived', input); };
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
+ export var onNotificationReceivedInBackground = function (input) {
6
+ assertIsInitialized();
7
+ return addEventListener('backgroundMessageReceived', input);
8
+ };
@@ -1,4 +1,8 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { addEventListener } from '../../../../eventListeners';
4
- export var onNotificationReceivedInForeground = function (input) { return addEventListener('foregroundMessageReceived', input); };
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
5
+ export var onNotificationReceivedInForeground = function (input) {
6
+ assertIsInitialized();
7
+ return addEventListener('foregroundMessageReceived', input);
8
+ };
@@ -1,6 +1,8 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { addEventListener } from '../../../../eventListeners';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  export var onTokenReceived = function (input) {
6
+ assertIsInitialized();
5
7
  return addEventListener('tokenReceived', input);
6
8
  };
@@ -1,7 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  var requestPermissionsNative = loadAmplifyPushNotification().requestPermissions;
5
6
  export var requestPermissions = function (input) {
7
+ assertIsInitialized();
6
8
  return requestPermissionsNative(input);
7
9
  };
@@ -1,5 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
4
+ import { assertIsInitialized } from '../../../errors/errorHelpers';
4
5
  var setBadgeCountNative = loadAmplifyPushNotification().setBadgeCount;
5
- export var setBadgeCount = function (input) { return setBadgeCountNative(input); };
6
+ export var setBadgeCount = function (input) {
7
+ assertIsInitialized();
8
+ setBadgeCountNative(input);
9
+ };
@@ -5,8 +5,7 @@ import { record } from '@aws-amplify/core/internals/providers/pinpoint';
5
5
  import { ConsoleLogger } from '@aws-amplify/core';
6
6
  import { getAnalyticsEvent } from './getAnalyticsEvent';
7
7
  import { getChannelType } from './getChannelType';
8
- import { resolveCredentials } from './resolveCredentials';
9
- import { resolveConfig } from './resolveConfig';
8
+ import { resolveConfig, resolveCredentials } from '../../../utils';
10
9
  var logger = new ConsoleLogger('PushNotification.recordMessageEvent');
11
10
  /**
12
11
  * @internal
@@ -1,7 +1,3 @@
1
1
  export { createMessageEventRecorder } from './createMessageEventRecorder';
2
2
  export { getChannelType } from './getChannelType';
3
3
  export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
4
- export { initialize, isInitialized } from './initializationManager';
5
- export { resolveConfig } from './resolveConfig';
6
- export { resolveCredentials } from './resolveCredentials';
7
- export { getToken, setToken } from './tokenManager';
@@ -3,7 +3,3 @@
3
3
  export { createMessageEventRecorder } from './createMessageEventRecorder';
4
4
  export { getChannelType } from './getChannelType';
5
5
  export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
6
- export { initialize, isInitialized } from './initializationManager';
7
- export { resolveConfig } from './resolveConfig';
8
- export { resolveCredentials } from './resolveCredentials';
9
- export { getToken, setToken } from './tokenManager';
@@ -0,0 +1,4 @@
1
+ export { initialize, isInitialized } from './initializationManager';
2
+ export { resolveConfig } from './resolveConfig';
3
+ export { resolveCredentials } from './resolveCredentials';
4
+ export { getToken, setToken } from './tokenManager';
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { initialize, isInitialized } from './initializationManager';
4
+ export { resolveConfig } from './resolveConfig';
5
+ export { resolveCredentials } from './resolveCredentials';
6
+ export { getToken, setToken } from './tokenManager';
@@ -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
  import { Amplify } from '@aws-amplify/core';
4
- import { assert, PushNotificationValidationErrorCode } from '../../../errors';
4
+ import { assert, PushNotificationValidationErrorCode } from '../errors';
5
5
  /**
6
6
  * @internal
7
7
  */
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __awaiter, __generator } from "tslib";
4
4
  import { fetchAuthSession } from '@aws-amplify/core';
5
- import { assert, PushNotificationValidationErrorCode } from '../../../errors';
5
+ import { assert, PushNotificationValidationErrorCode } from '../errors';
6
6
  /**
7
7
  * @internal
8
8
  */