@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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SessionState, SessionStateChangeHandler, SessionTrackerInterface } from './types';
|
|
2
|
-
export default class SessionTracker implements SessionTrackerInterface {
|
|
3
|
-
private currentAppState;
|
|
4
|
-
private sessionStateChangeHandler;
|
|
5
|
-
constructor(sessionStateChangeHandler?: SessionStateChangeHandler);
|
|
6
|
-
start: () => SessionState;
|
|
7
|
-
end: () => SessionState;
|
|
8
|
-
private getSessionState;
|
|
9
|
-
private appStateChangeHandler;
|
|
10
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { ConsoleLogger } from '@aws-amplify/core';
|
|
4
|
-
import { AppState } from 'react-native';
|
|
5
|
-
import noop from 'lodash/noop';
|
|
6
|
-
var isActive = function (appState) { return appState === 'active'; };
|
|
7
|
-
var isInactive = function (appState) {
|
|
8
|
-
return appState === 'inactive' || appState === 'background';
|
|
9
|
-
};
|
|
10
|
-
var logger = new ConsoleLogger('InAppMessagingSessionTracker');
|
|
11
|
-
var SessionTracker = /** @class */ (function () {
|
|
12
|
-
function SessionTracker(sessionStateChangeHandler) {
|
|
13
|
-
var _this = this;
|
|
14
|
-
if (sessionStateChangeHandler === void 0) { sessionStateChangeHandler = noop; }
|
|
15
|
-
this.start = function () {
|
|
16
|
-
AppState.addEventListener('change', _this.appStateChangeHandler);
|
|
17
|
-
return _this.getSessionState();
|
|
18
|
-
};
|
|
19
|
-
this.end = function () {
|
|
20
|
-
AppState.removeEventListener('change', _this.appStateChangeHandler);
|
|
21
|
-
return _this.getSessionState();
|
|
22
|
-
};
|
|
23
|
-
this.getSessionState = function () {
|
|
24
|
-
if (isActive(_this.currentAppState)) {
|
|
25
|
-
return 'started';
|
|
26
|
-
}
|
|
27
|
-
// consider any other app state as session ended
|
|
28
|
-
return 'ended';
|
|
29
|
-
};
|
|
30
|
-
this.appStateChangeHandler = function (nextAppState) {
|
|
31
|
-
// if going from active to inactive
|
|
32
|
-
if (isActive(_this.currentAppState) && isInactive(nextAppState)) {
|
|
33
|
-
logger.debug('App has gone to the background');
|
|
34
|
-
_this.sessionStateChangeHandler('ended');
|
|
35
|
-
}
|
|
36
|
-
// if going from inactive to active
|
|
37
|
-
if (isInactive(_this.currentAppState) && isActive(nextAppState)) {
|
|
38
|
-
logger.debug('App has come to the foreground');
|
|
39
|
-
_this.sessionStateChangeHandler('started');
|
|
40
|
-
}
|
|
41
|
-
// otherwise do nothing but always update current state
|
|
42
|
-
_this.currentAppState = nextAppState;
|
|
43
|
-
};
|
|
44
|
-
this.currentAppState = 'active';
|
|
45
|
-
this.sessionStateChangeHandler = sessionStateChangeHandler;
|
|
46
|
-
}
|
|
47
|
-
return SessionTracker;
|
|
48
|
-
}());
|
|
49
|
-
export default SessionTracker;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
var userAgentIncludes = function (text) {
|
|
4
|
-
var _a;
|
|
5
|
-
return (_a = navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes(text);
|
|
6
|
-
};
|
|
7
|
-
var getOS = function () {
|
|
8
|
-
if (userAgentIncludes('Android'))
|
|
9
|
-
return 'android';
|
|
10
|
-
if (userAgentIncludes('like Mac'))
|
|
11
|
-
return 'ios';
|
|
12
|
-
if (userAgentIncludes('Win'))
|
|
13
|
-
return 'windows';
|
|
14
|
-
if (userAgentIncludes('Mac'))
|
|
15
|
-
return 'macos';
|
|
16
|
-
if (userAgentIncludes('Linux'))
|
|
17
|
-
return 'linux';
|
|
18
|
-
if (userAgentIncludes('X11'))
|
|
19
|
-
return 'unix';
|
|
20
|
-
return 'unknown';
|
|
21
|
-
};
|
|
22
|
-
var OS = getOS();
|
|
23
|
-
export var Platform = { OS: OS };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
-
import { AppState, AppStateStatus } from 'react-native';
|
|
6
|
-
import noop from 'lodash/noop';
|
|
7
|
-
import {
|
|
8
|
-
SessionState,
|
|
9
|
-
SessionStateChangeHandler,
|
|
10
|
-
SessionTrackerInterface,
|
|
11
|
-
} from './types';
|
|
12
|
-
|
|
13
|
-
const isActive = appState => appState === 'active';
|
|
14
|
-
const isInactive = appState =>
|
|
15
|
-
appState === 'inactive' || appState === 'background';
|
|
16
|
-
|
|
17
|
-
const logger = new ConsoleLogger('InAppMessagingSessionTracker');
|
|
18
|
-
|
|
19
|
-
export default class SessionTracker implements SessionTrackerInterface {
|
|
20
|
-
private currentAppState: AppStateStatus;
|
|
21
|
-
private sessionStateChangeHandler: SessionStateChangeHandler;
|
|
22
|
-
|
|
23
|
-
constructor(sessionStateChangeHandler: SessionStateChangeHandler = noop) {
|
|
24
|
-
this.currentAppState = 'active';
|
|
25
|
-
this.sessionStateChangeHandler = sessionStateChangeHandler;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
start = (): SessionState => {
|
|
29
|
-
AppState.addEventListener('change', this.appStateChangeHandler);
|
|
30
|
-
return this.getSessionState();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
end = (): SessionState => {
|
|
34
|
-
AppState.removeEventListener('change', this.appStateChangeHandler);
|
|
35
|
-
return this.getSessionState();
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
private getSessionState = (): SessionState => {
|
|
39
|
-
if (isActive(this.currentAppState)) {
|
|
40
|
-
return 'started';
|
|
41
|
-
}
|
|
42
|
-
// consider any other app state as session ended
|
|
43
|
-
return 'ended';
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
private appStateChangeHandler = nextAppState => {
|
|
47
|
-
// if going from active to inactive
|
|
48
|
-
if (isActive(this.currentAppState) && isInactive(nextAppState)) {
|
|
49
|
-
logger.debug('App has gone to the background');
|
|
50
|
-
this.sessionStateChangeHandler('ended');
|
|
51
|
-
}
|
|
52
|
-
// if going from inactive to active
|
|
53
|
-
if (isInactive(this.currentAppState) && isActive(nextAppState)) {
|
|
54
|
-
logger.debug('App has come to the foreground');
|
|
55
|
-
this.sessionStateChangeHandler('started');
|
|
56
|
-
}
|
|
57
|
-
// otherwise do nothing but always update current state
|
|
58
|
-
this.currentAppState = nextAppState;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { isBrowser } from '@aws-amplify/core/internals/utils';
|
|
4
|
-
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
-
import noop from 'lodash/noop';
|
|
6
|
-
import {
|
|
7
|
-
SessionState,
|
|
8
|
-
SessionStateChangeHandler,
|
|
9
|
-
SessionTrackerInterface,
|
|
10
|
-
} from './types';
|
|
11
|
-
|
|
12
|
-
// Per https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
|
|
13
|
-
let hidden: string;
|
|
14
|
-
let visibilityChange: string;
|
|
15
|
-
|
|
16
|
-
if (isBrowser() && document) {
|
|
17
|
-
if (typeof document.hidden !== 'undefined') {
|
|
18
|
-
hidden = 'hidden';
|
|
19
|
-
visibilityChange = 'visibilitychange';
|
|
20
|
-
} else if (typeof document['msHidden'] !== 'undefined') {
|
|
21
|
-
hidden = 'msHidden';
|
|
22
|
-
visibilityChange = 'msvisibilitychange';
|
|
23
|
-
} else if (typeof document['webkitHidden'] !== 'undefined') {
|
|
24
|
-
hidden = 'webkitHidden';
|
|
25
|
-
visibilityChange = 'webkitvisibilitychange';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const logger = new ConsoleLogger('InAppMessagingSessionTracker');
|
|
30
|
-
|
|
31
|
-
export default class SessionTracker implements SessionTrackerInterface {
|
|
32
|
-
private sessionStateChangeHandler: SessionStateChangeHandler;
|
|
33
|
-
|
|
34
|
-
constructor(sessionStateChangeHandler: SessionStateChangeHandler = noop) {
|
|
35
|
-
this.sessionStateChangeHandler = sessionStateChangeHandler;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
start = (): SessionState => {
|
|
39
|
-
if (isBrowser()) {
|
|
40
|
-
document?.addEventListener(
|
|
41
|
-
visibilityChange,
|
|
42
|
-
this.visibilityChangeHandler
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
return this.getSessionState();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
end = (): SessionState => {
|
|
49
|
-
if (isBrowser()) {
|
|
50
|
-
document?.removeEventListener(
|
|
51
|
-
visibilityChange,
|
|
52
|
-
this.visibilityChangeHandler
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return this.getSessionState();
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
private getSessionState = (): SessionState => {
|
|
59
|
-
if (isBrowser() && document && !document[hidden]) {
|
|
60
|
-
return 'started';
|
|
61
|
-
}
|
|
62
|
-
// If, for any reason, document is undefined the session will never start
|
|
63
|
-
return 'ended';
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
private visibilityChangeHandler = () => {
|
|
67
|
-
if (!isBrowser() || !document) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (document[hidden]) {
|
|
71
|
-
logger.debug('App is now hidden');
|
|
72
|
-
this.sessionStateChangeHandler('ended');
|
|
73
|
-
} else {
|
|
74
|
-
logger.debug('App is now visible');
|
|
75
|
-
this.sessionStateChangeHandler('started');
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
export type SessionState = 'started' | 'ended';
|
|
5
|
-
|
|
6
|
-
export type SessionStateChangeHandler = (state: SessionState) => void;
|
|
7
|
-
|
|
8
|
-
export interface SessionTrackerInterface {
|
|
9
|
-
start: () => SessionState;
|
|
10
|
-
end: () => SessionState;
|
|
11
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { Platform as NativePlatform } from 'react-native';
|
|
5
|
-
import { Platform as PlatformInterface } from './types';
|
|
6
|
-
|
|
7
|
-
const { OS } = NativePlatform;
|
|
8
|
-
|
|
9
|
-
export const Platform: PlatformInterface = { OS };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { Platform as PlatformInterface } from './types';
|
|
5
|
-
|
|
6
|
-
const userAgentIncludes = (text: string): boolean => {
|
|
7
|
-
return navigator?.userAgent?.includes(text);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const getOS = (): PlatformInterface['OS'] => {
|
|
11
|
-
if (userAgentIncludes('Android')) return 'android';
|
|
12
|
-
if (userAgentIncludes('like Mac')) return 'ios';
|
|
13
|
-
if (userAgentIncludes('Win')) return 'windows';
|
|
14
|
-
if (userAgentIncludes('Mac')) return 'macos';
|
|
15
|
-
if (userAgentIncludes('Linux')) return 'linux';
|
|
16
|
-
if (userAgentIncludes('X11')) return 'unix';
|
|
17
|
-
return 'unknown';
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const OS = getOS();
|
|
21
|
-
|
|
22
|
-
export const Platform: PlatformInterface = { OS };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
export interface Platform {
|
|
5
|
-
OS: KnownOS | 'unknown';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
type KnownOS =
|
|
9
|
-
| 'windows'
|
|
10
|
-
| 'macos'
|
|
11
|
-
| 'unix'
|
|
12
|
-
| 'linux'
|
|
13
|
-
| 'ios'
|
|
14
|
-
| 'android'
|
|
15
|
-
| 'web';
|
/package/lib/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.d.ts
RENAMED
|
File without changes
|
/package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/initializationManager.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/resolveCredentials.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|