@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.
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +4 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +8 -10
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
- package/lib/pushNotifications/errors/errorHelpers.d.ts +1 -0
- package/lib/pushNotifications/errors/errorHelpers.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +7 -3
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +8 -4
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +8 -7
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +3 -4
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +0 -4
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +0 -10
- package/lib/pushNotifications/utils/index.d.ts +4 -0
- package/lib/pushNotifications/utils/index.js +14 -0
- package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.js +1 -1
- package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.js +1 -1
- package/lib/tsconfig.build.tsbuildinfo +330 -425
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +3 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +1 -1
- package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +1 -0
- package/lib-esm/pushNotifications/errors/errorHelpers.js +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +7 -3
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +6 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +0 -4
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +0 -4
- package/lib-esm/pushNotifications/utils/index.d.ts +4 -0
- package/lib-esm/pushNotifications/utils/index.js +6 -0
- package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.js +1 -1
- package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.js +1 -1
- package/lib-esm/tsconfig.build.tsbuildinfo +228 -233
- package/package.json +4 -4
- package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +4 -4
- package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +3 -4
- package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +1 -3
- package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +1 -1
- package/src/pushNotifications/errors/errorHelpers.ts +5 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +5 -1
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +4 -6
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +5 -3
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +5 -1
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +5 -1
- package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +5 -1
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +1 -2
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +0 -4
- package/src/pushNotifications/utils/index.ts +7 -0
- package/src/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.ts +1 -1
- package/src/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.ts +1 -1
- package/lib/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
- package/lib/inAppMessaging/sessionTracker/SessionTracker.js +0 -67
- package/lib/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
- package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -52
- package/lib/inAppMessaging/sessionTracker/index.d.ts +0 -3
- package/lib/inAppMessaging/sessionTracker/index.js +0 -7
- package/lib/inAppMessaging/sessionTracker/types.d.ts +0 -6
- package/lib/inAppMessaging/sessionTracker/types.js +0 -4
- package/lib/pushNotifications/Platform/index.d.ts +0 -2
- package/lib/pushNotifications/Platform/index.js +0 -25
- package/lib/pushNotifications/Platform/index.native.d.ts +0 -2
- package/lib/pushNotifications/Platform/index.native.js +0 -7
- package/lib/pushNotifications/Platform/types.d.ts +0 -5
- package/lib/pushNotifications/Platform/types.js +0 -4
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.d.ts +0 -9
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js +0 -64
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.d.ts +0 -10
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js +0 -49
- package/lib-esm/inAppMessaging/sessionTracker/index.d.ts +0 -3
- package/lib-esm/inAppMessaging/sessionTracker/index.js +0 -4
- package/lib-esm/inAppMessaging/sessionTracker/types.d.ts +0 -6
- package/lib-esm/inAppMessaging/sessionTracker/types.js +0 -2
- package/lib-esm/pushNotifications/Platform/index.d.ts +0 -2
- package/lib-esm/pushNotifications/Platform/index.js +0 -23
- package/lib-esm/pushNotifications/Platform/index.native.d.ts +0 -2
- package/lib-esm/pushNotifications/Platform/index.native.js +0 -5
- package/lib-esm/pushNotifications/Platform/types.d.ts +0 -5
- package/lib-esm/pushNotifications/Platform/types.js +0 -2
- package/src/inAppMessaging/sessionTracker/SessionTracker.native.ts +0 -60
- package/src/inAppMessaging/sessionTracker/SessionTracker.ts +0 -78
- package/src/inAppMessaging/sessionTracker/index.ts +0 -6
- package/src/inAppMessaging/sessionTracker/types.ts +0 -11
- package/src/pushNotifications/Platform/index.native.ts +0 -9
- package/src/pushNotifications/Platform/index.ts +0 -22
- package/src/pushNotifications/Platform/types.ts +0 -15
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.js +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.js +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.js +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveConfig.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.js +0 -0
- /package/src/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.ts +0 -0
- /package/src/pushNotifications/{providers/pinpoint/utils → utils}/tokenManager.ts +0 -0
|
@@ -47,10 +47,10 @@ import { assertIsInitialized } from '../../../utils';
|
|
|
47
47
|
* },
|
|
48
48
|
* options: {
|
|
49
49
|
* address: 'device-address',
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
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
|
|
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
|
-
//
|
|
27
|
-
|
|
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
|
|
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 '
|
|
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>;
|
|
@@ -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 () {
|
|
7
|
-
return
|
|
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 {
|
|
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:
|
|
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;
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
|
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 '
|
|
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,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 '
|
|
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 '
|
|
5
|
+
import { assert, PushNotificationValidationErrorCode } from '../errors';
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|