@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
|
@@ -11,4 +11,3 @@ export { onNotificationReceivedInForeground } from './onNotificationReceivedInFo
|
|
|
11
11
|
export { onTokenReceived } from './onTokenReceived';
|
|
12
12
|
export { requestPermissions } from './requestPermissions';
|
|
13
13
|
export { setBadgeCount } from './setBadgeCount';
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js
CHANGED
|
@@ -5,8 +5,8 @@ import { PushNotificationAction } from '@aws-amplify/core/internals/utils';
|
|
|
5
5
|
import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
6
6
|
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
7
7
|
import { addEventListener, notifyEventListeners, notifyEventListenersAndAwaitHandlers, } from '../../../../eventListeners';
|
|
8
|
-
import { getToken, initialize, isInitialized,
|
|
9
|
-
import { createMessageEventRecorder, getChannelType,
|
|
8
|
+
import { getPushNotificationUserAgentString, getToken, initialize, isInitialized, resolveCredentials, setToken, } from '../../../utils';
|
|
9
|
+
import { createMessageEventRecorder, getChannelType, resolveConfig, } from '../utils';
|
|
10
10
|
const { addMessageEventListener, addTokenEventListener, completeNotification, getConstants, registerHeadlessTask, } = loadAmplifyPushNotification();
|
|
11
11
|
const logger = new ConsoleLogger('Notifications.PushNotification');
|
|
12
12
|
const BACKGROUND_TASK_TIMEOUT = 25; // seconds
|
|
@@ -19,19 +19,8 @@ export const initializePushNotifications = () => {
|
|
|
19
19
|
addAnalyticsListeners();
|
|
20
20
|
initialize();
|
|
21
21
|
};
|
|
22
|
-
const addAnalyticsListeners = () => {
|
|
23
|
-
let launchNotificationOpenedListenerRemover;
|
|
24
|
-
// wire up default Pinpoint message event handling
|
|
25
|
-
addEventListener('backgroundMessageReceived', createMessageEventRecorder('backgroundMessageReceived'));
|
|
26
|
-
addEventListener('foregroundMessageReceived', createMessageEventRecorder('foregroundMessageReceived'));
|
|
27
|
-
launchNotificationOpenedListenerRemover = addEventListener('launchNotificationsOpened', createMessageEventRecorder('notificationOpened',
|
|
28
|
-
// once we are done with it we can remove the listener
|
|
29
|
-
launchNotificationOpenedListenerRemover?.remove));
|
|
30
|
-
addEventListener('notificationOpened', createMessageEventRecorder('notificationOpened',
|
|
31
|
-
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
32
|
-
launchNotificationOpenedListenerRemover?.remove));
|
|
33
|
-
};
|
|
34
22
|
const addNativeListeners = () => {
|
|
23
|
+
let launchNotificationOpenedListener;
|
|
35
24
|
const { NativeEvent, NativeHeadlessTaskKey } = getConstants();
|
|
36
25
|
const { BACKGROUND_MESSAGE_RECEIVED, FOREGROUND_MESSAGE_RECEIVED, LAUNCH_NOTIFICATION_OPENED, NOTIFICATION_OPENED, TOKEN_RECEIVED, } = NativeEvent;
|
|
37
26
|
// on platforms that can handle headless tasks, register one to broadcast background message received to
|
|
@@ -63,8 +52,9 @@ const addNativeListeners = () => {
|
|
|
63
52
|
}
|
|
64
53
|
finally {
|
|
65
54
|
// notify native module that handlers have completed their work (or timed out)
|
|
66
|
-
if (completionHandlerId)
|
|
55
|
+
if (completionHandlerId) {
|
|
67
56
|
completeNotification(completionHandlerId);
|
|
57
|
+
}
|
|
68
58
|
}
|
|
69
59
|
});
|
|
70
60
|
}
|
|
@@ -73,13 +63,13 @@ const addNativeListeners = () => {
|
|
|
73
63
|
FOREGROUND_MESSAGE_RECEIVED, message => {
|
|
74
64
|
notifyEventListeners('foregroundMessageReceived', message);
|
|
75
65
|
});
|
|
76
|
-
|
|
66
|
+
launchNotificationOpenedListener = LAUNCH_NOTIFICATION_OPENED
|
|
77
67
|
? addMessageEventListener(
|
|
78
68
|
// listen for native notification opened app (user tapped on notification, opening the app from quit -
|
|
79
69
|
// not background - state) event. This is broadcasted to an internal listener only as it is not intended
|
|
80
70
|
// for use otherwise as it produces inconsistent results when used within React Native app context
|
|
81
71
|
LAUNCH_NOTIFICATION_OPENED, message => {
|
|
82
|
-
notifyEventListeners('
|
|
72
|
+
notifyEventListeners('launchNotificationOpened', message);
|
|
83
73
|
// once we are done with it we can remove the listener
|
|
84
74
|
launchNotificationOpenedListener?.remove();
|
|
85
75
|
})
|
|
@@ -95,21 +85,39 @@ const addNativeListeners = () => {
|
|
|
95
85
|
addTokenEventListener(
|
|
96
86
|
// listen for native new token event, automatically re-register device with provider using new token and
|
|
97
87
|
// broadcast to library listeners
|
|
98
|
-
TOKEN_RECEIVED, token => {
|
|
88
|
+
TOKEN_RECEIVED, async (token) => {
|
|
99
89
|
// avoid a race condition where two endpoints are created with the same token on a fresh install
|
|
100
90
|
if (getToken() === token) {
|
|
101
91
|
return;
|
|
102
92
|
}
|
|
103
93
|
setToken(token);
|
|
104
|
-
registerDevice();
|
|
105
94
|
notifyEventListeners('tokenReceived', token);
|
|
95
|
+
try {
|
|
96
|
+
await registerDevice(token);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
logger.error('Failed to register device for push notifications', err);
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
106
102
|
});
|
|
107
103
|
};
|
|
108
|
-
const
|
|
104
|
+
const addAnalyticsListeners = () => {
|
|
105
|
+
let launchNotificationOpenedListenerRemover;
|
|
106
|
+
// wire up default Pinpoint message event handling
|
|
107
|
+
addEventListener('backgroundMessageReceived', createMessageEventRecorder('received_background'));
|
|
108
|
+
addEventListener('foregroundMessageReceived', createMessageEventRecorder('received_foreground'));
|
|
109
|
+
launchNotificationOpenedListenerRemover = addEventListener('launchNotificationOpened', createMessageEventRecorder('opened_notification',
|
|
110
|
+
// once we are done with it we can remove the listener
|
|
111
|
+
launchNotificationOpenedListenerRemover?.remove));
|
|
112
|
+
addEventListener('notificationOpened', createMessageEventRecorder('opened_notification',
|
|
113
|
+
// if we are in this state, we no longer need the listener as the app was launched via some other means
|
|
114
|
+
launchNotificationOpenedListenerRemover?.remove));
|
|
115
|
+
};
|
|
116
|
+
const registerDevice = async (address) => {
|
|
109
117
|
const { credentials, identityId } = await resolveCredentials();
|
|
110
118
|
const { appId, region } = resolveConfig();
|
|
111
|
-
|
|
112
|
-
address
|
|
119
|
+
await updateEndpoint({
|
|
120
|
+
address,
|
|
113
121
|
appId,
|
|
114
122
|
category: 'PushNotification',
|
|
115
123
|
credentials,
|
|
@@ -119,4 +127,3 @@ const registerDevice = async () => {
|
|
|
119
127
|
userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.InitializePushNotifications),
|
|
120
128
|
});
|
|
121
129
|
};
|
|
122
|
-
//# sourceMappingURL=initializePushNotifications.native.js.map
|
|
@@ -31,7 +31,6 @@ import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
|
31
31
|
* });
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export const requestPermissions = () => {
|
|
34
|
+
export const requestPermissions = async () => {
|
|
35
35
|
throw new PlatformNotSupportedError();
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=requestPermissions.js.map
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
4
4
|
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
5
5
|
const { requestPermissions: requestPermissionsNative } = loadAmplifyPushNotification();
|
|
6
|
-
export const requestPermissions = input => {
|
|
6
|
+
export const requestPermissions = async (input) => {
|
|
7
7
|
assertIsInitialized();
|
|
8
8
|
return requestPermissionsNative(input);
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=requestPermissions.native.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
|
|
2
|
+
export type PinpointMessageEventSource = '_campaign' | '_journey';
|
|
3
|
+
export type AnalyticsEventAttributes = {
|
|
4
4
|
source: PinpointMessageEventSource;
|
|
5
5
|
attributes: Record<string, string>;
|
|
6
6
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput } from './inputs';
|
|
2
2
|
import { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, RequestPermissionsOutput } from './outputs';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
3
|
+
export type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
|
|
4
|
+
export type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
|
|
5
|
+
export type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
|
|
6
|
+
export type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
|
|
7
|
+
export type InitializePushNotifications = () => void;
|
|
8
|
+
export type RequestPermissions = (input?: RequestPermissionsInput) => Promise<RequestPermissionsOutput>;
|
|
9
|
+
export type SetBadgeCount = (input: SetBadgeCountInput) => void;
|
|
10
|
+
export type OnNotificationOpened = (input: OnNotificationOpenedInput) => OnNotificationOpenedOutput;
|
|
11
|
+
export type OnNotificationReceivedInBackground = (input: OnNotificationReceivedInBackgroundInput) => OnNotificationReceivedInBackgroundOutput;
|
|
12
|
+
export type OnNotificationReceivedInForeground = (input: OnNotificationReceivedInForegroundInput) => OnNotificationReceivedInForegroundOutput;
|
|
13
|
+
export type OnTokenReceived = (input: OnTokenReceivedInput) => OnTokenReceivedOutput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IdentifyUserOptions } from './options';
|
|
2
2
|
import { PushNotificationIdentifyUserInput, PushNotificationRequestPermissionsInput, PushNotificationSetBadgeCountInput, PushNotificationOnNotificationOpenedInput, PushNotificationOnNotificationReceivedInBackgroundInput, PushNotificationOnNotificationReceivedInForegroundInput, PushNotificationOnTokenReceivedInput } from '../../../types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
3
|
+
export type IdentifyUserInput = PushNotificationIdentifyUserInput<IdentifyUserOptions>;
|
|
4
|
+
export type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
|
|
5
|
+
export type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
|
|
6
|
+
export type OnNotificationOpenedInput = PushNotificationOnNotificationOpenedInput;
|
|
7
|
+
export type OnNotificationReceivedInBackgroundInput = PushNotificationOnNotificationReceivedInBackgroundInput;
|
|
8
|
+
export type OnNotificationReceivedInForegroundInput = PushNotificationOnNotificationReceivedInForegroundInput;
|
|
9
|
+
export type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PushNotificationGetBadgeCountOutput, PushNotificationGetLaunchNotificationOutput, PushNotificationGetPermissionStatusOutput, PushNotificationOnNotificationOpenedOutput, PushNotificationOnNotificationReceivedInBackgroundOutput, PushNotificationOnNotificationReceivedInForegroundOutput, PushNotificationOnTokenReceivedOutput, PushNotificationRequestPermissionsOutput } from '../../../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
2
|
+
export type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
|
|
3
|
+
export type GetLaunchNotificationOutput = PushNotificationGetLaunchNotificationOutput;
|
|
4
|
+
export type GetPermissionStatusOutput = PushNotificationGetPermissionStatusOutput;
|
|
5
|
+
export type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
|
|
6
|
+
export type OnNotificationOpenedOutput = PushNotificationOnNotificationOpenedOutput;
|
|
7
|
+
export type OnNotificationReceivedInBackgroundOutput = PushNotificationOnNotificationReceivedInBackgroundOutput;
|
|
8
|
+
export type OnNotificationReceivedInForegroundOutput = PushNotificationOnNotificationReceivedInForegroundOutput;
|
|
9
|
+
export type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
2
|
-
export
|
|
2
|
+
export type ChannelType = Parameters<typeof updateEndpoint>[0]['channelType'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinpointMessageEvent } from '../types';
|
|
2
|
+
import { OnPushNotificationMessageHandler } from '../../../types';
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
5
|
-
export declare const createMessageEventRecorder: (event:
|
|
6
|
+
export declare const createMessageEventRecorder: (event: PinpointMessageEvent, callback?: Function) => OnPushNotificationMessageHandler;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { record } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
4
4
|
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
+
import { resolveCredentials } from '../../../utils';
|
|
5
6
|
import { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
6
7
|
import { getChannelType } from './getChannelType';
|
|
7
|
-
import { resolveConfig
|
|
8
|
+
import { resolveConfig } from './resolveConfig';
|
|
8
9
|
const logger = new ConsoleLogger('PushNotification.recordMessageEvent');
|
|
9
10
|
/**
|
|
10
11
|
* @internal
|
|
@@ -36,4 +37,3 @@ const recordMessageEvent = async ({ appId, credentials, event, message, region,
|
|
|
36
37
|
region,
|
|
37
38
|
});
|
|
38
39
|
};
|
|
39
|
-
//# sourceMappingURL=createMessageEventRecorder.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PinpointAnalyticsEvent } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
2
|
-
import {
|
|
2
|
+
import { PinpointMessageEvent } from '../types';
|
|
3
|
+
import { PushNotificationMessage } from '../../../types';
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
6
|
-
export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event:
|
|
7
|
+
export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event: PinpointMessageEvent) => PinpointAnalyticsEvent | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { createMessageEventRecorder } from './createMessageEventRecorder';
|
|
2
|
+
export { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
2
3
|
export { getChannelType } from './getChannelType';
|
|
3
|
-
export {
|
|
4
|
+
export { resolveConfig } from './resolveConfig';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export { createMessageEventRecorder } from './createMessageEventRecorder';
|
|
4
|
+
export { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
4
5
|
export { getChannelType } from './getChannelType';
|
|
5
|
-
export {
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
export { resolveConfig } from './resolveConfig';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { Amplify } from '@aws-amplify/core';
|
|
4
|
-
import { assert, PushNotificationValidationErrorCode } from '
|
|
4
|
+
import { assert, PushNotificationValidationErrorCode } from '../../../errors';
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -11,4 +11,3 @@ export const resolveConfig = () => {
|
|
|
11
11
|
assert(!!region, PushNotificationValidationErrorCode.NoRegion);
|
|
12
12
|
return { appId, region };
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=resolveConfig.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export * from './errors';
|
|
4
|
-
|
|
4
|
+
export * from './inputs';
|
|
5
|
+
export * from './options';
|
|
6
|
+
export * from './outputs';
|
|
7
|
+
export * from './pushNotifications';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UserProfile } from '@aws-amplify/core';
|
|
2
2
|
import { PushNotificationServiceOptions } from './options';
|
|
3
3
|
import { OnPushNotificationMessageHandler, OnTokenReceivedHandler, PushNotificationPermissions } from './pushNotifications';
|
|
4
|
-
export
|
|
4
|
+
export type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
|
|
5
5
|
/**
|
|
6
6
|
* A User ID associated to the current device.
|
|
7
7
|
*/
|
|
@@ -15,9 +15,9 @@ export declare type PushNotificationIdentifyUserInput<ServiceOptions extends Pus
|
|
|
15
15
|
*/
|
|
16
16
|
options?: ServiceOptions;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
18
|
+
export type PushNotificationRequestPermissionsInput = PushNotificationPermissions;
|
|
19
|
+
export type PushNotificationSetBadgeCountInput = number;
|
|
20
|
+
export type PushNotificationOnNotificationOpenedInput = OnPushNotificationMessageHandler;
|
|
21
|
+
export type PushNotificationOnNotificationReceivedInBackgroundInput = OnPushNotificationMessageHandler;
|
|
22
|
+
export type PushNotificationOnNotificationReceivedInForegroundInput = OnPushNotificationMessageHandler;
|
|
23
|
+
export type PushNotificationOnTokenReceivedInput = OnTokenReceivedHandler;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EventListenerRemover } from '../../eventListeners';
|
|
2
2
|
import { PushNotificationMessage, PushNotificationPermissionStatus } from '../types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
3
|
+
export type PushNotificationGetBadgeCountOutput = number | null;
|
|
4
|
+
export type PushNotificationGetLaunchNotificationOutput = PushNotificationMessage | null;
|
|
5
|
+
export type PushNotificationGetPermissionStatusOutput = PushNotificationPermissionStatus;
|
|
6
|
+
export type PushNotificationRequestPermissionsOutput = boolean;
|
|
7
|
+
export type PushNotificationOnNotificationOpenedOutput = EventListenerRemover;
|
|
8
|
+
export type PushNotificationOnNotificationReceivedInBackgroundOutput = EventListenerRemover;
|
|
9
|
+
export type PushNotificationOnNotificationReceivedInForegroundOutput = EventListenerRemover;
|
|
10
|
+
export type PushNotificationOnTokenReceivedOutput = EventListenerRemover;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PushNotificationMessage } from '@aws-amplify/react-native';
|
|
2
2
|
export type { PushNotificationMessage, PushNotificationPermissionStatus, PushNotificationPermissions, } from '@aws-amplify/react-native';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
export type OnTokenReceivedHandler = (token: string) => void;
|
|
4
|
+
export type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => void;
|
|
5
|
+
export type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationOpened' | 'notificationOpened' | 'tokenReceived';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
|
|
1
2
|
export { initialize, isInitialized } from './initializationManager';
|
|
2
|
-
export { resolveConfig } from './resolveConfig';
|
|
3
3
|
export { resolveCredentials } from './resolveCredentials';
|
|
4
4
|
export { getToken, setToken } from './tokenManager';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export { getPushNotificationUserAgentString } from './getPushNotificationUserAgentString';
|
|
3
4
|
export { initialize, isInitialized } from './initializationManager';
|
|
4
|
-
export { resolveConfig } from './resolveConfig';
|
|
5
5
|
export { resolveCredentials } from './resolveCredentials';
|
|
6
6
|
export { getToken, setToken } from './tokenManager';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|