@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,39 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import { PushNotificationMessage } from '../../../types';
|
|
6
|
+
import {
|
|
7
|
+
OnNotificationOpened,
|
|
8
|
+
OnNotificationOpenedInput,
|
|
9
|
+
OnNotificationOpenedOutput,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Registers a listener that will be triggered when a notification is opened by user.
|
|
14
|
+
*
|
|
15
|
+
* @param {OnNotificationOpenedInput} input - A callback handler to be invoked with the opened
|
|
16
|
+
* {@link PushNotificationMessage}.
|
|
17
|
+
* @returns {OnNotificationOpenedOutput} - An object with a remove function to remove the listener.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register a listener
|
|
21
|
+
* onNotificationOpened(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Register multiple listeners
|
|
28
|
+
* onNotificationOpened(message => {
|
|
29
|
+
* doSomething(message);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* onNotificationOpened(message => {
|
|
33
|
+
* doSomethingElse(message);
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const onNotificationOpened: OnNotificationOpened = () => {
|
|
38
|
+
throw new PlatformNotSupportedError();
|
|
39
|
+
};
|
package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
5
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
6
|
+
import { OnNotificationReceivedInBackground } from '../types';
|
|
7
|
+
|
|
8
|
+
export const onNotificationReceivedInBackground: OnNotificationReceivedInBackground =
|
|
9
|
+
input => {
|
|
10
|
+
assertIsInitialized();
|
|
11
|
+
return addEventListener('backgroundMessageReceived', input);
|
|
12
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import { PushNotificationMessage } from '../../../types';
|
|
6
|
+
import {
|
|
7
|
+
OnNotificationReceivedInBackground,
|
|
8
|
+
OnNotificationReceivedInBackgroundInput,
|
|
9
|
+
OnNotificationReceivedInBackgroundOutput,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Registers a listener that will be triggered when a notification is received while app is in a background state.
|
|
14
|
+
*
|
|
15
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
16
|
+
* only React Native is supported by this API.
|
|
17
|
+
* @param {OnNotificationReceivedInBackgroundInput} input - A callback handler to be invoked with the received
|
|
18
|
+
* {@link PushNotificationMessage}.
|
|
19
|
+
* @returns {OnNotificationReceivedInBackgroundOutput} - An object with a remove function to remove the listener.
|
|
20
|
+
* @remarks Notifications received while app is in a quit state will start the app (as a headless JS instance running
|
|
21
|
+
* on a background service on Android) in the background. Handlers registered via this function should return promises
|
|
22
|
+
* if it needs to be asynchronous (e.g. to perform some network requests). The app should run in the background as long
|
|
23
|
+
* as there are handlers still running (however, if they run for more than 30 seconds on iOS, subsequent tasks could
|
|
24
|
+
* get deprioritized!). If it is necessary for a handler to execute while the app is in quit state, it should be
|
|
25
|
+
* registered in the application entry point (e.g. index.js) since the application will not fully mount in that case.
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Register a listener
|
|
29
|
+
* onNotificationReceivedInBackground(message => {
|
|
30
|
+
* doSomething(message);
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Register multiple listeners
|
|
36
|
+
* onNotificationReceivedInBackground(message => {
|
|
37
|
+
* doSomething(message);
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* onNotificationReceivedInBackground(message => {
|
|
41
|
+
* doSomethingElse(message);
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // Register async listener
|
|
47
|
+
* onNotificationReceivedInBackground(async message => {
|
|
48
|
+
* await doSomething(message);
|
|
49
|
+
* console.log(`did something with ${message}`);
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export const onNotificationReceivedInBackground: OnNotificationReceivedInBackground =
|
|
54
|
+
() => {
|
|
55
|
+
throw new PlatformNotSupportedError();
|
|
56
|
+
};
|
package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
5
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
6
|
+
import { OnNotificationReceivedInForeground } from '../types';
|
|
7
|
+
|
|
8
|
+
export const onNotificationReceivedInForeground: OnNotificationReceivedInForeground =
|
|
9
|
+
input => {
|
|
10
|
+
assertIsInitialized();
|
|
11
|
+
return addEventListener('foregroundMessageReceived', input);
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import { PushNotificationMessage } from '../../../types';
|
|
6
|
+
import {
|
|
7
|
+
OnNotificationReceivedInForeground,
|
|
8
|
+
OnNotificationReceivedInForegroundInput,
|
|
9
|
+
OnNotificationReceivedInForegroundOutput,
|
|
10
|
+
} from '../types';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Registers a listener that will be triggered when a notification is received while app is in a foreground state.
|
|
14
|
+
*
|
|
15
|
+
* @param {OnNotificationReceivedInForegroundInput} input - A callback handler to be invoked with the received
|
|
16
|
+
* {@link PushNotificationMessage}.
|
|
17
|
+
* @returns {OnNotificationReceivedInForegroundOutput} - An object with a remove function to remove the listener.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register a listener
|
|
21
|
+
* onNotificationReceivedInForeground(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Register multiple listeners
|
|
28
|
+
* onNotificationReceivedInForeground(message => {
|
|
29
|
+
* doSomething(message);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* onNotificationReceivedInForeground(message => {
|
|
33
|
+
* doSomethingElse(message);
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const onNotificationReceivedInForeground: OnNotificationReceivedInForeground =
|
|
38
|
+
() => {
|
|
39
|
+
throw new PlatformNotSupportedError();
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
5
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
6
|
+
import { OnTokenReceived } from '../types';
|
|
7
|
+
|
|
8
|
+
export const onTokenReceived: OnTokenReceived = input => {
|
|
9
|
+
assertIsInitialized();
|
|
10
|
+
return addEventListener('tokenReceived', input);
|
|
11
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import {
|
|
6
|
+
OnTokenReceived,
|
|
7
|
+
OnTokenReceivedInput,
|
|
8
|
+
OnTokenReceivedOutput,
|
|
9
|
+
} from '../types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Registers a listener that will be triggered when a token is received. A token will be received:
|
|
13
|
+
* 1. On every app launch, including the first install
|
|
14
|
+
* 2. When a token changes (this may happen if the service invalidates the token for any reason)
|
|
15
|
+
*
|
|
16
|
+
* @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
|
|
17
|
+
* @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register a listener
|
|
21
|
+
* onTokenReceived(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Register multiple listeners
|
|
28
|
+
* onTokenReceived(message => {
|
|
29
|
+
* doSomething(message);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* onTokenReceived(message => {
|
|
33
|
+
* doSomethingElse(message);
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const onTokenReceived: OnTokenReceived = () => {
|
|
38
|
+
throw new PlatformNotSupportedError();
|
|
39
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
5
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
6
|
+
import { RequestPermissions } from '../types';
|
|
7
|
+
|
|
8
|
+
const { requestPermissions: requestPermissionsNative } =
|
|
9
|
+
loadAmplifyPushNotification();
|
|
10
|
+
|
|
11
|
+
export const requestPermissions: RequestPermissions = async input => {
|
|
12
|
+
assertIsInitialized();
|
|
13
|
+
return requestPermissionsNative(input);
|
|
14
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import { RequestPermissions } from '../types';
|
|
6
|
+
|
|
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
|
+
export const requestPermissions: RequestPermissions = async () => {
|
|
38
|
+
throw new PlatformNotSupportedError();
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
5
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
6
|
+
import { SetBadgeCount } from '../types';
|
|
7
|
+
|
|
8
|
+
const { setBadgeCount: setBadgeCountNative } = loadAmplifyPushNotification();
|
|
9
|
+
|
|
10
|
+
export const setBadgeCount: SetBadgeCount = input => {
|
|
11
|
+
assertIsInitialized();
|
|
12
|
+
setBadgeCountNative(input);
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
5
|
+
import { SetBadgeCount } from '../types';
|
|
6
|
+
|
|
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
|
+
export const setBadgeCount: SetBadgeCount = () => {
|
|
20
|
+
throw new PlatformNotSupportedError();
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
getBadgeCount,
|
|
6
|
+
getLaunchNotification,
|
|
7
|
+
getPermissionStatus,
|
|
8
|
+
identifyUser,
|
|
9
|
+
initializePushNotifications,
|
|
10
|
+
onNotificationOpened,
|
|
11
|
+
onNotificationReceivedInBackground,
|
|
12
|
+
onNotificationReceivedInForeground,
|
|
13
|
+
onTokenReceived,
|
|
14
|
+
requestPermissions,
|
|
15
|
+
setBadgeCount,
|
|
16
|
+
} from './apis';
|
|
17
|
+
export {
|
|
18
|
+
IdentifyUserInput,
|
|
19
|
+
OnNotificationOpenedInput,
|
|
20
|
+
OnNotificationReceivedInBackgroundInput,
|
|
21
|
+
OnNotificationReceivedInForegroundInput,
|
|
22
|
+
OnTokenReceivedInput,
|
|
23
|
+
RequestPermissionsInput,
|
|
24
|
+
SetBadgeCountInput,
|
|
25
|
+
} from './types/inputs';
|
|
26
|
+
export {
|
|
27
|
+
GetBadgeCountOutput,
|
|
28
|
+
GetLaunchNotificationOutput,
|
|
29
|
+
GetPermissionStatusOutput,
|
|
30
|
+
OnNotificationOpenedOutput,
|
|
31
|
+
OnNotificationReceivedInBackgroundOutput,
|
|
32
|
+
OnNotificationReceivedInForegroundOutput,
|
|
33
|
+
OnTokenReceivedOutput,
|
|
34
|
+
} from './types/outputs';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export type PinpointMessageEvent =
|
|
5
|
+
| 'opened_notification'
|
|
6
|
+
| 'received_background'
|
|
7
|
+
| 'received_foreground';
|
|
8
|
+
|
|
9
|
+
export type PinpointMessageEventSource = '_campaign' | '_journey';
|
|
10
|
+
|
|
11
|
+
export type AnalyticsEventAttributes = {
|
|
12
|
+
source: PinpointMessageEventSource;
|
|
13
|
+
attributes: Record<string, string>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
IdentifyUserInput,
|
|
6
|
+
OnNotificationOpenedInput,
|
|
7
|
+
OnNotificationReceivedInBackgroundInput,
|
|
8
|
+
OnNotificationReceivedInForegroundInput,
|
|
9
|
+
OnTokenReceivedInput,
|
|
10
|
+
RequestPermissionsInput,
|
|
11
|
+
SetBadgeCountInput,
|
|
12
|
+
} from './inputs';
|
|
13
|
+
import {
|
|
14
|
+
GetBadgeCountOutput,
|
|
15
|
+
GetLaunchNotificationOutput,
|
|
16
|
+
GetPermissionStatusOutput,
|
|
17
|
+
OnNotificationOpenedOutput,
|
|
18
|
+
OnNotificationReceivedInBackgroundOutput,
|
|
19
|
+
OnNotificationReceivedInForegroundOutput,
|
|
20
|
+
OnTokenReceivedOutput,
|
|
21
|
+
RequestPermissionsOutput,
|
|
22
|
+
} from './outputs';
|
|
23
|
+
|
|
24
|
+
export type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
|
|
25
|
+
|
|
26
|
+
export type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
|
|
27
|
+
|
|
28
|
+
export type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
|
|
29
|
+
|
|
30
|
+
export type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
|
|
31
|
+
|
|
32
|
+
export type InitializePushNotifications = () => void;
|
|
33
|
+
|
|
34
|
+
export type RequestPermissions = (
|
|
35
|
+
input?: RequestPermissionsInput
|
|
36
|
+
) => Promise<RequestPermissionsOutput>;
|
|
37
|
+
|
|
38
|
+
export type SetBadgeCount = (input: SetBadgeCountInput) => void;
|
|
39
|
+
|
|
40
|
+
export type OnNotificationOpened = (
|
|
41
|
+
input: OnNotificationOpenedInput
|
|
42
|
+
) => OnNotificationOpenedOutput;
|
|
43
|
+
|
|
44
|
+
export type OnNotificationReceivedInBackground = (
|
|
45
|
+
input: OnNotificationReceivedInBackgroundInput
|
|
46
|
+
) => OnNotificationReceivedInBackgroundOutput;
|
|
47
|
+
|
|
48
|
+
export type OnNotificationReceivedInForeground = (
|
|
49
|
+
input: OnNotificationReceivedInForegroundInput
|
|
50
|
+
) => OnNotificationReceivedInForegroundOutput;
|
|
51
|
+
|
|
52
|
+
export type OnTokenReceived = (
|
|
53
|
+
input: OnTokenReceivedInput
|
|
54
|
+
) => OnTokenReceivedOutput;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
AnalyticsEventAttributes,
|
|
6
|
+
PinpointMessageEvent,
|
|
7
|
+
PinpointMessageEventSource,
|
|
8
|
+
} from './analytics';
|
|
9
|
+
export {
|
|
10
|
+
GetBadgeCount,
|
|
11
|
+
GetLaunchNotification,
|
|
12
|
+
GetPermissionStatus,
|
|
13
|
+
IdentifyUser,
|
|
14
|
+
InitializePushNotifications,
|
|
15
|
+
OnNotificationOpened,
|
|
16
|
+
OnNotificationReceivedInBackground,
|
|
17
|
+
OnNotificationReceivedInForeground,
|
|
18
|
+
OnTokenReceived,
|
|
19
|
+
RequestPermissions,
|
|
20
|
+
SetBadgeCount,
|
|
21
|
+
} from './apis';
|
|
22
|
+
export {
|
|
23
|
+
IdentifyUserInput,
|
|
24
|
+
OnNotificationOpenedInput,
|
|
25
|
+
OnNotificationReceivedInBackgroundInput,
|
|
26
|
+
OnNotificationReceivedInForegroundInput,
|
|
27
|
+
OnTokenReceivedInput,
|
|
28
|
+
RequestPermissionsInput,
|
|
29
|
+
SetBadgeCountInput,
|
|
30
|
+
} from './inputs';
|
|
31
|
+
export {
|
|
32
|
+
GetLaunchNotificationOutput,
|
|
33
|
+
GetPermissionStatusOutput,
|
|
34
|
+
OnNotificationOpenedOutput,
|
|
35
|
+
OnNotificationReceivedInBackgroundOutput,
|
|
36
|
+
OnNotificationReceivedInForegroundOutput,
|
|
37
|
+
OnTokenReceivedOutput,
|
|
38
|
+
} from './outputs';
|
|
39
|
+
export { IdentifyUserOptions } from './options';
|
|
40
|
+
export { ChannelType } from './pushNotifications';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { IdentifyUserOptions } from './options';
|
|
5
|
+
import {
|
|
6
|
+
PushNotificationIdentifyUserInput,
|
|
7
|
+
PushNotificationRequestPermissionsInput,
|
|
8
|
+
PushNotificationSetBadgeCountInput,
|
|
9
|
+
PushNotificationOnNotificationOpenedInput,
|
|
10
|
+
PushNotificationOnNotificationReceivedInBackgroundInput,
|
|
11
|
+
PushNotificationOnNotificationReceivedInForegroundInput,
|
|
12
|
+
PushNotificationOnTokenReceivedInput,
|
|
13
|
+
} from '../../../types';
|
|
14
|
+
|
|
15
|
+
export type IdentifyUserInput =
|
|
16
|
+
PushNotificationIdentifyUserInput<IdentifyUserOptions>;
|
|
17
|
+
|
|
18
|
+
export type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
|
|
19
|
+
|
|
20
|
+
export type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
|
|
21
|
+
|
|
22
|
+
export type OnNotificationOpenedInput =
|
|
23
|
+
PushNotificationOnNotificationOpenedInput;
|
|
24
|
+
|
|
25
|
+
export type OnNotificationReceivedInBackgroundInput =
|
|
26
|
+
PushNotificationOnNotificationReceivedInBackgroundInput;
|
|
27
|
+
|
|
28
|
+
export type OnNotificationReceivedInForegroundInput =
|
|
29
|
+
PushNotificationOnNotificationReceivedInForegroundInput;
|
|
30
|
+
|
|
31
|
+
export type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PinpointServiceOptions } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options specific to Pinpoint identityUser.
|
|
8
|
+
*/
|
|
9
|
+
export type IdentifyUserOptions = PinpointServiceOptions;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
PushNotificationGetBadgeCountOutput,
|
|
6
|
+
PushNotificationGetLaunchNotificationOutput,
|
|
7
|
+
PushNotificationGetPermissionStatusOutput,
|
|
8
|
+
PushNotificationOnNotificationOpenedOutput,
|
|
9
|
+
PushNotificationOnNotificationReceivedInBackgroundOutput,
|
|
10
|
+
PushNotificationOnNotificationReceivedInForegroundOutput,
|
|
11
|
+
PushNotificationOnTokenReceivedOutput,
|
|
12
|
+
PushNotificationRequestPermissionsOutput,
|
|
13
|
+
} from '../../../types';
|
|
14
|
+
|
|
15
|
+
export type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
|
|
16
|
+
|
|
17
|
+
export type GetLaunchNotificationOutput =
|
|
18
|
+
PushNotificationGetLaunchNotificationOutput;
|
|
19
|
+
|
|
20
|
+
export type GetPermissionStatusOutput =
|
|
21
|
+
PushNotificationGetPermissionStatusOutput;
|
|
22
|
+
|
|
23
|
+
export type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
|
|
24
|
+
|
|
25
|
+
export type OnNotificationOpenedOutput =
|
|
26
|
+
PushNotificationOnNotificationOpenedOutput;
|
|
27
|
+
|
|
28
|
+
export type OnNotificationReceivedInBackgroundOutput =
|
|
29
|
+
PushNotificationOnNotificationReceivedInBackgroundOutput;
|
|
30
|
+
|
|
31
|
+
export type OnNotificationReceivedInForegroundOutput =
|
|
32
|
+
PushNotificationOnNotificationReceivedInForegroundOutput;
|
|
33
|
+
|
|
34
|
+
export type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
5
|
+
|
|
6
|
+
export type ChannelType = Parameters<typeof updateEndpoint>[0]['channelType'];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { record } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
5
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
6
|
+
import { AWSCredentials } from '@aws-amplify/core/internals/utils';
|
|
7
|
+
import { PinpointMessageEvent } from '../types';
|
|
8
|
+
import {
|
|
9
|
+
OnPushNotificationMessageHandler,
|
|
10
|
+
PushNotificationMessage,
|
|
11
|
+
} from '../../../types';
|
|
12
|
+
import { resolveCredentials } from '../../../utils';
|
|
13
|
+
import { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
14
|
+
import { getChannelType } from './getChannelType';
|
|
15
|
+
import { resolveConfig } from './resolveConfig';
|
|
16
|
+
|
|
17
|
+
const logger = new ConsoleLogger('PushNotification.recordMessageEvent');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export const createMessageEventRecorder =
|
|
23
|
+
(
|
|
24
|
+
event: PinpointMessageEvent,
|
|
25
|
+
callback?: Function
|
|
26
|
+
): OnPushNotificationMessageHandler =>
|
|
27
|
+
async message => {
|
|
28
|
+
const { credentials } = await resolveCredentials();
|
|
29
|
+
const { appId, region } = resolveConfig();
|
|
30
|
+
await recordMessageEvent({
|
|
31
|
+
appId,
|
|
32
|
+
credentials,
|
|
33
|
+
event,
|
|
34
|
+
message,
|
|
35
|
+
region,
|
|
36
|
+
});
|
|
37
|
+
callback?.();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const recordMessageEvent = async ({
|
|
41
|
+
appId,
|
|
42
|
+
credentials,
|
|
43
|
+
event,
|
|
44
|
+
message,
|
|
45
|
+
region,
|
|
46
|
+
}: {
|
|
47
|
+
appId: string;
|
|
48
|
+
credentials: AWSCredentials;
|
|
49
|
+
event: PinpointMessageEvent;
|
|
50
|
+
message: PushNotificationMessage;
|
|
51
|
+
region: string;
|
|
52
|
+
}): Promise<void> => {
|
|
53
|
+
const analyticsEvent = getAnalyticsEvent(message, event);
|
|
54
|
+
if (!analyticsEvent) {
|
|
55
|
+
logger.debug('A notification missing event information was not recorded');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
return record({
|
|
59
|
+
appId,
|
|
60
|
+
category: 'PushNotification',
|
|
61
|
+
channelType: getChannelType(),
|
|
62
|
+
credentials,
|
|
63
|
+
event: analyticsEvent,
|
|
64
|
+
region,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PinpointAnalyticsEvent } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
5
|
+
import { AnalyticsEventAttributes, PinpointMessageEvent } from '../types';
|
|
6
|
+
import { PushNotificationMessage } from '../../../types';
|
|
7
|
+
|
|
8
|
+
const ANDROID_CAMPAIGN_ACTIVITY_ID_KEY =
|
|
9
|
+
'pinpoint.campaign.campaign_activity_id';
|
|
10
|
+
const ANDROID_CAMPAIGN_ID_KEY = 'pinpoint.campaign.campaign_id';
|
|
11
|
+
const ANDROID_CAMPAIGN_TREATMENT_ID_KEY = 'pinpoint.campaign.treatment_id';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export const getAnalyticsEvent = (
|
|
17
|
+
{ data }: PushNotificationMessage,
|
|
18
|
+
event: PinpointMessageEvent
|
|
19
|
+
): PinpointAnalyticsEvent | null => {
|
|
20
|
+
if (!data) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const eventAttributes = getAnalyticsEventAttributes(data);
|
|
24
|
+
if (!eventAttributes) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const { source, attributes } = eventAttributes;
|
|
28
|
+
return {
|
|
29
|
+
attributes,
|
|
30
|
+
name: `${source}.${event}`,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const getAnalyticsEventAttributes = (
|
|
35
|
+
data: PushNotificationMessage['data']
|
|
36
|
+
): AnalyticsEventAttributes | undefined => {
|
|
37
|
+
if (!data) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (data.hasOwnProperty(ANDROID_CAMPAIGN_ID_KEY)) {
|
|
41
|
+
return {
|
|
42
|
+
source: '_campaign',
|
|
43
|
+
attributes: {
|
|
44
|
+
campaign_activity_id: data[ANDROID_CAMPAIGN_ACTIVITY_ID_KEY] as string,
|
|
45
|
+
campaign_id: data[ANDROID_CAMPAIGN_ID_KEY] as string,
|
|
46
|
+
treatment_id: data[ANDROID_CAMPAIGN_TREATMENT_ID_KEY] as string,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const pinpoint =
|
|
51
|
+
typeof data.pinpoint === 'string'
|
|
52
|
+
? JSON.parse(data.pinpoint)
|
|
53
|
+
: data.pinpoint;
|
|
54
|
+
if (pinpoint?.campaign) {
|
|
55
|
+
return {
|
|
56
|
+
source: '_campaign',
|
|
57
|
+
attributes: pinpoint.campaign,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (pinpoint?.journey) {
|
|
61
|
+
return {
|
|
62
|
+
source: '_journey',
|
|
63
|
+
attributes: pinpoint.journey,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|