@aws-amplify/notifications 2.0.1-console-preview.d745d43.0 → 2.0.1-ssr-api.df60e41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/eventListeners/eventListeners.js +7 -4
- package/lib/eventListeners/index.js +4 -4
- package/lib/eventListeners/types.d.ts +2 -2
- package/lib/eventListeners/types.js +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js +1 -1
- package/lib/inAppMessaging/errors/assertServiceError.js +1 -1
- package/lib/inAppMessaging/errors/assertValidationError.js +1 -1
- package/lib/inAppMessaging/errors/index.js +6 -6
- package/lib/inAppMessaging/errors/validation.js +1 -1
- package/lib/inAppMessaging/index.d.ts +1 -1
- package/lib/inAppMessaging/index.js +12 -11
- 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.js +10 -8
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +8 -7
- package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js +13 -11
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +11 -11
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +2 -2
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +9 -9
- package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js +12 -11
- package/lib/inAppMessaging/providers/pinpoint/types/index.js +2 -2
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib/inAppMessaging/providers/pinpoint/types/types.js +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +38 -24
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js +11 -11
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +8 -8
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +3 -3
- package/lib/inAppMessaging/types/event.d.ts +2 -2
- package/lib/inAppMessaging/types/event.js +0 -1
- package/lib/inAppMessaging/types/index.js +0 -1
- package/lib/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib/inAppMessaging/types/inputs.js +0 -1
- package/lib/inAppMessaging/types/message.d.ts +3 -3
- package/lib/inAppMessaging/types/message.js +0 -1
- package/lib/inAppMessaging/types/options.d.ts +1 -1
- package/lib/inAppMessaging/types/options.js +0 -1
- package/lib/inAppMessaging/utils/index.js +4 -4
- package/lib/inAppMessaging/utils/statusHelpers.js +6 -4
- package/lib/index.js +0 -1
- package/lib/pushNotifications/errors/PushNotificationError.js +1 -1
- package/lib/pushNotifications/errors/errorHelpers.js +5 -4
- package/lib/pushNotifications/errors/index.js +4 -4
- package/lib/pushNotifications/index.js +13 -13
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +9 -8
- package/lib/pushNotifications/providers/pinpoint/apis/index.js +12 -12
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +45 -36
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/index.js +12 -12
- package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib/pushNotifications/providers/pinpoint/types/analytics.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib/pushNotifications/providers/pinpoint/types/apis.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/index.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +10 -8
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +4 -3
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +7 -5
- package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +6 -5
- package/lib/pushNotifications/types/errors.js +1 -1
- package/lib/pushNotifications/types/index.js +19 -3
- package/lib/pushNotifications/types/inputs.d.ts +7 -7
- package/lib/pushNotifications/types/inputs.js +0 -1
- package/lib/pushNotifications/types/options.d.ts +1 -1
- package/lib/pushNotifications/types/options.js +0 -1
- package/lib/pushNotifications/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/types/outputs.js +0 -1
- package/lib/pushNotifications/types/pushNotifications.d.ts +3 -3
- package/lib/pushNotifications/types/pushNotifications.js +0 -1
- package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +3 -2
- package/lib/pushNotifications/utils/index.d.ts +1 -1
- package/lib/pushNotifications/utils/index.js +8 -8
- package/lib/pushNotifications/utils/initializationManager.js +5 -3
- package/lib/pushNotifications/utils/resolveCredentials.js +5 -4
- package/lib/pushNotifications/utils/tokenManager.js +5 -3
- package/lib/tsconfig.tsbuildinfo +1 -7201
- package/lib-esm/eventListeners/eventListeners.js +0 -1
- package/lib-esm/eventListeners/index.js +0 -1
- package/lib-esm/eventListeners/types.d.ts +2 -2
- package/lib-esm/eventListeners/types.js +1 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
- package/lib-esm/inAppMessaging/errors/index.js +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js +0 -1
- package/lib-esm/inAppMessaging/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/index.js +1 -2
- 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.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
- package/lib-esm/inAppMessaging/types/event.d.ts +2 -2
- package/lib-esm/inAppMessaging/types/event.js +1 -1
- package/lib-esm/inAppMessaging/types/index.js +1 -1
- package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/inputs.js +1 -1
- package/lib-esm/inAppMessaging/types/message.d.ts +3 -3
- package/lib-esm/inAppMessaging/types/message.js +1 -1
- package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/options.js +1 -1
- package/lib-esm/inAppMessaging/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
- package/lib-esm/index.js +0 -1
- package/lib-esm/pushNotifications/errors/PushNotificationError.js +0 -1
- package/lib-esm/pushNotifications/errors/errorHelpers.js +0 -1
- package/lib-esm/pushNotifications/errors/index.js +0 -1
- package/lib-esm/pushNotifications/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +2 -3
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +30 -23
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +2 -2
- package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +1 -2
- package/lib-esm/pushNotifications/types/errors.js +0 -1
- package/lib-esm/pushNotifications/types/index.js +4 -1
- package/lib-esm/pushNotifications/types/inputs.d.ts +7 -7
- package/lib-esm/pushNotifications/types/inputs.js +1 -1
- package/lib-esm/pushNotifications/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/types/options.js +1 -1
- package/lib-esm/pushNotifications/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/types/outputs.js +1 -1
- package/lib-esm/pushNotifications/types/pushNotifications.d.ts +3 -3
- package/lib-esm/pushNotifications/types/pushNotifications.js +1 -1
- package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +0 -1
- package/lib-esm/pushNotifications/utils/index.d.ts +1 -1
- package/lib-esm/pushNotifications/utils/index.js +1 -2
- package/lib-esm/pushNotifications/utils/initializationManager.js +0 -1
- package/lib-esm/pushNotifications/utils/resolveCredentials.js +0 -1
- package/lib-esm/pushNotifications/utils/tokenManager.js +0 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -7201
- package/package.json +51 -14
- package/src/inAppMessaging/index.ts +1 -0
- package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
- package/src/inAppMessaging/providers/pinpoint/apis/index.ts +1 -0
- package/src/inAppMessaging/providers/pinpoint/index.ts +1 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +50 -40
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +5 -4
- package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +3 -3
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +2 -1
- package/src/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.ts +1 -1
- package/src/pushNotifications/types/pushNotifications.ts +1 -1
- package/src/pushNotifications/utils/index.ts +1 -1
- package/lib/eventListeners/eventListeners.js.map +0 -1
- package/lib/eventListeners/index.js.map +0 -1
- package/lib/eventListeners/types.js.map +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib/inAppMessaging/errors/index.js.map +0 -1
- package/lib/inAppMessaging/errors/validation.js.map +0 -1
- package/lib/inAppMessaging/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib/inAppMessaging/types/event.js.map +0 -1
- package/lib/inAppMessaging/types/index.js.map +0 -1
- package/lib/inAppMessaging/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/types/message.js.map +0 -1
- package/lib/inAppMessaging/types/options.js.map +0 -1
- package/lib/inAppMessaging/utils/index.js.map +0 -1
- package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/pushNotifications/errors/PushNotificationError.js.map +0 -1
- package/lib/pushNotifications/errors/errorHelpers.js.map +0 -1
- package/lib/pushNotifications/errors/index.js.map +0 -1
- package/lib/pushNotifications/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
- package/lib/pushNotifications/types/errors.js.map +0 -1
- package/lib/pushNotifications/types/index.js.map +0 -1
- package/lib/pushNotifications/types/inputs.js.map +0 -1
- package/lib/pushNotifications/types/options.js.map +0 -1
- package/lib/pushNotifications/types/outputs.js.map +0 -1
- package/lib/pushNotifications/types/pushNotifications.js.map +0 -1
- package/lib/pushNotifications/utils/index.js.map +0 -1
- package/lib/pushNotifications/utils/initializationManager.js.map +0 -1
- package/lib/pushNotifications/utils/resolveConfig.js.map +0 -1
- package/lib/pushNotifications/utils/resolveCredentials.js.map +0 -1
- package/lib/pushNotifications/utils/tokenManager.js.map +0 -1
- package/lib-esm/eventListeners/eventListeners.js.map +0 -1
- package/lib-esm/eventListeners/index.js.map +0 -1
- package/lib-esm/eventListeners/types.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
- package/lib-esm/inAppMessaging/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib-esm/inAppMessaging/types/event.js.map +0 -1
- package/lib-esm/inAppMessaging/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/types/message.js.map +0 -1
- package/lib-esm/inAppMessaging/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/pushNotifications/errors/PushNotificationError.js.map +0 -1
- package/lib-esm/pushNotifications/errors/errorHelpers.js.map +0 -1
- package/lib-esm/pushNotifications/errors/index.js.map +0 -1
- package/lib-esm/pushNotifications/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
- package/lib-esm/pushNotifications/types/errors.js.map +0 -1
- package/lib-esm/pushNotifications/types/index.js.map +0 -1
- package/lib-esm/pushNotifications/types/inputs.js.map +0 -1
- package/lib-esm/pushNotifications/types/options.js.map +0 -1
- package/lib-esm/pushNotifications/types/outputs.js.map +0 -1
- package/lib-esm/pushNotifications/types/pushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/utils/index.js.map +0 -1
- package/lib-esm/pushNotifications/utils/initializationManager.js.map +0 -1
- package/lib-esm/pushNotifications/utils/resolveConfig.js.map +0 -1
- package/lib-esm/pushNotifications/utils/resolveCredentials.js.map +0 -1
- package/lib-esm/pushNotifications/utils/tokenManager.js.map +0 -1
- /package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
- /package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
- /package/src/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.ts +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.assertIsInitialized = exports.isInitialized = exports.initialize = void 0;
|
|
5
6
|
const errors_1 = require("../errors");
|
|
6
7
|
let initialized = false;
|
|
7
8
|
/**
|
|
@@ -9,17 +10,18 @@ let initialized = false;
|
|
|
9
10
|
*
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
const initialize = () => {
|
|
13
14
|
initialized = true;
|
|
14
15
|
};
|
|
16
|
+
exports.initialize = initialize;
|
|
15
17
|
/**
|
|
16
18
|
* Returns the initialization status of In-App Messaging.
|
|
17
19
|
*
|
|
18
20
|
* @internal
|
|
19
21
|
*/
|
|
20
|
-
|
|
22
|
+
const isInitialized = () => initialized;
|
|
23
|
+
exports.isInitialized = isInitialized;
|
|
21
24
|
function assertIsInitialized() {
|
|
22
|
-
errors_1.assertValidationError(exports.isInitialized(), errors_1.InAppMessagingValidationErrorCode.NotInitialized);
|
|
25
|
+
(0, errors_1.assertValidationError)((0, exports.isInitialized)(), errors_1.InAppMessagingValidationErrorCode.NotInitialized);
|
|
23
26
|
}
|
|
24
27
|
exports.assertIsInitialized = assertIsInitialized;
|
|
25
|
-
//# sourceMappingURL=statusHelpers.js.map
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.PushNotificationError = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
class PushNotificationError extends utils_1.AmplifyError {
|
|
7
8
|
constructor(params) {
|
|
@@ -13,4 +14,3 @@ class PushNotificationError extends utils_1.AmplifyError {
|
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.PushNotificationError = PushNotificationError;
|
|
16
|
-
//# sourceMappingURL=PushNotificationError.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.assertIsInitialized = exports.assert = exports.PushNotificationValidationErrorCode = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const utils_2 = require("../utils");
|
|
7
8
|
const PushNotificationError_1 = require("./PushNotificationError");
|
|
@@ -27,8 +28,8 @@ const pushNotificationValidationErrorMap = {
|
|
|
27
28
|
recoverySuggestion: 'Please make sure to first call `initializePushNotifications`.',
|
|
28
29
|
},
|
|
29
30
|
};
|
|
30
|
-
exports.assert = utils_1.createAssertionFunction(pushNotificationValidationErrorMap, PushNotificationError_1.PushNotificationError);
|
|
31
|
-
|
|
32
|
-
exports.assert(utils_2.isInitialized(), PushNotificationValidationErrorCode.NotInitialized);
|
|
31
|
+
exports.assert = (0, utils_1.createAssertionFunction)(pushNotificationValidationErrorMap, PushNotificationError_1.PushNotificationError);
|
|
32
|
+
const assertIsInitialized = () => {
|
|
33
|
+
(0, exports.assert)((0, utils_2.isInitialized)(), PushNotificationValidationErrorCode.NotInitialized);
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
exports.assertIsInitialized = assertIsInitialized;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.PushNotificationValidationErrorCode = exports.assert = exports.PushNotificationError = void 0;
|
|
5
6
|
var PushNotificationError_1 = require("./PushNotificationError");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "PushNotificationError", { enumerable: true, get: function () { return PushNotificationError_1.PushNotificationError; } });
|
|
7
8
|
var errorHelpers_1 = require("./errorHelpers");
|
|
8
|
-
exports
|
|
9
|
-
exports
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return errorHelpers_1.assert; } });
|
|
10
|
+
Object.defineProperty(exports, "PushNotificationValidationErrorCode", { enumerable: true, get: function () { return errorHelpers_1.PushNotificationValidationErrorCode; } });
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.PushNotificationError = exports.setBadgeCount = exports.requestPermissions = exports.onTokenReceived = exports.onNotificationReceivedInForeground = exports.onNotificationReceivedInBackground = exports.onNotificationOpened = exports.initializePushNotifications = exports.identifyUser = exports.getPermissionStatus = exports.getLaunchNotification = exports.getBadgeCount = void 0;
|
|
5
6
|
var pinpoint_1 = require("./providers/pinpoint");
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
8
|
-
exports
|
|
9
|
-
exports
|
|
10
|
-
exports
|
|
11
|
-
exports
|
|
12
|
-
exports
|
|
13
|
-
exports
|
|
14
|
-
exports
|
|
15
|
-
exports
|
|
16
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "getBadgeCount", { enumerable: true, get: function () { return pinpoint_1.getBadgeCount; } });
|
|
8
|
+
Object.defineProperty(exports, "getLaunchNotification", { enumerable: true, get: function () { return pinpoint_1.getLaunchNotification; } });
|
|
9
|
+
Object.defineProperty(exports, "getPermissionStatus", { enumerable: true, get: function () { return pinpoint_1.getPermissionStatus; } });
|
|
10
|
+
Object.defineProperty(exports, "identifyUser", { enumerable: true, get: function () { return pinpoint_1.identifyUser; } });
|
|
11
|
+
Object.defineProperty(exports, "initializePushNotifications", { enumerable: true, get: function () { return pinpoint_1.initializePushNotifications; } });
|
|
12
|
+
Object.defineProperty(exports, "onNotificationOpened", { enumerable: true, get: function () { return pinpoint_1.onNotificationOpened; } });
|
|
13
|
+
Object.defineProperty(exports, "onNotificationReceivedInBackground", { enumerable: true, get: function () { return pinpoint_1.onNotificationReceivedInBackground; } });
|
|
14
|
+
Object.defineProperty(exports, "onNotificationReceivedInForeground", { enumerable: true, get: function () { return pinpoint_1.onNotificationReceivedInForeground; } });
|
|
15
|
+
Object.defineProperty(exports, "onTokenReceived", { enumerable: true, get: function () { return pinpoint_1.onTokenReceived; } });
|
|
16
|
+
Object.defineProperty(exports, "requestPermissions", { enumerable: true, get: function () { return pinpoint_1.requestPermissions; } });
|
|
17
|
+
Object.defineProperty(exports, "setBadgeCount", { enumerable: true, get: function () { return pinpoint_1.setBadgeCount; } });
|
|
17
18
|
var errors_1 = require("./errors");
|
|
18
|
-
exports
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
19
|
+
Object.defineProperty(exports, "PushNotificationError", { enumerable: true, get: function () { return errors_1.PushNotificationError; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getBadgeCount = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Returns the current badge count (the number next to your app's icon). This function is safe to call (but will be
|
|
@@ -15,7 +16,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
15
16
|
* const badgeCount = await getBadgeCount();
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
const getBadgeCount = async () => {
|
|
19
20
|
throw new utils_1.PlatformNotSupportedError();
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
+
exports.getBadgeCount = getBadgeCount;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getBadgeCount = void 0;
|
|
5
6
|
const react_native_1 = require("@aws-amplify/react-native");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
const { getBadgeCount: getBadgeCountNative } = react_native_1.loadAmplifyPushNotification();
|
|
8
|
-
|
|
9
|
-
errorHelpers_1.assertIsInitialized();
|
|
8
|
+
const { getBadgeCount: getBadgeCountNative } = (0, react_native_1.loadAmplifyPushNotification)();
|
|
9
|
+
const getBadgeCount = async () => {
|
|
10
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
11
|
return getBadgeCountNative();
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
exports.getBadgeCount = getBadgeCount;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getLaunchNotification = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Returns the notification which launched your app from a terminated state. The launch notification is consumed by
|
|
@@ -19,7 +20,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
19
20
|
* const launchNotification = await getLaunchNotification();
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
const getLaunchNotification = async () => {
|
|
23
24
|
throw new utils_1.PlatformNotSupportedError();
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
exports.getLaunchNotification = getLaunchNotification;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getLaunchNotification = void 0;
|
|
5
6
|
const react_native_1 = require("@aws-amplify/react-native");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
const { getLaunchNotification: getLaunchNotificationNative } = react_native_1.loadAmplifyPushNotification();
|
|
8
|
-
|
|
9
|
-
errorHelpers_1.assertIsInitialized();
|
|
8
|
+
const { getLaunchNotification: getLaunchNotificationNative } = (0, react_native_1.loadAmplifyPushNotification)();
|
|
9
|
+
const getLaunchNotification = async () => {
|
|
10
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
11
|
return getLaunchNotificationNative();
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
exports.getLaunchNotification = getLaunchNotification;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getPermissionStatus = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Returns a string representing the current status of user permissions to display push notifications. The possible
|
|
@@ -28,7 +29,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
28
29
|
* ```ts
|
|
29
30
|
* const permissionStatus = await getPermissionStatus();
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
const getPermissionStatus = async () => {
|
|
32
33
|
throw new utils_1.PlatformNotSupportedError();
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
exports.getPermissionStatus = getPermissionStatus;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getPermissionStatus = void 0;
|
|
5
6
|
const react_native_1 = require("@aws-amplify/react-native");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
const { getPermissionStatus: getPermissionStatusNative } = react_native_1.loadAmplifyPushNotification();
|
|
8
|
-
|
|
9
|
-
errorHelpers_1.assertIsInitialized();
|
|
8
|
+
const { getPermissionStatus: getPermissionStatusNative } = (0, react_native_1.loadAmplifyPushNotification)();
|
|
9
|
+
const getPermissionStatus = async () => {
|
|
10
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
11
|
return getPermissionStatusNative();
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
exports.getPermissionStatus = getPermissionStatus;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.identifyUser = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
|
|
@@ -54,7 +55,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
54
55
|
* },
|
|
55
56
|
* });
|
|
56
57
|
*/
|
|
57
|
-
|
|
58
|
+
const identifyUser = async () => {
|
|
58
59
|
throw new utils_1.PlatformNotSupportedError();
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
exports.identifyUser = identifyUser;
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.identifyUser = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
|
|
7
8
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
8
9
|
const utils_2 = require("../../../utils");
|
|
9
10
|
const utils_3 = require("../utils");
|
|
10
|
-
|
|
11
|
-
errorHelpers_1.assertIsInitialized();
|
|
12
|
-
const { credentials, identityId } = await utils_2.resolveCredentials();
|
|
13
|
-
const { appId, region } =
|
|
11
|
+
const identifyUser = async ({ userId, userProfile, options, }) => {
|
|
12
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
13
|
+
const { credentials, identityId } = await (0, utils_2.resolveCredentials)();
|
|
14
|
+
const { appId, region } = (0, utils_3.resolveConfig)();
|
|
14
15
|
const { address, optOut, userAttributes } = options ?? {};
|
|
15
|
-
pinpoint_1.updateEndpoint({
|
|
16
|
+
(0, pinpoint_1.updateEndpoint)({
|
|
16
17
|
address,
|
|
17
|
-
channelType: utils_3.getChannelType(),
|
|
18
|
+
channelType: (0, utils_3.getChannelType)(),
|
|
18
19
|
optOut,
|
|
19
20
|
appId,
|
|
20
21
|
category: 'PushNotification',
|
|
@@ -24,7 +25,7 @@ exports.identifyUser = async ({ userId, userProfile, options, }) => {
|
|
|
24
25
|
userAttributes,
|
|
25
26
|
userId,
|
|
26
27
|
userProfile,
|
|
27
|
-
userAgentValue:
|
|
28
|
+
userAgentValue: (0, utils_2.getPushNotificationUserAgentString)(utils_1.PushNotificationAction.IdentifyUser),
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
exports.identifyUser = identifyUser;
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.setBadgeCount = exports.requestPermissions = exports.onTokenReceived = exports.onNotificationReceivedInForeground = exports.onNotificationReceivedInBackground = exports.onNotificationOpened = exports.initializePushNotifications = exports.identifyUser = exports.getPermissionStatus = exports.getLaunchNotification = exports.getBadgeCount = void 0;
|
|
5
6
|
var getBadgeCount_1 = require("./getBadgeCount");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "getBadgeCount", { enumerable: true, get: function () { return getBadgeCount_1.getBadgeCount; } });
|
|
7
8
|
var getLaunchNotification_1 = require("./getLaunchNotification");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "getLaunchNotification", { enumerable: true, get: function () { return getLaunchNotification_1.getLaunchNotification; } });
|
|
9
10
|
var getPermissionStatus_1 = require("./getPermissionStatus");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "getPermissionStatus", { enumerable: true, get: function () { return getPermissionStatus_1.getPermissionStatus; } });
|
|
11
12
|
var identifyUser_1 = require("./identifyUser");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "identifyUser", { enumerable: true, get: function () { return identifyUser_1.identifyUser; } });
|
|
13
14
|
var initializePushNotifications_1 = require("./initializePushNotifications");
|
|
14
|
-
exports
|
|
15
|
+
Object.defineProperty(exports, "initializePushNotifications", { enumerable: true, get: function () { return initializePushNotifications_1.initializePushNotifications; } });
|
|
15
16
|
var onNotificationOpened_1 = require("./onNotificationOpened");
|
|
16
|
-
exports
|
|
17
|
+
Object.defineProperty(exports, "onNotificationOpened", { enumerable: true, get: function () { return onNotificationOpened_1.onNotificationOpened; } });
|
|
17
18
|
var onNotificationReceivedInBackground_1 = require("./onNotificationReceivedInBackground");
|
|
18
|
-
exports
|
|
19
|
+
Object.defineProperty(exports, "onNotificationReceivedInBackground", { enumerable: true, get: function () { return onNotificationReceivedInBackground_1.onNotificationReceivedInBackground; } });
|
|
19
20
|
var onNotificationReceivedInForeground_1 = require("./onNotificationReceivedInForeground");
|
|
20
|
-
exports
|
|
21
|
+
Object.defineProperty(exports, "onNotificationReceivedInForeground", { enumerable: true, get: function () { return onNotificationReceivedInForeground_1.onNotificationReceivedInForeground; } });
|
|
21
22
|
var onTokenReceived_1 = require("./onTokenReceived");
|
|
22
|
-
exports
|
|
23
|
+
Object.defineProperty(exports, "onTokenReceived", { enumerable: true, get: function () { return onTokenReceived_1.onTokenReceived; } });
|
|
23
24
|
var requestPermissions_1 = require("./requestPermissions");
|
|
24
|
-
exports
|
|
25
|
+
Object.defineProperty(exports, "requestPermissions", { enumerable: true, get: function () { return requestPermissions_1.requestPermissions; } });
|
|
25
26
|
var setBadgeCount_1 = require("./setBadgeCount");
|
|
26
|
-
exports
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
27
|
+
Object.defineProperty(exports, "setBadgeCount", { enumerable: true, get: function () { return setBadgeCount_1.setBadgeCount; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.initializePushNotifications = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Initialize and set up the push notification category. The category must be first initialized before all other
|
|
@@ -18,7 +19,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
18
19
|
* initializePushNotifications();
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
const initializePushNotifications = () => {
|
|
22
23
|
throw new utils_1.PlatformNotSupportedError();
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
exports.initializePushNotifications = initializePushNotifications;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.initializePushNotifications = void 0;
|
|
5
6
|
const core_1 = require("@aws-amplify/core");
|
|
6
7
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
7
8
|
const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
|
|
@@ -9,31 +10,21 @@ const react_native_1 = require("@aws-amplify/react-native");
|
|
|
9
10
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
10
11
|
const utils_2 = require("../../../utils");
|
|
11
12
|
const utils_3 = require("../utils");
|
|
12
|
-
const { addMessageEventListener, addTokenEventListener, completeNotification, getConstants, registerHeadlessTask, } = react_native_1.loadAmplifyPushNotification();
|
|
13
|
+
const { addMessageEventListener, addTokenEventListener, completeNotification, getConstants, registerHeadlessTask, } = (0, react_native_1.loadAmplifyPushNotification)();
|
|
13
14
|
const logger = new core_1.ConsoleLogger('Notifications.PushNotification');
|
|
14
15
|
const BACKGROUND_TASK_TIMEOUT = 25; // seconds
|
|
15
|
-
|
|
16
|
-
if (utils_2.isInitialized()) {
|
|
16
|
+
const initializePushNotifications = () => {
|
|
17
|
+
if ((0, utils_2.isInitialized)()) {
|
|
17
18
|
logger.info('Push notifications have already been enabled');
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
addNativeListeners();
|
|
21
22
|
addAnalyticsListeners();
|
|
22
|
-
utils_2.initialize();
|
|
23
|
-
};
|
|
24
|
-
const addAnalyticsListeners = () => {
|
|
25
|
-
let launchNotificationOpenedListenerRemover;
|
|
26
|
-
// wire up default Pinpoint message event handling
|
|
27
|
-
eventListeners_1.addEventListener('backgroundMessageReceived', utils_3.createMessageEventRecorder('backgroundMessageReceived'));
|
|
28
|
-
eventListeners_1.addEventListener('foregroundMessageReceived', utils_3.createMessageEventRecorder('foregroundMessageReceived'));
|
|
29
|
-
launchNotificationOpenedListenerRemover = eventListeners_1.addEventListener('launchNotificationsOpened', utils_3.createMessageEventRecorder('notificationOpened',
|
|
30
|
-
// once we are done with it we can remove the listener
|
|
31
|
-
launchNotificationOpenedListenerRemover?.remove));
|
|
32
|
-
eventListeners_1.addEventListener('notificationOpened', utils_3.createMessageEventRecorder('notificationOpened',
|
|
33
|
-
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
34
|
-
launchNotificationOpenedListenerRemover?.remove));
|
|
23
|
+
(0, utils_2.initialize)();
|
|
35
24
|
};
|
|
25
|
+
exports.initializePushNotifications = initializePushNotifications;
|
|
36
26
|
const addNativeListeners = () => {
|
|
27
|
+
let launchNotificationOpenedListener;
|
|
37
28
|
const { NativeEvent, NativeHeadlessTaskKey } = getConstants();
|
|
38
29
|
const { BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED, TOKEN_RECEIVED, } = NativeEvent;
|
|
39
30
|
// on platforms that can handle headless tasks, register one to broadcast background message received to
|
|
@@ -41,7 +32,7 @@ const addNativeListeners = () => {
|
|
|
41
32
|
if (NativeHeadlessTaskKey) {
|
|
42
33
|
registerHeadlessTask(async (message) => {
|
|
43
34
|
// keep headless task running until handlers have completed their work
|
|
44
|
-
await eventListeners_1.notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message);
|
|
35
|
+
await (0, eventListeners_1.notifyEventListenersAndAwaitHandlers)('backgroundMessageReceived', message);
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
38
|
else if (BACKGROUND_MESSAGE_RECEIVED) {
|
|
@@ -51,7 +42,7 @@ const addNativeListeners = () => {
|
|
|
51
42
|
// keep background task running until handlers have completed their work
|
|
52
43
|
try {
|
|
53
44
|
await Promise.race([
|
|
54
|
-
eventListeners_1.notifyEventListenersAndAwaitHandlers('backgroundMessageReceived', message),
|
|
45
|
+
(0, eventListeners_1.notifyEventListenersAndAwaitHandlers)('backgroundMessageReceived', message),
|
|
55
46
|
// background tasks will get suspended and all future tasks be deprioritized by the OS if they run for
|
|
56
47
|
// more than 30 seconds so we reject with a error in a shorter amount of time to prevent this from
|
|
57
48
|
// happening
|
|
@@ -65,23 +56,24 @@ const addNativeListeners = () => {
|
|
|
65
56
|
}
|
|
66
57
|
finally {
|
|
67
58
|
// notify native module that handlers have completed their work (or timed out)
|
|
68
|
-
if (completionHandlerId)
|
|
59
|
+
if (completionHandlerId) {
|
|
69
60
|
completeNotification(completionHandlerId);
|
|
61
|
+
}
|
|
70
62
|
}
|
|
71
63
|
});
|
|
72
64
|
}
|
|
73
65
|
addMessageEventListener(
|
|
74
66
|
// listen for native foreground message received event and broadcast to library listeners
|
|
75
67
|
FOREGROUND_MESSAGE_RECEIVED, message => {
|
|
76
|
-
eventListeners_1.notifyEventListeners('foregroundMessageReceived', message);
|
|
68
|
+
(0, eventListeners_1.notifyEventListeners)('foregroundMessageReceived', message);
|
|
77
69
|
});
|
|
78
|
-
|
|
70
|
+
launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
|
|
79
71
|
? addMessageEventListener(
|
|
80
72
|
// listen for native notification opened app (user tapped on notification, opening the app from quit -
|
|
81
73
|
// not background - state) event. This is broadcasted to an internal listener only as it is not intended
|
|
82
74
|
// for use otherwise as it produces inconsistent results when used within React Native app context
|
|
83
75
|
LAUNCH_NOTIFICATION_OPENED, message => {
|
|
84
|
-
eventListeners_1.notifyEventListeners('
|
|
76
|
+
(0, eventListeners_1.notifyEventListeners)('launchNotificationOpened', message);
|
|
85
77
|
// once we are done with it we can remove the listener
|
|
86
78
|
launchNotificationOpenedListener?.remove();
|
|
87
79
|
})
|
|
@@ -90,35 +82,52 @@ const addNativeListeners = () => {
|
|
|
90
82
|
// listen for native notification opened (user tapped on notification, opening the app from background -
|
|
91
83
|
// not quit - state) event and broadcast to library listeners
|
|
92
84
|
NOTIFICATION_OPENED, message => {
|
|
93
|
-
eventListeners_1.notifyEventListeners('notificationOpened', message);
|
|
85
|
+
(0, eventListeners_1.notifyEventListeners)('notificationOpened', message);
|
|
94
86
|
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
95
87
|
launchNotificationOpenedListener?.remove();
|
|
96
88
|
});
|
|
97
89
|
addTokenEventListener(
|
|
98
90
|
// listen for native new token event, automatically re-register device with provider using new token and
|
|
99
91
|
// broadcast to library listeners
|
|
100
|
-
TOKEN_RECEIVED, token => {
|
|
92
|
+
TOKEN_RECEIVED, async (token) => {
|
|
101
93
|
// avoid a race condition where two endpoints are created with the same token on a fresh install
|
|
102
|
-
if (utils_2.getToken() === token) {
|
|
94
|
+
if ((0, utils_2.getToken)() === token) {
|
|
103
95
|
return;
|
|
104
96
|
}
|
|
105
|
-
utils_2.setToken(token);
|
|
106
|
-
|
|
107
|
-
|
|
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
|
+
}
|
|
108
106
|
});
|
|
109
107
|
};
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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,
|
|
115
125
|
appId,
|
|
116
126
|
category: 'PushNotification',
|
|
117
127
|
credentials,
|
|
118
128
|
region,
|
|
119
|
-
channelType: utils_3.getChannelType(),
|
|
129
|
+
channelType: (0, utils_3.getChannelType)(),
|
|
120
130
|
identityId,
|
|
121
|
-
userAgentValue:
|
|
131
|
+
userAgentValue: (0, utils_2.getPushNotificationUserAgentString)(utils_1.PushNotificationAction.InitializePushNotifications),
|
|
122
132
|
});
|
|
123
133
|
};
|
|
124
|
-
//# sourceMappingURL=initializePushNotifications.native.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationOpened = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Registers a listener that will be triggered when a notification is opened by user.
|
|
@@ -28,7 +29,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
28
29
|
* });
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
const onNotificationOpened = () => {
|
|
32
33
|
throw new utils_1.PlatformNotSupportedError();
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
exports.onNotificationOpened = onNotificationOpened;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationOpened = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
|
|
8
|
-
errorHelpers_1.assertIsInitialized();
|
|
9
|
-
return eventListeners_1.addEventListener('notificationOpened', input);
|
|
8
|
+
const onNotificationOpened = input => {
|
|
9
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
|
+
return (0, eventListeners_1.addEventListener)('notificationOpened', input);
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
exports.onNotificationOpened = onNotificationOpened;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationReceivedInBackground = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Registers a listener that will be triggered when a notification is received while app is in a background state.
|
|
@@ -44,7 +45,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
44
45
|
* });
|
|
45
46
|
* ```
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
const onNotificationReceivedInBackground = () => {
|
|
48
49
|
throw new utils_1.PlatformNotSupportedError();
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
exports.onNotificationReceivedInBackground = onNotificationReceivedInBackground;
|
package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationReceivedInBackground = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
|
|
8
|
-
errorHelpers_1.assertIsInitialized();
|
|
9
|
-
return eventListeners_1.addEventListener('backgroundMessageReceived', input);
|
|
8
|
+
const onNotificationReceivedInBackground = input => {
|
|
9
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
|
+
return (0, eventListeners_1.addEventListener)('backgroundMessageReceived', input);
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
exports.onNotificationReceivedInBackground = onNotificationReceivedInBackground;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationReceivedInForeground = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* Registers a listener that will be triggered when a notification is received while app is in a foreground state.
|
|
@@ -28,7 +29,7 @@ const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
|
28
29
|
* });
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
const onNotificationReceivedInForeground = () => {
|
|
32
33
|
throw new utils_1.PlatformNotSupportedError();
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
exports.onNotificationReceivedInForeground = onNotificationReceivedInForeground;
|
package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onNotificationReceivedInForeground = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const errorHelpers_1 = require("../../../errors/errorHelpers");
|
|
7
|
-
|
|
8
|
-
errorHelpers_1.assertIsInitialized();
|
|
9
|
-
return eventListeners_1.addEventListener('foregroundMessageReceived', input);
|
|
8
|
+
const onNotificationReceivedInForeground = input => {
|
|
9
|
+
(0, errorHelpers_1.assertIsInitialized)();
|
|
10
|
+
return (0, eventListeners_1.addEventListener)('foregroundMessageReceived', input);
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
exports.onNotificationReceivedInForeground = onNotificationReceivedInForeground;
|