@aws-amplify/notifications 2.0.1-console-preview.5a31ca1.0 → 2.0.1-console-preview.8d88eef.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/in-app-messaging/package.json +7 -0
- package/in-app-messaging/pinpoint/package.json +7 -0
- package/lib/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
- package/lib/eventListeners/index.d.ts +2 -0
- package/lib/{common → eventListeners}/index.js +0 -3
- package/{lib-esm/common → lib}/eventListeners/types.d.ts +2 -2
- package/lib/{common/eventListeners → eventListeners}/types.js +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js +0 -1
- package/lib/inAppMessaging/errors/assertServiceError.js +0 -1
- package/lib/inAppMessaging/errors/assertValidationError.js +0 -1
- package/lib/inAppMessaging/errors/index.js +0 -1
- package/lib/inAppMessaging/errors/validation.d.ts +0 -1
- package/lib/inAppMessaging/errors/validation.js +0 -5
- package/lib/inAppMessaging/index.d.ts +1 -1
- package/lib/inAppMessaging/index.js +0 -1
- package/lib/inAppMessaging/providers/index.d.ts +2 -1
- package/lib/inAppMessaging/providers/index.js +11 -12
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +6 -10
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +4 -6
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +2 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +6 -17
- package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -0
- package/lib/inAppMessaging/providers/pinpoint/index.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +2 -2
- package/lib/inAppMessaging/providers/pinpoint/types/index.js +0 -3
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
- package/lib/inAppMessaging/sessionTracker/SessionTracker.js +7 -7
- package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js +2 -3
- package/lib/inAppMessaging/sessionTracker/index.js +0 -1
- package/lib/inAppMessaging/sessionTracker/types.js +0 -1
- package/lib/inAppMessaging/types/event.js +0 -1
- package/lib/inAppMessaging/types/index.d.ts +1 -2
- package/lib/inAppMessaging/types/index.js +0 -1
- package/lib/inAppMessaging/types/inputs.d.ts +1 -3
- package/lib/inAppMessaging/types/inputs.js +0 -1
- package/lib/inAppMessaging/types/message.js +0 -1
- package/lib/inAppMessaging/types/options.d.ts +1 -1
- package/lib/inAppMessaging/types/options.js +0 -1
- package/lib/inAppMessaging/utils/index.js +0 -1
- package/lib/inAppMessaging/utils/statusHelpers.js +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -7
- package/lib/pushNotifications/Platform/index.js +0 -1
- package/lib/pushNotifications/Platform/index.native.js +0 -1
- package/lib/pushNotifications/Platform/types.js +0 -1
- package/lib/pushNotifications/errors/PushNotificationError.d.ts +4 -0
- package/lib/pushNotifications/errors/PushNotificationError.js +19 -0
- package/lib/pushNotifications/errors/errorHelpers.d.ts +8 -0
- package/lib/pushNotifications/errors/errorHelpers.js +30 -0
- package/lib/pushNotifications/errors/index.d.ts +2 -0
- package/lib/pushNotifications/errors/index.js +9 -0
- package/lib/pushNotifications/index.d.ts +3 -2
- package/lib/pushNotifications/index.js +12 -3
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +20 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +10 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +24 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +9 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +33 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +9 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -5
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +38 -0
- package/lib/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
- package/lib/pushNotifications/providers/pinpoint/apis/index.js +20 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +23 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +157 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +33 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +8 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +49 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +6 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +33 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +6 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +34 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +8 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +38 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +9 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +20 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +7 -0
- package/lib/pushNotifications/providers/pinpoint/index.d.ts +3 -1
- package/lib/pushNotifications/providers/pinpoint/index.js +10 -1
- package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
- package/lib/{common/AWSPinpointProviderCommon/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
- package/lib/{types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
- package/lib/pushNotifications/providers/{index.js → pinpoint/types/index.js} +0 -3
- package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
- package/lib/pushNotifications/providers/pinpoint/types/options.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +60 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
- package/lib/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +23 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +11 -0
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +7 -0
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +20 -0
- package/lib/pushNotifications/providers/pinpoint/utils/initializationManager.d.ts +12 -0
- package/lib/pushNotifications/providers/pinpoint/utils/initializationManager.js +23 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +16 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveCredentials.js +22 -0
- package/lib/pushNotifications/providers/pinpoint/utils/tokenManager.d.ts +12 -0
- package/lib/pushNotifications/providers/pinpoint/utils/tokenManager.js +19 -0
- package/lib/pushNotifications/types/errors.d.ts +3 -0
- package/lib/pushNotifications/types/errors.js +8 -0
- package/lib/pushNotifications/types/index.d.ts +5 -0
- package/lib/pushNotifications/types/index.js +6 -0
- package/lib/pushNotifications/types/inputs.d.ts +23 -0
- package/lib/pushNotifications/types/inputs.js +4 -0
- package/lib/pushNotifications/types/options.d.ts +4 -0
- package/lib/pushNotifications/types/options.js +4 -0
- package/lib/pushNotifications/types/outputs.d.ts +10 -0
- package/lib/pushNotifications/types/outputs.js +4 -0
- package/lib/pushNotifications/types/pushNotifications.d.ts +5 -0
- package/lib/pushNotifications/types/pushNotifications.js +4 -0
- package/lib/tsconfig.build.tsbuildinfo +8684 -0
- package/lib-esm/{common/eventListeners/index.js → eventListeners/eventListeners.js} +0 -1
- package/lib-esm/eventListeners/index.d.ts +2 -0
- package/lib-esm/{common → eventListeners}/index.js +0 -2
- package/{lib/common → lib-esm}/eventListeners/types.d.ts +2 -2
- package/lib-esm/{common/AWSPinpointProviderCommon → eventListeners}/types.js +0 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
- package/lib-esm/inAppMessaging/errors/index.js +0 -1
- package/lib-esm/inAppMessaging/errors/validation.d.ts +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js +0 -5
- package/lib-esm/inAppMessaging/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/index.d.ts +2 -1
- package/lib-esm/inAppMessaging/providers/index.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +7 -11
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +1 -3
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +8 -19
- package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +2 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +2 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +1 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js +8 -8
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js +2 -3
- package/lib-esm/inAppMessaging/sessionTracker/index.js +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/types.js +0 -1
- package/lib-esm/inAppMessaging/types/event.js +0 -1
- package/lib-esm/inAppMessaging/types/index.d.ts +1 -2
- package/lib-esm/inAppMessaging/types/index.js +0 -1
- package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -3
- package/lib-esm/inAppMessaging/types/inputs.js +0 -1
- package/lib-esm/inAppMessaging/types/message.js +0 -1
- package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/options.js +0 -1
- package/lib-esm/inAppMessaging/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
- package/lib-esm/index.d.ts +0 -4
- package/lib-esm/index.js +0 -3
- package/lib-esm/pushNotifications/Platform/index.js +0 -1
- package/lib-esm/pushNotifications/Platform/index.native.js +0 -1
- package/lib-esm/pushNotifications/Platform/types.js +0 -1
- package/lib-esm/pushNotifications/errors/PushNotificationError.d.ts +4 -0
- package/lib-esm/pushNotifications/errors/PushNotificationError.js +17 -0
- package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +8 -0
- package/lib-esm/pushNotifications/errors/errorHelpers.js +28 -0
- package/lib-esm/pushNotifications/errors/index.d.ts +2 -0
- package/lib-esm/pushNotifications/errors/index.js +4 -0
- package/lib-esm/pushNotifications/index.d.ts +3 -2
- package/lib-esm/pushNotifications/index.js +2 -3
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +8 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +22 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +55 -4
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +36 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.d.ts +10 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +10 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +21 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +155 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +47 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +32 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +36 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -0
- package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +3 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
- package/lib-esm/{common/eventListeners/types.js → pushNotifications/providers/pinpoint/types/analytics.js} +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
- package/lib-esm/{types.js → pushNotifications/providers/pinpoint/types/apis.js} +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
- package/{src/pushNotifications/providers/index.ts → lib-esm/pushNotifications/providers/pinpoint/types/index.js} +0 -2
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +5 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +58 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +6 -0
- package/lib-esm/pushNotifications/providers/{AWSPinpointProvider/utils.js → pinpoint/utils/getAnalyticsEvent.js} +8 -10
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +21 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/initializationManager.d.ts +12 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/initializationManager.js +21 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.js +14 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveCredentials.js +20 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/tokenManager.d.ts +12 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/tokenManager.js +17 -0
- package/lib-esm/pushNotifications/types/errors.d.ts +3 -0
- package/lib-esm/pushNotifications/types/errors.js +6 -0
- package/lib-esm/pushNotifications/types/index.d.ts +5 -0
- package/lib-esm/pushNotifications/types/index.js +3 -0
- package/lib-esm/pushNotifications/types/inputs.d.ts +23 -0
- package/lib-esm/pushNotifications/types/inputs.js +2 -0
- package/lib-esm/pushNotifications/types/options.d.ts +4 -0
- package/lib-esm/pushNotifications/types/options.js +2 -0
- package/lib-esm/pushNotifications/types/outputs.d.ts +10 -0
- package/lib-esm/pushNotifications/types/outputs.js +2 -0
- package/lib-esm/pushNotifications/types/pushNotifications.d.ts +5 -0
- package/lib-esm/pushNotifications/types/pushNotifications.js +2 -0
- package/lib-esm/tsconfig.build.tsbuildinfo +7085 -0
- package/package.json +15 -13
- package/push-notifications/package.json +7 -0
- package/push-notifications/pinpoint/package.json +7 -0
- package/src/{common → eventListeners}/index.ts +1 -6
- package/src/{common/eventListeners → eventListeners}/types.ts +2 -2
- package/src/inAppMessaging/errors/validation.ts +0 -4
- package/src/inAppMessaging/index.ts +12 -0
- package/src/inAppMessaging/providers/index.ts +24 -1
- package/src/inAppMessaging/providers/pinpoint/apis/dispatchEvent.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +7 -6
- package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +1 -2
- package/src/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageReceived.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +12 -29
- package/src/inAppMessaging/providers/pinpoint/index.ts +15 -0
- package/src/inAppMessaging/providers/pinpoint/types/index.ts +11 -1
- package/src/inAppMessaging/providers/pinpoint/types/outputs.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/utils/helpers.ts +1 -1
- package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +1 -3
- package/src/inAppMessaging/sessionTracker/SessionTracker.native.ts +2 -2
- package/src/inAppMessaging/sessionTracker/SessionTracker.ts +8 -10
- package/src/inAppMessaging/types/index.ts +3 -1
- package/src/inAppMessaging/types/inputs.ts +1 -3
- package/src/inAppMessaging/types/options.ts +1 -1
- package/src/index.ts +0 -9
- package/src/pushNotifications/errors/PushNotificationError.ts +18 -0
- package/src/pushNotifications/errors/errorHelpers.ts +40 -0
- package/src/pushNotifications/errors/index.ts +5 -0
- package/src/pushNotifications/index.ts +27 -5
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +9 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +21 -0
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +11 -0
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +26 -0
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +11 -0
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +34 -0
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +38 -0
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +58 -7
- package/src/pushNotifications/providers/pinpoint/apis/index.ts +10 -0
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +197 -0
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.ts +24 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +8 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +8 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.ts +56 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +8 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.ts +40 -0
- package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +8 -0
- package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +11 -0
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +9 -0
- package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.ts +21 -0
- package/src/pushNotifications/providers/pinpoint/index.ts +30 -1
- package/src/pushNotifications/providers/pinpoint/types/analytics.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/types/apis.ts +54 -0
- package/src/pushNotifications/providers/pinpoint/types/index.ts +40 -0
- package/src/pushNotifications/providers/pinpoint/types/inputs.ts +31 -0
- package/src/pushNotifications/providers/pinpoint/types/options.ts +9 -0
- package/src/pushNotifications/providers/pinpoint/types/outputs.ts +34 -0
- package/src/pushNotifications/providers/pinpoint/types/pushNotifications.ts +6 -0
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +66 -0
- package/src/pushNotifications/providers/{AWSPinpointProvider/utils.ts → pinpoint/utils/getAnalyticsEvent.ts} +19 -21
- package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +25 -0
- package/src/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.ts +15 -0
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +10 -0
- package/src/pushNotifications/providers/pinpoint/utils/initializationManager.ts +20 -0
- package/src/pushNotifications/providers/pinpoint/utils/resolveConfig.ts +16 -0
- package/src/pushNotifications/providers/pinpoint/utils/resolveCredentials.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/utils/tokenManager.ts +20 -0
- package/src/pushNotifications/types/errors.ts +6 -0
- package/src/pushNotifications/types/index.ts +8 -0
- package/src/pushNotifications/types/inputs.ts +45 -0
- package/src/pushNotifications/types/options.ts +7 -0
- package/src/pushNotifications/types/outputs.ts +28 -0
- package/src/pushNotifications/types/pushNotifications.ts +22 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/common/AWSPinpointProviderCommon/index.d.ts +0 -39
- package/lib/common/AWSPinpointProviderCommon/index.js +0 -289
- package/lib/common/AWSPinpointProviderCommon/index.js.map +0 -1
- package/lib/common/AWSPinpointProviderCommon/types.d.ts +0 -10
- package/lib/common/AWSPinpointProviderCommon/types.js.map +0 -1
- package/lib/common/eventListeners/index.js.map +0 -1
- package/lib/common/eventListeners/types.js.map +0 -1
- package/lib/common/index.d.ts +0 -3
- package/lib/common/index.js.map +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib/inAppMessaging/errors/index.js.map +0 -1
- package/lib/inAppMessaging/errors/validation.js.map +0 -1
- package/lib/inAppMessaging/index.js.map +0 -1
- package/lib/inAppMessaging/providers/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
- package/lib/inAppMessaging/providers/pinpoint/types/errors.js +0 -15
- package/lib/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
- package/lib/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
- package/lib/inAppMessaging/sessionTracker/index.js.map +0 -1
- package/lib/inAppMessaging/sessionTracker/types.js.map +0 -1
- package/lib/inAppMessaging/types/config.d.ts +0 -5
- package/lib/inAppMessaging/types/config.js +0 -3
- package/lib/inAppMessaging/types/config.js.map +0 -1
- package/lib/inAppMessaging/types/event.js.map +0 -1
- package/lib/inAppMessaging/types/index.js.map +0 -1
- package/lib/inAppMessaging/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/types/message.js.map +0 -1
- package/lib/inAppMessaging/types/options.js.map +0 -1
- package/lib/inAppMessaging/utils/index.js.map +0 -1
- package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/pushNotifications/NotEnabledError.d.ts +0 -3
- package/lib/pushNotifications/NotEnabledError.js +0 -16
- package/lib/pushNotifications/NotEnabledError.js.map +0 -1
- package/lib/pushNotifications/Platform/index.js.map +0 -1
- package/lib/pushNotifications/Platform/index.native.js.map +0 -1
- package/lib/pushNotifications/Platform/types.js.map +0 -1
- package/lib/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
- package/lib/pushNotifications/PlatformNotSupportedError.js +0 -16
- package/lib/pushNotifications/PlatformNotSupportedError.js.map +0 -1
- package/lib/pushNotifications/index.js.map +0 -1
- package/lib/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
- package/lib/pushNotifications/providers/AWSPinpointProvider/index.js +0 -65
- package/lib/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
- package/lib/pushNotifications/providers/AWSPinpointProvider/types.js +0 -16
- package/lib/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
- package/lib/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib/pushNotifications/providers/index.d.ts +0 -1
- package/lib/pushNotifications/providers/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib/pushNotifications/types.d.ts +0 -71
- package/lib/pushNotifications/types.js +0 -12
- package/lib/pushNotifications/types.js.map +0 -1
- package/lib/pushNotifications/utils.d.ts +0 -3
- package/lib/pushNotifications/utils.js +0 -81
- package/lib/pushNotifications/utils.js.map +0 -1
- package/lib/types.d.ts +0 -39
- package/lib/types.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +0 -39
- package/lib-esm/common/AWSPinpointProviderCommon/index.js +0 -287
- package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +0 -1
- package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +0 -10
- package/lib-esm/common/AWSPinpointProviderCommon/types.js.map +0 -1
- package/lib-esm/common/eventListeners/index.js.map +0 -1
- package/lib-esm/common/eventListeners/types.js.map +0 -1
- package/lib-esm/common/index.d.ts +0 -3
- package/lib-esm/common/index.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
- package/lib-esm/inAppMessaging/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.d.ts +0 -9
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js +0 -13
- package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.js.map +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/SessionTracker.native.js.map +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/index.js.map +0 -1
- package/lib-esm/inAppMessaging/sessionTracker/types.js.map +0 -1
- package/lib-esm/inAppMessaging/types/config.d.ts +0 -5
- package/lib-esm/inAppMessaging/types/config.js +0 -1
- package/lib-esm/inAppMessaging/types/config.js.map +0 -1
- package/lib-esm/inAppMessaging/types/event.js.map +0 -1
- package/lib-esm/inAppMessaging/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/types/message.js.map +0 -1
- package/lib-esm/inAppMessaging/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/pushNotifications/NotEnabledError.d.ts +0 -3
- package/lib-esm/pushNotifications/NotEnabledError.js +0 -14
- package/lib-esm/pushNotifications/NotEnabledError.js.map +0 -1
- package/lib-esm/pushNotifications/Platform/index.js.map +0 -1
- package/lib-esm/pushNotifications/Platform/index.native.js.map +0 -1
- package/lib-esm/pushNotifications/Platform/types.js.map +0 -1
- package/lib-esm/pushNotifications/PlatformNotSupportedError.d.ts +0 -3
- package/lib-esm/pushNotifications/PlatformNotSupportedError.js +0 -14
- package/lib-esm/pushNotifications/PlatformNotSupportedError.js.map +0 -1
- package/lib-esm/pushNotifications/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.d.ts +0 -15
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js +0 -63
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.d.ts +0 -9
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js +0 -14
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.d.ts +0 -6
- package/lib-esm/pushNotifications/providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib-esm/pushNotifications/providers/index.d.ts +0 -1
- package/lib-esm/pushNotifications/providers/index.js +0 -4
- package/lib-esm/pushNotifications/providers/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/pushNotifications/types.d.ts +0 -71
- package/lib-esm/pushNotifications/types.js +0 -10
- package/lib-esm/pushNotifications/types.js.map +0 -1
- package/lib-esm/pushNotifications/utils.d.ts +0 -3
- package/lib-esm/pushNotifications/utils.js +0 -79
- package/lib-esm/pushNotifications/utils.js.map +0 -1
- package/lib-esm/types.d.ts +0 -39
- package/lib-esm/types.js.map +0 -1
- package/src/common/AWSPinpointProviderCommon/index.ts +0 -300
- package/src/common/AWSPinpointProviderCommon/types.ts +0 -29
- package/src/inAppMessaging/providers/pinpoint/types/errors.ts +0 -12
- package/src/inAppMessaging/types/config.ts +0 -8
- package/src/pushNotifications/NotEnabledError.ts +0 -11
- package/src/pushNotifications/PlatformNotSupportedError.ts +0 -9
- package/src/pushNotifications/providers/AWSPinpointProvider/index.ts +0 -93
- package/src/pushNotifications/providers/AWSPinpointProvider/types.ts +0 -13
- package/src/pushNotifications/types.ts +0 -114
- package/src/pushNotifications/utils.ts +0 -112
- package/src/types.ts +0 -56
- /package/lib/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
- /package/lib-esm/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +0 -0
- /package/src/{common/eventListeners/index.ts → eventListeners/eventListeners.ts} +0 -0
package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __awaiter, __generator } from "tslib";
|
|
4
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
+
import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
7
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
8
|
+
import { addEventListener, notifyEventListeners, notifyEventListenersAndAwaitHandlers, } from '../../../../eventListeners';
|
|
9
|
+
import { createMessageEventRecorder, getChannelType, getPushNotificationUserAgentString, getToken, initialize, isInitialized, resolveConfig, resolveCredentials, setToken, } from '../utils';
|
|
10
|
+
var _a = loadAmplifyPushNotification(), addMessageEventListener = _a.addMessageEventListener, addTokenEventListener = _a.addTokenEventListener, completeNotification = _a.completeNotification, getConstants = _a.getConstants, registerHeadlessTask = _a.registerHeadlessTask;
|
|
11
|
+
var logger = new ConsoleLogger('Notifications.PushNotification');
|
|
12
|
+
var BACKGROUND_TASK_TIMEOUT = 25; // seconds
|
|
13
|
+
export var initializePushNotifications = function () {
|
|
14
|
+
if (isInitialized()) {
|
|
15
|
+
logger.info('Push notifications have already been enabled');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
addNativeListeners();
|
|
19
|
+
addAnalyticsListeners();
|
|
20
|
+
initialize();
|
|
21
|
+
};
|
|
22
|
+
var addAnalyticsListeners = function () {
|
|
23
|
+
var launchNotificationOpenedListenerRemover;
|
|
24
|
+
// wire up default Pinpoint message event handling
|
|
25
|
+
addEventListener('backgroundMessageReceived', createMessageEventRecorder('backgroundMessageReceived'));
|
|
26
|
+
addEventListener('foregroundMessageReceived', createMessageEventRecorder('foregroundMessageReceived'));
|
|
27
|
+
launchNotificationOpenedListenerRemover = addEventListener('launchNotificationsOpened', createMessageEventRecorder('notificationOpened',
|
|
28
|
+
// once we are done with it we can remove the listener
|
|
29
|
+
launchNotificationOpenedListenerRemover === null ||
|
|
30
|
+
// once we are done with it we can remove the listener
|
|
31
|
+
launchNotificationOpenedListenerRemover === void 0 ? void 0 :
|
|
32
|
+
// once we are done with it we can remove the listener
|
|
33
|
+
launchNotificationOpenedListenerRemover.remove));
|
|
34
|
+
addEventListener('notificationOpened', createMessageEventRecorder('notificationOpened',
|
|
35
|
+
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
36
|
+
launchNotificationOpenedListenerRemover === null ||
|
|
37
|
+
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
38
|
+
launchNotificationOpenedListenerRemover === void 0 ? void 0 :
|
|
39
|
+
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
40
|
+
launchNotificationOpenedListenerRemover.remove));
|
|
41
|
+
};
|
|
42
|
+
var addNativeListeners = function () {
|
|
43
|
+
var _a = getConstants(), NativeEvent = _a.NativeEvent, NativeHeadlessTaskKey = _a.NativeHeadlessTaskKey;
|
|
44
|
+
var BACKGROUND_MESSAGE_RECEIVED = NativeEvent.BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED = NativeEvent.FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED = NativeEvent.LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED = NativeEvent.NOTIFICATION_OPENED, TOKEN_RECEIVED = NativeEvent.TOKEN_RECEIVED;
|
|
45
|
+
// on platforms that can handle headless tasks, register one to broadcast background message received to
|
|
46
|
+
// library listeners
|
|
47
|
+
if (NativeHeadlessTaskKey) {
|
|
48
|
+
registerHeadlessTask(function (message) { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
+
return __generator(this, function (_a) {
|
|
50
|
+
switch (_a.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
// keep headless task running until handlers have completed their work
|
|
53
|
+
return [4 /*yield*/, notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message)];
|
|
54
|
+
case 1:
|
|
55
|
+
// keep headless task running until handlers have completed their work
|
|
56
|
+
_a.sent();
|
|
57
|
+
return [2 /*return*/];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}); });
|
|
61
|
+
}
|
|
62
|
+
else if (BACKGROUND_MESSAGE_RECEIVED) {
|
|
63
|
+
// on platforms that can't handle headless tasks, listen for native background message received event and
|
|
64
|
+
// broadcast to library listeners
|
|
65
|
+
addMessageEventListener(BACKGROUND_MESSAGE_RECEIVED, function (message, completionHandlerId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
+
var err_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
_a.trys.push([0, 2, 3, 4]);
|
|
71
|
+
return [4 /*yield*/, Promise.race([
|
|
72
|
+
notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message),
|
|
73
|
+
// background tasks will get suspended and all future tasks be deprioritized by the OS if they run for
|
|
74
|
+
// more than 30 seconds so we reject with a error in a shorter amount of time to prevent this from
|
|
75
|
+
// happening
|
|
76
|
+
new Promise(function (_, reject) {
|
|
77
|
+
setTimeout(function () {
|
|
78
|
+
return reject("onNotificationReceivedInBackground handlers should complete their work within " + BACKGROUND_TASK_TIMEOUT + " seconds, but they did not.");
|
|
79
|
+
}, BACKGROUND_TASK_TIMEOUT * 1000);
|
|
80
|
+
}),
|
|
81
|
+
])];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [3 /*break*/, 4];
|
|
85
|
+
case 2:
|
|
86
|
+
err_1 = _a.sent();
|
|
87
|
+
logger.error(err_1);
|
|
88
|
+
return [3 /*break*/, 4];
|
|
89
|
+
case 3:
|
|
90
|
+
// notify native module that handlers have completed their work (or timed out)
|
|
91
|
+
completeNotification(completionHandlerId);
|
|
92
|
+
return [7 /*endfinally*/];
|
|
93
|
+
case 4: return [2 /*return*/];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}); });
|
|
97
|
+
}
|
|
98
|
+
addMessageEventListener(
|
|
99
|
+
// listen for native foreground message received event and broadcast to library listeners
|
|
100
|
+
FOREGROUND_MESSAGE_RECEIVED, function (message) {
|
|
101
|
+
notifyEventListeners('foregroundMessageReceived', message);
|
|
102
|
+
});
|
|
103
|
+
var launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
|
|
104
|
+
? addMessageEventListener(
|
|
105
|
+
// listen for native notification opened app (user tapped on notification, opening the app from quit -
|
|
106
|
+
// not background - state) event. This is broadcasted to an internal listener only as it is not intended
|
|
107
|
+
// for use otherwise as it produces inconsistent results when used within React Native app context
|
|
108
|
+
LAUNCH_NOTIFICATION_OPENED, function (message) {
|
|
109
|
+
notifyEventListeners('launchNotificationsOpened', message);
|
|
110
|
+
// once we are done with it we can remove the listener
|
|
111
|
+
launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
|
|
112
|
+
})
|
|
113
|
+
: null;
|
|
114
|
+
addMessageEventListener(
|
|
115
|
+
// listen for native notification opened (user tapped on notification, opening the app from background -
|
|
116
|
+
// not quit - state) event and broadcast to library listeners
|
|
117
|
+
NOTIFICATION_OPENED, function (message) {
|
|
118
|
+
notifyEventListeners('notificationOpened', message);
|
|
119
|
+
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
120
|
+
launchNotificationOpenedListener === null || launchNotificationOpenedListener === void 0 ? void 0 : launchNotificationOpenedListener.remove();
|
|
121
|
+
});
|
|
122
|
+
addTokenEventListener(
|
|
123
|
+
// listen for native new token event, automatically re-register device with provider using new token and
|
|
124
|
+
// broadcast to library listeners
|
|
125
|
+
TOKEN_RECEIVED, function (token) {
|
|
126
|
+
// avoid a race condition where two endpoints are created with the same token on a fresh install
|
|
127
|
+
if (getToken() === token) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
setToken(token);
|
|
131
|
+
registerDevice();
|
|
132
|
+
notifyEventListeners('tokenReceived', token);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
var registerDevice = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
+
var _a, credentials, identityId, _b, appId, region;
|
|
137
|
+
return __generator(this, function (_c) {
|
|
138
|
+
switch (_c.label) {
|
|
139
|
+
case 0: return [4 /*yield*/, resolveCredentials()];
|
|
140
|
+
case 1:
|
|
141
|
+
_a = _c.sent(), credentials = _a.credentials, identityId = _a.identityId;
|
|
142
|
+
_b = resolveConfig(), appId = _b.appId, region = _b.region;
|
|
143
|
+
return [2 /*return*/, updateEndpoint({
|
|
144
|
+
address: getToken(),
|
|
145
|
+
appId: appId,
|
|
146
|
+
category: 'PushNotification',
|
|
147
|
+
credentials: credentials,
|
|
148
|
+
region: region,
|
|
149
|
+
channelType: getChannelType(),
|
|
150
|
+
identityId: identityId,
|
|
151
|
+
userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.InitializePushNotifications),
|
|
152
|
+
})];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}); };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OnNotificationOpened } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a listener that will be triggered when a notification is opened by user.
|
|
4
|
+
*
|
|
5
|
+
* @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
|
|
6
|
+
* {@link PushNotificationMessage}.
|
|
7
|
+
* @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Register a listener
|
|
11
|
+
* onNotificationOpened(message => {
|
|
12
|
+
* doSomething(message);
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // Register multiple listeners
|
|
18
|
+
* onNotificationOpened(message => {
|
|
19
|
+
* doSomething(message);
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* onNotificationOpened(message => {
|
|
23
|
+
* doSomethingElse(message);
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const onNotificationOpened: OnNotificationOpened;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a listener that will be triggered when a notification is opened by user.
|
|
6
|
+
*
|
|
7
|
+
* @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
|
|
8
|
+
* {@link PushNotificationMessage}.
|
|
9
|
+
* @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Register a listener
|
|
13
|
+
* onNotificationOpened(message => {
|
|
14
|
+
* doSomething(message);
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Register multiple listeners
|
|
20
|
+
* onNotificationOpened(message => {
|
|
21
|
+
* doSomething(message);
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* onNotificationOpened(message => {
|
|
25
|
+
* doSomethingElse(message);
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export var onNotificationOpened = function () {
|
|
30
|
+
throw new PlatformNotSupportedError();
|
|
31
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
4
|
+
export var onNotificationOpened = function (input) {
|
|
5
|
+
return addEventListener('notificationOpened', input);
|
|
6
|
+
};
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { OnNotificationReceivedInBackground } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a listener that will be triggered when a notification is received while app is in a background state.
|
|
4
|
+
*
|
|
5
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
6
|
+
* only React Native is supported by this API.
|
|
7
|
+
* @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
|
|
8
|
+
* {@link PushNotificationMessage}.
|
|
9
|
+
* @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
|
|
10
|
+
* @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
|
|
11
|
+
* on a background service on Android) in the background. Handlers registered via this function should return promises
|
|
12
|
+
* if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
|
|
13
|
+
* as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
|
|
14
|
+
* get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
|
|
15
|
+
* registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // Register a listener
|
|
19
|
+
* onNotificationReceivedInBackground(message => {
|
|
20
|
+
* doSomething(message);
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Register multiple listeners
|
|
26
|
+
* onNotificationReceivedInBackground(message => {
|
|
27
|
+
* doSomething(message);
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* onNotificationReceivedInBackground(message => {
|
|
31
|
+
* doSomethingElse(message);
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Register async listener
|
|
37
|
+
* onNotificationReceivedInBackground(async message => {
|
|
38
|
+
* await doSomething(message);
|
|
39
|
+
* console.log(`did something with ${message}`);
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const onNotificationReceivedInBackground: OnNotificationReceivedInBackground;
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a listener that will be triggered when a notification is received while app is in a background state.
|
|
6
|
+
*
|
|
7
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
8
|
+
* only React Native is supported by this API.
|
|
9
|
+
* @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
|
|
10
|
+
* {@link PushNotificationMessage}.
|
|
11
|
+
* @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
|
|
12
|
+
* @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
|
|
13
|
+
* on a background service on Android) in the background. Handlers registered via this function should return promises
|
|
14
|
+
* if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
|
|
15
|
+
* as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
|
|
16
|
+
* get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
|
|
17
|
+
* registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register a listener
|
|
21
|
+
* onNotificationReceivedInBackground(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Register multiple listeners
|
|
28
|
+
* onNotificationReceivedInBackground(message => {
|
|
29
|
+
* doSomething(message);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* onNotificationReceivedInBackground(message => {
|
|
33
|
+
* doSomethingElse(message);
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* // Register async listener
|
|
39
|
+
* onNotificationReceivedInBackground(async message => {
|
|
40
|
+
* await doSomething(message);
|
|
41
|
+
* console.log(`did something with ${message}`);
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export var onNotificationReceivedInBackground = function () {
|
|
46
|
+
throw new PlatformNotSupportedError();
|
|
47
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
4
|
+
export var onNotificationReceivedInBackground = function (input) { return addEventListener('backgroundMessageReceived', input); };
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OnNotificationReceivedInForeground } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a listener that will be triggered when a notification is received while app is in a foreground state.
|
|
4
|
+
*
|
|
5
|
+
* @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
|
|
6
|
+
* {@link PushNotificationMessage}.
|
|
7
|
+
* @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Register a listener
|
|
11
|
+
* onNotificationReceivedInForeground(message => {
|
|
12
|
+
* doSomething(message);
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // Register multiple listeners
|
|
18
|
+
* onNotificationReceivedInForeground(message => {
|
|
19
|
+
* doSomething(message);
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* onNotificationReceivedInForeground(message => {
|
|
23
|
+
* doSomethingElse(message);
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const onNotificationReceivedInForeground: OnNotificationReceivedInForeground;
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a listener that will be triggered when a notification is received while app is in a foreground state.
|
|
6
|
+
*
|
|
7
|
+
* @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
|
|
8
|
+
* {@link PushNotificationMessage}.
|
|
9
|
+
* @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Register a listener
|
|
13
|
+
* onNotificationReceivedInForeground(message => {
|
|
14
|
+
* doSomething(message);
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Register multiple listeners
|
|
20
|
+
* onNotificationReceivedInForeground(message => {
|
|
21
|
+
* doSomething(message);
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* onNotificationReceivedInForeground(message => {
|
|
25
|
+
* doSomethingElse(message);
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export var onNotificationReceivedInForeground = function () {
|
|
30
|
+
throw new PlatformNotSupportedError();
|
|
31
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
4
|
+
export var onNotificationReceivedInForeground = function (input) { return addEventListener('foregroundMessageReceived', input); };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnTokenReceived } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a listener that will be triggered when a token is received. A token will be received:
|
|
4
|
+
* 1. On every app launch, including the first install
|
|
5
|
+
* 2. When a token changes (this may happen if the service invalidates the token for any reason)
|
|
6
|
+
*
|
|
7
|
+
* @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
|
|
8
|
+
* @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Register a listener
|
|
12
|
+
* onTokenReceived(message => {
|
|
13
|
+
* doSomething(message);
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // Register multiple listeners
|
|
19
|
+
* onTokenReceived(message => {
|
|
20
|
+
* doSomething(message);
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* onTokenReceived(message => {
|
|
24
|
+
* doSomethingElse(message);
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const onTokenReceived: OnTokenReceived;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a listener that will be triggered when a token is received. A token will be received:
|
|
6
|
+
* 1. On every app launch, including the first install
|
|
7
|
+
* 2. When a token changes (this may happen if the service invalidates the token for any reason)
|
|
8
|
+
*
|
|
9
|
+
* @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
|
|
10
|
+
* @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Register a listener
|
|
14
|
+
* onTokenReceived(message => {
|
|
15
|
+
* doSomething(message);
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register multiple listeners
|
|
21
|
+
* onTokenReceived(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* onTokenReceived(message => {
|
|
26
|
+
* doSomethingElse(message);
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export var onTokenReceived = function () {
|
|
31
|
+
throw new PlatformNotSupportedError();
|
|
32
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
4
|
+
export var onTokenReceived = function (input) {
|
|
5
|
+
return addEventListener('tokenReceived', input);
|
|
6
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RequestPermissions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
|
|
4
|
+
* choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
|
|
5
|
+
* granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
|
|
6
|
+
* your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
|
|
7
|
+
*
|
|
8
|
+
* * `alert`: When set to true, requests the ability to display notifications to the user.
|
|
9
|
+
*
|
|
10
|
+
* * `sound`: When set to true, requests the ability to play a sound in response to notifications.
|
|
11
|
+
*
|
|
12
|
+
* * `badge`: When set to true, requests the ability to update the app's badge.
|
|
13
|
+
*
|
|
14
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
15
|
+
* only React Native is supported by this API.
|
|
16
|
+
* @returns A promise that resolves to true if requested permissions are granted or have already previously been
|
|
17
|
+
* granted or false otherwise.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Request all permissions by default
|
|
21
|
+
* const arePermissionsGranted = await requestPermissions();
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Prevent requesting specific permissions
|
|
26
|
+
* const arePermissionsGranted = await requestPermissions({
|
|
27
|
+
* sound: false,
|
|
28
|
+
* badge: false
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const requestPermissions: RequestPermissions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
|
|
6
|
+
* choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
|
|
7
|
+
* granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
|
|
8
|
+
* your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
|
|
9
|
+
*
|
|
10
|
+
* * `alert`: When set to true, requests the ability to display notifications to the user.
|
|
11
|
+
*
|
|
12
|
+
* * `sound`: When set to true, requests the ability to play a sound in response to notifications.
|
|
13
|
+
*
|
|
14
|
+
* * `badge`: When set to true, requests the ability to update the app's badge.
|
|
15
|
+
*
|
|
16
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
17
|
+
* only React Native is supported by this API.
|
|
18
|
+
* @returns A promise that resolves to true if requested permissions are granted or have already previously been
|
|
19
|
+
* granted or false otherwise.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* // Request all permissions by default
|
|
23
|
+
* const arePermissionsGranted = await requestPermissions();
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Prevent requesting specific permissions
|
|
28
|
+
* const arePermissionsGranted = await requestPermissions({
|
|
29
|
+
* sound: false,
|
|
30
|
+
* badge: false
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export var requestPermissions = function () {
|
|
35
|
+
throw new PlatformNotSupportedError();
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
4
|
+
var requestPermissionsNative = loadAmplifyPushNotification().requestPermissions;
|
|
5
|
+
export var requestPermissions = function (input) {
|
|
6
|
+
return requestPermissionsNative(input);
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SetBadgeCount } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
|
|
4
|
+
* to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
|
|
5
|
+
* when your React Native app is running on platforms where badges are not supported.
|
|
6
|
+
*
|
|
7
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
8
|
+
* only React Native is supported by this API.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* setBadgeCount(42);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const setBadgeCount: SetBadgeCount;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
|
|
6
|
+
* to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
|
|
7
|
+
* when your React Native app is running on platforms where badges are not supported.
|
|
8
|
+
*
|
|
9
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
10
|
+
* only React Native is supported by this API.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* setBadgeCount(42);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export var setBadgeCount = function () {
|
|
17
|
+
throw new PlatformNotSupportedError();
|
|
18
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
4
|
+
var setBadgeCountNative = loadAmplifyPushNotification().setBadgeCount;
|
|
5
|
+
export var setBadgeCount = function (input) { return setBadgeCountNative(input); };
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export { identifyUser } from './apis';
|
|
1
|
+
export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
|
|
2
|
+
export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './types/inputs';
|
|
3
|
+
export { GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './types/outputs';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export { identifyUser } from './apis';
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
|
|
2
|
+
export declare type PinpointMessageEventSource = '_campaign' | '_journey';
|
|
3
|
+
export declare type AnalyticsEventAttributes = {
|
|
4
|
+
source: PinpointMessageEventSource;
|
|
5
|
+
attributes: Record<string, string>;
|
|
6
|
+
};
|