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