@amazon-devices/expo-notifications 2.0.9000000000-rn-83
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/.eslintrc.js +2 -0
- package/CHANGELOG.md +478 -0
- package/LICENSE +7 -0
- package/README.kepler.md +3 -0
- package/README.md +2003 -0
- package/THIRD_PARTY_NOTICES.txt +4 -0
- package/android/build.gradle +125 -0
- package/android/src/main/AndroidManifest.xml +39 -0
- package/android/src/main/java/expo/modules/notifications/Exceptions.kt +22 -0
- package/android/src/main/java/expo/modules/notifications/NotificationsPackage.java +34 -0
- package/android/src/main/java/expo/modules/notifications/Utils.kt +19 -0
- package/android/src/main/java/expo/modules/notifications/badge/BadgeHelper.kt +24 -0
- package/android/src/main/java/expo/modules/notifications/badge/BadgeModule.kt +22 -0
- package/android/src/main/java/expo/modules/notifications/notifications/ArgumentsNotificationContentBuilder.java +149 -0
- package/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java +203 -0
- package/android/src/main/java/expo/modules/notifications/notifications/NotificationManager.java +119 -0
- package/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java +202 -0
- package/android/src/main/java/expo/modules/notifications/notifications/RemoteMessageSerializer.java +104 -0
- package/android/src/main/java/expo/modules/notifications/notifications/SoundResolver.java +58 -0
- package/android/src/main/java/expo/modules/notifications/notifications/background/BackgroundRemoteNotificationTaskConsumer.java +123 -0
- package/android/src/main/java/expo/modules/notifications/notifications/background/ExpoBackgroundNotificationTasksModule.kt +33 -0
- package/android/src/main/java/expo/modules/notifications/notifications/categories/ExpoNotificationCategoriesModule.kt +149 -0
- package/android/src/main/java/expo/modules/notifications/notifications/categories/serializers/ExpoNotificationsCategoriesSerializer.java +67 -0
- package/android/src/main/java/expo/modules/notifications/notifications/categories/serializers/NotificationsCategoriesSerializer.java +11 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/AbstractNotificationsChannelsProvider.java +81 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/AndroidXNotificationsChannelsProvider.java +38 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/InvalidVibrationPatternException.java +14 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/NotificationChannelGroupManagerModule.kt +70 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/NotificationChannelManagerModule.kt +83 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/NotificationsChannelsProvider.java +13 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/managers/AndroidXNotificationsChannelGroupManager.java +67 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/managers/AndroidXNotificationsChannelManager.java +196 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/managers/NotificationsChannelGroupManager.java +28 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/managers/NotificationsChannelManager.java +28 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/serializers/ExpoNotificationsChannelGroupSerializer.java +55 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/serializers/ExpoNotificationsChannelSerializer.java +101 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/serializers/NotificationsChannelGroupSerializer.java +20 -0
- package/android/src/main/java/expo/modules/notifications/notifications/channels/serializers/NotificationsChannelSerializer.java +35 -0
- package/android/src/main/java/expo/modules/notifications/notifications/emitting/NotificationsEmitter.kt +78 -0
- package/android/src/main/java/expo/modules/notifications/notifications/enums/AudioContentType.java +45 -0
- package/android/src/main/java/expo/modules/notifications/notifications/enums/AudioUsage.java +55 -0
- package/android/src/main/java/expo/modules/notifications/notifications/enums/NotificationImportance.java +48 -0
- package/android/src/main/java/expo/modules/notifications/notifications/enums/NotificationPriority.java +51 -0
- package/android/src/main/java/expo/modules/notifications/notifications/enums/NotificationVisibility.java +44 -0
- package/android/src/main/java/expo/modules/notifications/notifications/handling/NotificationsHandler.kt +127 -0
- package/android/src/main/java/expo/modules/notifications/notifications/handling/SingleNotificationHandlerTask.java +131 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationBuilder.java +35 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationListener.java +37 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationManager.java +22 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationPresentationEffect.java +11 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationPresentationEffectsManager.java +7 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationTrigger.java +19 -0
- package/android/src/main/java/expo/modules/notifications/notifications/interfaces/SchedulableNotificationTrigger.java +20 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/Notification.java +59 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationAction.java +63 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationBehavior.java +84 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationCategory.java +61 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationContent.java +356 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationRequest.java +66 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/NotificationResponse.java +60 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/TextInputNotificationAction.java +42 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/TextInputNotificationResponse.java +42 -0
- package/android/src/main/java/expo/modules/notifications/notifications/model/triggers/FirebaseNotificationTrigger.java +61 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/ExpoNotificationPresentationEffectsManager.java +63 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/ExpoNotificationPresentationModule.kt +113 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/BaseNotificationBuilder.java +50 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/CategoryAwareNotificationBuilder.java +80 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ChannelAwareNotificationBuilder.java +135 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java +295 -0
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/effects/BaseNotificationEffect.java +53 -0
- package/android/src/main/java/expo/modules/notifications/notifications/scheduling/NotificationScheduler.kt +235 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/ChannelAwareTrigger.java +49 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/DailyTrigger.java +76 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/DateTrigger.java +64 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/TimeIntervalTrigger.java +87 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/WeeklyTrigger.java +85 -0
- package/android/src/main/java/expo/modules/notifications/notifications/triggers/YearlyTrigger.java +94 -0
- package/android/src/main/java/expo/modules/notifications/permissions/NotificationPermissionsModule.kt +124 -0
- package/android/src/main/java/expo/modules/notifications/serverregistration/InstallationId.java +134 -0
- package/android/src/main/java/expo/modules/notifications/serverregistration/RegistrationInfo.kt +24 -0
- package/android/src/main/java/expo/modules/notifications/serverregistration/ServerRegistrationModule.kt +32 -0
- package/android/src/main/java/expo/modules/notifications/service/ExpoFirebaseMessagingService.kt +15 -0
- package/android/src/main/java/expo/modules/notifications/service/NotificationForwarderActivity.kt +33 -0
- package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +780 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/Base64Serialization.kt +33 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoCategoriesDelegate.kt +21 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoHandlingDelegate.kt +146 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoPresentationDelegate.kt +193 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoSchedulingDelegate.kt +117 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +126 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/SharedPreferencesNotificationCategoriesStore.kt +106 -0
- package/android/src/main/java/expo/modules/notifications/service/delegates/SharedPreferencesNotificationsStore.kt +119 -0
- package/android/src/main/java/expo/modules/notifications/service/interfaces/CategoriesDelegate.kt +14 -0
- package/android/src/main/java/expo/modules/notifications/service/interfaces/FirebaseMessagingDelegate.kt +20 -0
- package/android/src/main/java/expo/modules/notifications/service/interfaces/HandlingDelegate.kt +10 -0
- package/android/src/main/java/expo/modules/notifications/service/interfaces/PresentationDelegate.kt +11 -0
- package/android/src/main/java/expo/modules/notifications/service/interfaces/SchedulingDelegate.kt +13 -0
- package/android/src/main/java/expo/modules/notifications/tokens/PushTokenManager.java +88 -0
- package/android/src/main/java/expo/modules/notifications/tokens/PushTokenModule.kt +91 -0
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/FirebaseTokenListener.java +16 -0
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/PushTokenListener.java +14 -0
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/PushTokenManager.java +22 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/app.plugin.js +1 -0
- package/build/BackgroundNotificationTasksModule.d.ts +4 -0
- package/build/BackgroundNotificationTasksModule.d.ts.map +1 -0
- package/build/BackgroundNotificationTasksModule.js +7 -0
- package/build/BackgroundNotificationTasksModule.js.map +1 -0
- package/build/BackgroundNotificationTasksModule.kepler.d.ts +3 -0
- package/build/BackgroundNotificationTasksModule.kepler.d.ts.map +1 -0
- package/build/BackgroundNotificationTasksModule.kepler.js +9 -0
- package/build/BackgroundNotificationTasksModule.kepler.js.map +1 -0
- package/build/BackgroundNotificationTasksModule.native.d.ts +4 -0
- package/build/BackgroundNotificationTasksModule.native.d.ts.map +1 -0
- package/build/BackgroundNotificationTasksModule.native.js +3 -0
- package/build/BackgroundNotificationTasksModule.native.js.map +1 -0
- package/build/BackgroundNotificationTasksModule.types.d.ts +11 -0
- package/build/BackgroundNotificationTasksModule.types.d.ts.map +1 -0
- package/build/BackgroundNotificationTasksModule.types.js +7 -0
- package/build/BackgroundNotificationTasksModule.types.js.map +1 -0
- package/build/BackgroundNotificationTasksModule.web.d.ts +6 -0
- package/build/BackgroundNotificationTasksModule.web.d.ts.map +1 -0
- package/build/BackgroundNotificationTasksModule.web.js +9 -0
- package/build/BackgroundNotificationTasksModule.web.js.map +1 -0
- package/build/BadgeModule.d.ts +4 -0
- package/build/BadgeModule.d.ts.map +1 -0
- package/build/BadgeModule.js +5 -0
- package/build/BadgeModule.js.map +1 -0
- package/build/BadgeModule.kepler.d.ts +3 -0
- package/build/BadgeModule.kepler.d.ts.map +1 -0
- package/build/BadgeModule.kepler.js +9 -0
- package/build/BadgeModule.kepler.js.map +1 -0
- package/build/BadgeModule.native.d.ts +4 -0
- package/build/BadgeModule.native.d.ts.map +1 -0
- package/build/BadgeModule.native.js +12 -0
- package/build/BadgeModule.native.js.map +1 -0
- package/build/BadgeModule.types.d.ts +10 -0
- package/build/BadgeModule.types.d.ts.map +1 -0
- package/build/BadgeModule.types.js +2 -0
- package/build/BadgeModule.types.js.map +1 -0
- package/build/BadgeModule.web.d.ts +4 -0
- package/build/BadgeModule.web.d.ts.map +1 -0
- package/build/BadgeModule.web.js +26 -0
- package/build/BadgeModule.web.js.map +1 -0
- package/build/DevicePushTokenAutoRegistration.fx.d.ts +15 -0
- package/build/DevicePushTokenAutoRegistration.fx.d.ts.map +1 -0
- package/build/DevicePushTokenAutoRegistration.fx.js +87 -0
- package/build/DevicePushTokenAutoRegistration.fx.js.map +1 -0
- package/build/NotificationCategoriesModule.d.ts +4 -0
- package/build/NotificationCategoriesModule.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.js +13 -0
- package/build/NotificationCategoriesModule.js.map +1 -0
- package/build/NotificationCategoriesModule.kepler.d.ts +3 -0
- package/build/NotificationCategoriesModule.kepler.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.kepler.js +10 -0
- package/build/NotificationCategoriesModule.kepler.js.map +1 -0
- package/build/NotificationCategoriesModule.native.d.ts +4 -0
- package/build/NotificationCategoriesModule.native.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.native.js +3 -0
- package/build/NotificationCategoriesModule.native.js.map +1 -0
- package/build/NotificationCategoriesModule.types.d.ts +17 -0
- package/build/NotificationCategoriesModule.types.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.types.js +2 -0
- package/build/NotificationCategoriesModule.types.js.map +1 -0
- package/build/NotificationCategoriesModule.web.d.ts +8 -0
- package/build/NotificationCategoriesModule.web.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.web.js +12 -0
- package/build/NotificationCategoriesModule.web.js.map +1 -0
- package/build/NotificationChannelGroupManager.d.ts +4 -0
- package/build/NotificationChannelGroupManager.d.ts.map +1 -0
- package/build/NotificationChannelGroupManager.js +5 -0
- package/build/NotificationChannelGroupManager.js.map +1 -0
- package/build/NotificationChannelGroupManager.kepler.d.ts +3 -0
- package/build/NotificationChannelGroupManager.kepler.d.ts.map +1 -0
- package/build/NotificationChannelGroupManager.kepler.js +9 -0
- package/build/NotificationChannelGroupManager.kepler.js.map +1 -0
- package/build/NotificationChannelGroupManager.native.d.ts +4 -0
- package/build/NotificationChannelGroupManager.native.d.ts.map +1 -0
- package/build/NotificationChannelGroupManager.native.js +3 -0
- package/build/NotificationChannelGroupManager.native.js.map +1 -0
- package/build/NotificationChannelGroupManager.types.d.ts +28 -0
- package/build/NotificationChannelGroupManager.types.d.ts.map +1 -0
- package/build/NotificationChannelGroupManager.types.js +2 -0
- package/build/NotificationChannelGroupManager.types.js.map +1 -0
- package/build/NotificationChannelManager.d.ts +4 -0
- package/build/NotificationChannelManager.d.ts.map +1 -0
- package/build/NotificationChannelManager.js +5 -0
- package/build/NotificationChannelManager.js.map +1 -0
- package/build/NotificationChannelManager.kepler.d.ts +3 -0
- package/build/NotificationChannelManager.kepler.d.ts.map +1 -0
- package/build/NotificationChannelManager.kepler.js +9 -0
- package/build/NotificationChannelManager.kepler.js.map +1 -0
- package/build/NotificationChannelManager.native.d.ts +4 -0
- package/build/NotificationChannelManager.native.d.ts.map +1 -0
- package/build/NotificationChannelManager.native.js +3 -0
- package/build/NotificationChannelManager.native.js.map +1 -0
- package/build/NotificationChannelManager.types.d.ts +91 -0
- package/build/NotificationChannelManager.types.d.ts.map +1 -0
- package/build/NotificationChannelManager.types.js +53 -0
- package/build/NotificationChannelManager.types.js.map +1 -0
- package/build/NotificationPermissions.d.ts +56 -0
- package/build/NotificationPermissions.d.ts.map +1 -0
- package/build/NotificationPermissions.js +79 -0
- package/build/NotificationPermissions.js.map +1 -0
- package/build/NotificationPermissions.types.d.ts +94 -0
- package/build/NotificationPermissions.types.d.ts.map +1 -0
- package/build/NotificationPermissions.types.js +21 -0
- package/build/NotificationPermissions.types.js.map +1 -0
- package/build/NotificationPermissionsModule.d.ts +4 -0
- package/build/NotificationPermissionsModule.d.ts.map +1 -0
- package/build/NotificationPermissionsModule.js +67 -0
- package/build/NotificationPermissionsModule.js.map +1 -0
- package/build/NotificationPermissionsModule.kepler.d.ts +3 -0
- package/build/NotificationPermissionsModule.kepler.d.ts.map +1 -0
- package/build/NotificationPermissionsModule.kepler.js +9 -0
- package/build/NotificationPermissionsModule.kepler.js.map +1 -0
- package/build/NotificationPermissionsModule.native.d.ts +4 -0
- package/build/NotificationPermissionsModule.native.d.ts.map +1 -0
- package/build/NotificationPermissionsModule.native.js +3 -0
- package/build/NotificationPermissionsModule.native.js.map +1 -0
- package/build/NotificationPermissionsModule.types.d.ts +7 -0
- package/build/NotificationPermissionsModule.types.d.ts.map +1 -0
- package/build/NotificationPermissionsModule.types.js +2 -0
- package/build/NotificationPermissionsModule.types.js.map +1 -0
- package/build/NotificationPresenterModule.d.ts +4 -0
- package/build/NotificationPresenterModule.d.ts.map +1 -0
- package/build/NotificationPresenterModule.js +5 -0
- package/build/NotificationPresenterModule.js.map +1 -0
- package/build/NotificationPresenterModule.kepler.d.ts +4 -0
- package/build/NotificationPresenterModule.kepler.d.ts.map +1 -0
- package/build/NotificationPresenterModule.kepler.js +55 -0
- package/build/NotificationPresenterModule.kepler.js.map +1 -0
- package/build/NotificationPresenterModule.native.d.ts +4 -0
- package/build/NotificationPresenterModule.native.d.ts.map +1 -0
- package/build/NotificationPresenterModule.native.js +3 -0
- package/build/NotificationPresenterModule.native.js.map +1 -0
- package/build/NotificationPresenterModule.types.d.ts +9 -0
- package/build/NotificationPresenterModule.types.d.ts.map +1 -0
- package/build/NotificationPresenterModule.types.js +2 -0
- package/build/NotificationPresenterModule.types.js.map +1 -0
- package/build/NotificationScheduler.d.ts +4 -0
- package/build/NotificationScheduler.d.ts.map +1 -0
- package/build/NotificationScheduler.js +5 -0
- package/build/NotificationScheduler.js.map +1 -0
- package/build/NotificationScheduler.kepler.d.ts +4 -0
- package/build/NotificationScheduler.kepler.d.ts.map +1 -0
- package/build/NotificationScheduler.kepler.js +50 -0
- package/build/NotificationScheduler.kepler.js.map +1 -0
- package/build/NotificationScheduler.native.d.ts +4 -0
- package/build/NotificationScheduler.native.d.ts.map +1 -0
- package/build/NotificationScheduler.native.js +3 -0
- package/build/NotificationScheduler.native.js.map +1 -0
- package/build/NotificationScheduler.types.d.ts +65 -0
- package/build/NotificationScheduler.types.d.ts.map +1 -0
- package/build/NotificationScheduler.types.js +2 -0
- package/build/NotificationScheduler.types.js.map +1 -0
- package/build/Notifications.types.d.ts +666 -0
- package/build/Notifications.types.d.ts.map +1 -0
- package/build/Notifications.types.js +12 -0
- package/build/Notifications.types.js.map +1 -0
- package/build/NotificationsEmitter.d.ts +75 -0
- package/build/NotificationsEmitter.d.ts.map +1 -0
- package/build/NotificationsEmitter.js +95 -0
- package/build/NotificationsEmitter.js.map +1 -0
- package/build/NotificationsEmitterModule.d.ts +4 -0
- package/build/NotificationsEmitterModule.d.ts.map +1 -0
- package/build/NotificationsEmitterModule.js +12 -0
- package/build/NotificationsEmitterModule.js.map +1 -0
- package/build/NotificationsEmitterModule.kepler.d.ts +3 -0
- package/build/NotificationsEmitterModule.kepler.d.ts.map +1 -0
- package/build/NotificationsEmitterModule.kepler.js +9 -0
- package/build/NotificationsEmitterModule.kepler.js.map +1 -0
- package/build/NotificationsEmitterModule.native.d.ts +4 -0
- package/build/NotificationsEmitterModule.native.d.ts.map +1 -0
- package/build/NotificationsEmitterModule.native.js +3 -0
- package/build/NotificationsEmitterModule.native.js.map +1 -0
- package/build/NotificationsEmitterModule.types.d.ts +6 -0
- package/build/NotificationsEmitterModule.types.d.ts.map +1 -0
- package/build/NotificationsEmitterModule.types.js +2 -0
- package/build/NotificationsEmitterModule.types.js.map +1 -0
- package/build/NotificationsHandler.d.ts +60 -0
- package/build/NotificationsHandler.d.ts.map +1 -0
- package/build/NotificationsHandler.js +72 -0
- package/build/NotificationsHandler.js.map +1 -0
- package/build/NotificationsHandlerModule.d.ts +4 -0
- package/build/NotificationsHandlerModule.d.ts.map +1 -0
- package/build/NotificationsHandlerModule.js +12 -0
- package/build/NotificationsHandlerModule.js.map +1 -0
- package/build/NotificationsHandlerModule.kepler.d.ts +3 -0
- package/build/NotificationsHandlerModule.kepler.d.ts.map +1 -0
- package/build/NotificationsHandlerModule.kepler.js +9 -0
- package/build/NotificationsHandlerModule.kepler.js.map +1 -0
- package/build/NotificationsHandlerModule.native.d.ts +4 -0
- package/build/NotificationsHandlerModule.native.d.ts.map +1 -0
- package/build/NotificationsHandlerModule.native.js +3 -0
- package/build/NotificationsHandlerModule.native.js.map +1 -0
- package/build/NotificationsHandlerModule.types.d.ts +6 -0
- package/build/NotificationsHandlerModule.types.d.ts.map +1 -0
- package/build/NotificationsHandlerModule.types.js +2 -0
- package/build/NotificationsHandlerModule.types.js.map +1 -0
- package/build/PushTokenManager.d.ts +4 -0
- package/build/PushTokenManager.d.ts.map +1 -0
- package/build/PushTokenManager.js +12 -0
- package/build/PushTokenManager.js.map +1 -0
- package/build/PushTokenManager.kepler.d.ts +3 -0
- package/build/PushTokenManager.kepler.d.ts.map +1 -0
- package/build/PushTokenManager.kepler.js +9 -0
- package/build/PushTokenManager.kepler.js.map +1 -0
- package/build/PushTokenManager.native.d.ts +4 -0
- package/build/PushTokenManager.native.d.ts.map +1 -0
- package/build/PushTokenManager.native.js +3 -0
- package/build/PushTokenManager.native.js.map +1 -0
- package/build/PushTokenManager.types.d.ts +6 -0
- package/build/PushTokenManager.types.d.ts.map +1 -0
- package/build/PushTokenManager.types.js +2 -0
- package/build/PushTokenManager.types.js.map +1 -0
- package/build/ServerRegistrationModule.d.ts +4 -0
- package/build/ServerRegistrationModule.d.ts.map +1 -0
- package/build/ServerRegistrationModule.js +5 -0
- package/build/ServerRegistrationModule.js.map +1 -0
- package/build/ServerRegistrationModule.kepler.d.ts +3 -0
- package/build/ServerRegistrationModule.kepler.d.ts.map +1 -0
- package/build/ServerRegistrationModule.kepler.js +9 -0
- package/build/ServerRegistrationModule.kepler.js.map +1 -0
- package/build/ServerRegistrationModule.native.d.ts +4 -0
- package/build/ServerRegistrationModule.native.d.ts.map +1 -0
- package/build/ServerRegistrationModule.native.js +3 -0
- package/build/ServerRegistrationModule.native.js.map +1 -0
- package/build/ServerRegistrationModule.types.d.ts +7 -0
- package/build/ServerRegistrationModule.types.d.ts.map +1 -0
- package/build/ServerRegistrationModule.types.js +2 -0
- package/build/ServerRegistrationModule.types.js.map +1 -0
- package/build/ServerRegistrationModule.web.d.ts +4 -0
- package/build/ServerRegistrationModule.web.d.ts.map +1 -0
- package/build/ServerRegistrationModule.web.js +50 -0
- package/build/ServerRegistrationModule.web.js.map +1 -0
- package/build/TokenEmitter.d.ts +42 -0
- package/build/TokenEmitter.d.ts.map +1 -0
- package/build/TokenEmitter.js +44 -0
- package/build/TokenEmitter.js.map +1 -0
- package/build/Tokens.types.d.ts +99 -0
- package/build/Tokens.types.d.ts.map +1 -0
- package/build/Tokens.types.js +2 -0
- package/build/Tokens.types.js.map +1 -0
- package/build/cancelAllScheduledNotificationsAsync.d.ts +7 -0
- package/build/cancelAllScheduledNotificationsAsync.d.ts.map +1 -0
- package/build/cancelAllScheduledNotificationsAsync.js +14 -0
- package/build/cancelAllScheduledNotificationsAsync.js.map +1 -0
- package/build/cancelScheduledNotificationAsync.d.ts +22 -0
- package/build/cancelScheduledNotificationAsync.d.ts.map +1 -0
- package/build/cancelScheduledNotificationAsync.js +29 -0
- package/build/cancelScheduledNotificationAsync.js.map +1 -0
- package/build/deleteNotificationCategoryAsync.d.ts +11 -0
- package/build/deleteNotificationCategoryAsync.d.ts.map +1 -0
- package/build/deleteNotificationCategoryAsync.js +19 -0
- package/build/deleteNotificationCategoryAsync.js.map +1 -0
- package/build/deleteNotificationChannelAsync.android.d.ts +2 -0
- package/build/deleteNotificationChannelAsync.android.d.ts.map +1 -0
- package/build/deleteNotificationChannelAsync.android.js +9 -0
- package/build/deleteNotificationChannelAsync.android.js.map +1 -0
- package/build/deleteNotificationChannelAsync.d.ts +9 -0
- package/build/deleteNotificationChannelAsync.d.ts.map +1 -0
- package/build/deleteNotificationChannelAsync.js +11 -0
- package/build/deleteNotificationChannelAsync.js.map +1 -0
- package/build/deleteNotificationChannelGroupAsync.android.d.ts +2 -0
- package/build/deleteNotificationChannelGroupAsync.android.d.ts.map +1 -0
- package/build/deleteNotificationChannelGroupAsync.android.js +9 -0
- package/build/deleteNotificationChannelGroupAsync.android.js.map +1 -0
- package/build/deleteNotificationChannelGroupAsync.d.ts +9 -0
- package/build/deleteNotificationChannelGroupAsync.d.ts.map +1 -0
- package/build/deleteNotificationChannelGroupAsync.js +11 -0
- package/build/deleteNotificationChannelGroupAsync.js.map +1 -0
- package/build/dismissAllNotificationsAsync.d.ts +7 -0
- package/build/dismissAllNotificationsAsync.d.ts.map +1 -0
- package/build/dismissAllNotificationsAsync.js +14 -0
- package/build/dismissAllNotificationsAsync.js.map +1 -0
- package/build/dismissNotificationAsync.d.ts +8 -0
- package/build/dismissNotificationAsync.d.ts.map +1 -0
- package/build/dismissNotificationAsync.js +15 -0
- package/build/dismissNotificationAsync.js.map +1 -0
- package/build/getAllScheduledNotificationsAsync.d.ts +8 -0
- package/build/getAllScheduledNotificationsAsync.d.ts.map +1 -0
- package/build/getAllScheduledNotificationsAsync.js +14 -0
- package/build/getAllScheduledNotificationsAsync.js.map +1 -0
- package/build/getBadgeCountAsync.d.ts +8 -0
- package/build/getBadgeCountAsync.d.ts.map +1 -0
- package/build/getBadgeCountAsync.js +15 -0
- package/build/getBadgeCountAsync.js.map +1 -0
- package/build/getDevicePushTokenAsync.d.ts +8 -0
- package/build/getDevicePushTokenAsync.d.ts.map +1 -0
- package/build/getDevicePushTokenAsync.js +27 -0
- package/build/getDevicePushTokenAsync.js.map +1 -0
- package/build/getDevicePushTokenAsync.web.d.ts +3 -0
- package/build/getDevicePushTokenAsync.web.d.ts.map +1 -0
- package/build/getDevicePushTokenAsync.web.js +84 -0
- package/build/getDevicePushTokenAsync.web.js.map +1 -0
- package/build/getExpoPushTokenAsync.d.ts +40 -0
- package/build/getExpoPushTokenAsync.d.ts.map +1 -0
- package/build/getExpoPushTokenAsync.js +177 -0
- package/build/getExpoPushTokenAsync.js.map +1 -0
- package/build/getNextTriggerDateAsync.d.ts +26 -0
- package/build/getNextTriggerDateAsync.d.ts.map +1 -0
- package/build/getNextTriggerDateAsync.js +33 -0
- package/build/getNextTriggerDateAsync.js.map +1 -0
- package/build/getNotificationCategoriesAsync.d.ts +11 -0
- package/build/getNotificationCategoriesAsync.d.ts.map +1 -0
- package/build/getNotificationCategoriesAsync.js +18 -0
- package/build/getNotificationCategoriesAsync.js.map +1 -0
- package/build/getNotificationChannelAsync.android.d.ts +3 -0
- package/build/getNotificationChannelAsync.android.d.ts.map +1 -0
- package/build/getNotificationChannelAsync.android.js +9 -0
- package/build/getNotificationChannelAsync.android.js.map +1 -0
- package/build/getNotificationChannelAsync.d.ts +11 -0
- package/build/getNotificationChannelAsync.d.ts.map +1 -0
- package/build/getNotificationChannelAsync.js +13 -0
- package/build/getNotificationChannelAsync.js.map +1 -0
- package/build/getNotificationChannelGroupAsync.android.d.ts +3 -0
- package/build/getNotificationChannelGroupAsync.android.d.ts.map +1 -0
- package/build/getNotificationChannelGroupAsync.android.js +9 -0
- package/build/getNotificationChannelGroupAsync.android.js.map +1 -0
- package/build/getNotificationChannelGroupAsync.d.ts +12 -0
- package/build/getNotificationChannelGroupAsync.d.ts.map +1 -0
- package/build/getNotificationChannelGroupAsync.js +14 -0
- package/build/getNotificationChannelGroupAsync.js.map +1 -0
- package/build/getNotificationChannelGroupsAsync.android.d.ts +3 -0
- package/build/getNotificationChannelGroupsAsync.android.d.ts.map +1 -0
- package/build/getNotificationChannelGroupsAsync.android.js +9 -0
- package/build/getNotificationChannelGroupsAsync.android.js.map +1 -0
- package/build/getNotificationChannelGroupsAsync.d.ts +10 -0
- package/build/getNotificationChannelGroupsAsync.d.ts.map +1 -0
- package/build/getNotificationChannelGroupsAsync.js +12 -0
- package/build/getNotificationChannelGroupsAsync.js.map +1 -0
- package/build/getNotificationChannelsAsync.android.d.ts +3 -0
- package/build/getNotificationChannelsAsync.android.d.ts.map +1 -0
- package/build/getNotificationChannelsAsync.android.js +9 -0
- package/build/getNotificationChannelsAsync.android.js.map +1 -0
- package/build/getNotificationChannelsAsync.d.ts +10 -0
- package/build/getNotificationChannelsAsync.d.ts.map +1 -0
- package/build/getNotificationChannelsAsync.js +12 -0
- package/build/getNotificationChannelsAsync.js.map +1 -0
- package/build/getPresentedNotificationsAsync.d.ts +9 -0
- package/build/getPresentedNotificationsAsync.d.ts.map +1 -0
- package/build/getPresentedNotificationsAsync.js +15 -0
- package/build/getPresentedNotificationsAsync.js.map +1 -0
- package/build/index.d.ts +39 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +39 -0
- package/build/index.js.map +1 -0
- package/build/kepler/NotificationContent.d.ts +43 -0
- package/build/kepler/NotificationContent.d.ts.map +1 -0
- package/build/kepler/NotificationContent.js +96 -0
- package/build/kepler/NotificationContent.js.map +1 -0
- package/build/kepler/index.d.ts +3 -0
- package/build/kepler/index.d.ts.map +1 -0
- package/build/kepler/index.js +15 -0
- package/build/kepler/index.js.map +1 -0
- package/build/kepler/native-notification-manager.d.ts +3 -0
- package/build/kepler/native-notification-manager.d.ts.map +1 -0
- package/build/kepler/native-notification-manager.js +10 -0
- package/build/kepler/native-notification-manager.js.map +1 -0
- package/build/kepler/types/NotificationManagerTypes.d.ts +373 -0
- package/build/kepler/types/NotificationManagerTypes.d.ts.map +1 -0
- package/build/kepler/types/NotificationManagerTypes.js +279 -0
- package/build/kepler/types/NotificationManagerTypes.js.map +1 -0
- package/build/kepler/types/index.d.ts +3 -0
- package/build/kepler/types/index.d.ts.map +1 -0
- package/build/kepler/types/index.js +15 -0
- package/build/kepler/types/index.js.map +1 -0
- package/build/presentNotificationAsync.d.ts +11 -0
- package/build/presentNotificationAsync.d.ts.map +1 -0
- package/build/presentNotificationAsync.js +22 -0
- package/build/presentNotificationAsync.js.map +1 -0
- package/build/registerTaskAsync.d.ts +29 -0
- package/build/registerTaskAsync.d.ts.map +1 -0
- package/build/registerTaskAsync.js +37 -0
- package/build/registerTaskAsync.js.map +1 -0
- package/build/scheduleNotificationAsync.d.ts +60 -0
- package/build/scheduleNotificationAsync.d.ts.map +1 -0
- package/build/scheduleNotificationAsync.js +261 -0
- package/build/scheduleNotificationAsync.js.map +1 -0
- package/build/setBadgeCountAsync.d.ts +19 -0
- package/build/setBadgeCountAsync.d.ts.map +1 -0
- package/build/setBadgeCountAsync.js +19 -0
- package/build/setBadgeCountAsync.js.map +1 -0
- package/build/setNotificationCategoryAsync.d.ts +15 -0
- package/build/setNotificationCategoryAsync.d.ts.map +1 -0
- package/build/setNotificationCategoryAsync.js +22 -0
- package/build/setNotificationCategoryAsync.js.map +1 -0
- package/build/setNotificationChannelAsync.android.d.ts +3 -0
- package/build/setNotificationChannelAsync.android.d.ts.map +1 -0
- package/build/setNotificationChannelAsync.android.js +9 -0
- package/build/setNotificationChannelAsync.android.js.map +1 -0
- package/build/setNotificationChannelAsync.d.ts +22 -0
- package/build/setNotificationChannelAsync.d.ts.map +1 -0
- package/build/setNotificationChannelAsync.js +24 -0
- package/build/setNotificationChannelAsync.js.map +1 -0
- package/build/setNotificationChannelGroupAsync.android.d.ts +3 -0
- package/build/setNotificationChannelGroupAsync.android.d.ts.map +1 -0
- package/build/setNotificationChannelGroupAsync.android.js +9 -0
- package/build/setNotificationChannelGroupAsync.android.js.map +1 -0
- package/build/setNotificationChannelGroupAsync.d.ts +12 -0
- package/build/setNotificationChannelGroupAsync.d.ts.map +1 -0
- package/build/setNotificationChannelGroupAsync.js +14 -0
- package/build/setNotificationChannelGroupAsync.js.map +1 -0
- package/build/unregisterForNotificationsAsync.d.ts +2 -0
- package/build/unregisterForNotificationsAsync.d.ts.map +1 -0
- package/build/unregisterForNotificationsAsync.js +10 -0
- package/build/unregisterForNotificationsAsync.js.map +1 -0
- package/build/unregisterTaskAsync.d.ts +7 -0
- package/build/unregisterTaskAsync.d.ts.map +1 -0
- package/build/unregisterTaskAsync.js +15 -0
- package/build/unregisterTaskAsync.js.map +1 -0
- package/build/useLastNotificationResponse.d.ts +38 -0
- package/build/useLastNotificationResponse.d.ts.map +1 -0
- package/build/useLastNotificationResponse.js +63 -0
- package/build/useLastNotificationResponse.js.map +1 -0
- package/build/utils/keplerUuidUtils.d.ts +5 -0
- package/build/utils/keplerUuidUtils.d.ts.map +1 -0
- package/build/utils/keplerUuidUtils.js +15 -0
- package/build/utils/keplerUuidUtils.js.map +1 -0
- package/build/utils/updateDevicePushTokenAsync.d.ts +3 -0
- package/build/utils/updateDevicePushTokenAsync.d.ts.map +1 -0
- package/build/utils/updateDevicePushTokenAsync.js +115 -0
- package/build/utils/updateDevicePushTokenAsync.js.map +1 -0
- package/expo-module.config.json +20 -0
- package/ios/EXNotifications/Building/EXNotificationBuilder.h +19 -0
- package/ios/EXNotifications/Building/EXNotificationBuilder.m +91 -0
- package/ios/EXNotifications/EXBadgeModule.h +11 -0
- package/ios/EXNotifications/EXBadgeModule.m +36 -0
- package/ios/EXNotifications/EXServerRegistrationModule.h +19 -0
- package/ios/EXNotifications/EXServerRegistrationModule.m +194 -0
- package/ios/EXNotifications/Notifications/Background/EXBackgroundNotificationTasksModule.h +16 -0
- package/ios/EXNotifications/Notifications/Background/EXBackgroundNotificationTasksModule.m +62 -0
- package/ios/EXNotifications/Notifications/Background/EXBackgroundRemoteNotificationConsumer.h +14 -0
- package/ios/EXNotifications/Notifications/Background/EXBackgroundRemoteNotificationConsumer.m +51 -0
- package/ios/EXNotifications/Notifications/Categories/EXNotificationCategoriesModule.h +25 -0
- package/ios/EXNotifications/Notifications/Categories/EXNotificationCategoriesModule.m +217 -0
- package/ios/EXNotifications/Notifications/EXNotificationCenterDelegate.h +29 -0
- package/ios/EXNotifications/Notifications/EXNotificationCenterDelegate.m +209 -0
- package/ios/EXNotifications/Notifications/EXNotificationSerializer.h +16 -0
- package/ios/EXNotifications/Notifications/EXNotificationSerializer.m +232 -0
- package/ios/EXNotifications/Notifications/EXNotificationsDelegate.h +27 -0
- package/ios/EXNotifications/Notifications/Emitter/EXNotificationsEmitter.h +17 -0
- package/ios/EXNotifications/Notifications/Emitter/EXNotificationsEmitter.m +114 -0
- package/ios/EXNotifications/Notifications/Handler/EXNotificationsHandlerModule.h +12 -0
- package/ios/EXNotifications/Notifications/Handler/EXNotificationsHandlerModule.m +109 -0
- package/ios/EXNotifications/Notifications/Handler/EXSingleNotificationHandlerTask.h +33 -0
- package/ios/EXNotifications/Notifications/Handler/EXSingleNotificationHandlerTask.m +124 -0
- package/ios/EXNotifications/Notifications/NSDictionary+EXNotificationsVerifyingClass.h +7 -0
- package/ios/EXNotifications/Notifications/NSDictionary+EXNotificationsVerifyingClass.m +19 -0
- package/ios/EXNotifications/Notifications/Presenting/EXNotificationPresentationModule.h +13 -0
- package/ios/EXNotifications/Notifications/Presenting/EXNotificationPresentationModule.m +124 -0
- package/ios/EXNotifications/Notifications/Scheduling/EXNotificationSchedulerModule.h +21 -0
- package/ios/EXNotifications/Notifications/Scheduling/EXNotificationSchedulerModule.m +263 -0
- package/ios/EXNotifications/Permissions/EXLegacyRemoteNotificationPermissionRequester.h +13 -0
- package/ios/EXNotifications/Permissions/EXLegacyRemoteNotificationPermissionRequester.m +135 -0
- package/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.h +8 -0
- package/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.m +67 -0
- package/ios/EXNotifications/Permissions/EXRemoteNotificationPermissionSingletonModule.h +29 -0
- package/ios/EXNotifications/Permissions/EXRemoteNotificationPermissionSingletonModule.m +68 -0
- package/ios/EXNotifications/Permissions/EXUserFacingNotificationsPermissionsRequester.h +15 -0
- package/ios/EXNotifications/Permissions/EXUserFacingNotificationsPermissionsRequester.m +202 -0
- package/ios/EXNotifications/PushToken/EXPushTokenListener.h +14 -0
- package/ios/EXNotifications/PushToken/EXPushTokenManager.h +24 -0
- package/ios/EXNotifications/PushToken/EXPushTokenManager.m +63 -0
- package/ios/EXNotifications/PushToken/EXPushTokenModule.h +9 -0
- package/ios/EXNotifications/PushToken/EXPushTokenModule.m +154 -0
- package/ios/EXNotifications.podspec +25 -0
- package/package.json +67 -0
- package/plugin/build/withNotifications.d.ts +28 -0
- package/plugin/build/withNotifications.js +12 -0
- package/plugin/build/withNotificationsAndroid.d.ts +42 -0
- package/plugin/build/withNotificationsAndroid.js +184 -0
- package/plugin/build/withNotificationsIOS.d.ts +14 -0
- package/plugin/build/withNotificationsIOS.js +58 -0
- package/plugin/jest.config.js +1 -0
- package/plugin/src/withNotifications.ts +40 -0
- package/plugin/src/withNotificationsAndroid.ts +239 -0
- package/plugin/src/withNotificationsIOS.ts +78 -0
- package/plugin/tsconfig.json +9 -0
- package/src/BackgroundNotificationTasksModule.kepler.ts +8 -0
- package/src/BackgroundNotificationTasksModule.native.ts +7 -0
- package/src/BackgroundNotificationTasksModule.ts +8 -0
- package/src/BackgroundNotificationTasksModule.types.ts +12 -0
- package/src/BackgroundNotificationTasksModule.web.ts +8 -0
- package/src/BadgeModule.kepler.ts +8 -0
- package/src/BadgeModule.native.ts +15 -0
- package/src/BadgeModule.ts +6 -0
- package/src/BadgeModule.types.ts +11 -0
- package/src/BadgeModule.web.ts +28 -0
- package/src/DevicePushTokenAutoRegistration.fx.ts +119 -0
- package/src/NotificationCategoriesModule.kepler.ts +10 -0
- package/src/NotificationCategoriesModule.native.ts +7 -0
- package/src/NotificationCategoriesModule.ts +15 -0
- package/src/NotificationCategoriesModule.types.ts +22 -0
- package/src/NotificationCategoriesModule.web.ts +17 -0
- package/src/NotificationChannelGroupManager.kepler.ts +8 -0
- package/src/NotificationChannelGroupManager.native.ts +7 -0
- package/src/NotificationChannelGroupManager.ts +6 -0
- package/src/NotificationChannelGroupManager.types.ts +34 -0
- package/src/NotificationChannelManager.kepler.ts +8 -0
- package/src/NotificationChannelManager.native.ts +5 -0
- package/src/NotificationChannelManager.ts +6 -0
- package/src/NotificationChannelManager.types.ts +115 -0
- package/src/NotificationPermissions.ts +91 -0
- package/src/NotificationPermissions.types.ts +102 -0
- package/src/NotificationPermissionsModule.kepler.ts +8 -0
- package/src/NotificationPermissionsModule.native.ts +7 -0
- package/src/NotificationPermissionsModule.ts +83 -0
- package/src/NotificationPermissionsModule.types.ts +13 -0
- package/src/NotificationPresenterModule.kepler.ts +67 -0
- package/src/NotificationPresenterModule.native.ts +5 -0
- package/src/NotificationPresenterModule.ts +6 -0
- package/src/NotificationPresenterModule.types.ts +13 -0
- package/src/NotificationScheduler.kepler.ts +63 -0
- package/src/NotificationScheduler.native.ts +5 -0
- package/src/NotificationScheduler.ts +6 -0
- package/src/NotificationScheduler.types.ts +89 -0
- package/src/Notifications.types.ts +722 -0
- package/src/NotificationsEmitter.ts +111 -0
- package/src/NotificationsEmitterModule.kepler.ts +8 -0
- package/src/NotificationsEmitterModule.native.ts +5 -0
- package/src/NotificationsEmitterModule.ts +17 -0
- package/src/NotificationsEmitterModule.types.ts +7 -0
- package/src/NotificationsHandler.ts +120 -0
- package/src/NotificationsHandlerModule.kepler.ts +8 -0
- package/src/NotificationsHandlerModule.native.ts +5 -0
- package/src/NotificationsHandlerModule.ts +17 -0
- package/src/NotificationsHandlerModule.types.ts +10 -0
- package/src/PushTokenManager.kepler.ts +8 -0
- package/src/PushTokenManager.native.ts +5 -0
- package/src/PushTokenManager.ts +17 -0
- package/src/PushTokenManager.types.ts +6 -0
- package/src/ServerRegistrationModule.kepler.ts +8 -0
- package/src/ServerRegistrationModule.native.ts +7 -0
- package/src/ServerRegistrationModule.ts +6 -0
- package/src/ServerRegistrationModule.types.ts +7 -0
- package/src/ServerRegistrationModule.web.ts +56 -0
- package/src/TokenEmitter.ts +56 -0
- package/src/Tokens.types.ts +110 -0
- package/src/cancelAllScheduledNotificationsAsync.ts +16 -0
- package/src/cancelScheduledNotificationAsync.ts +31 -0
- package/src/deleteNotificationCategoryAsync.ts +23 -0
- package/src/deleteNotificationChannelAsync.android.ts +11 -0
- package/src/deleteNotificationChannelAsync.ts +10 -0
- package/src/deleteNotificationChannelGroupAsync.android.ts +11 -0
- package/src/deleteNotificationChannelGroupAsync.ts +10 -0
- package/src/dismissAllNotificationsAsync.ts +16 -0
- package/src/dismissNotificationAsync.ts +19 -0
- package/src/getAllScheduledNotificationsAsync.ts +17 -0
- package/src/getBadgeCountAsync.ts +17 -0
- package/src/getDevicePushTokenAsync.ts +31 -0
- package/src/getDevicePushTokenAsync.web.ts +122 -0
- package/src/getExpoPushTokenAsync.ts +238 -0
- package/src/getNextTriggerDateAsync.ts +38 -0
- package/src/getNotificationCategoriesAsync.ts +21 -0
- package/src/getNotificationChannelAsync.android.ts +13 -0
- package/src/getNotificationChannelAsync.ts +16 -0
- package/src/getNotificationChannelGroupAsync.android.ts +14 -0
- package/src/getNotificationChannelGroupAsync.ts +17 -0
- package/src/getNotificationChannelGroupsAsync.android.ts +13 -0
- package/src/getNotificationChannelGroupsAsync.ts +15 -0
- package/src/getNotificationChannelsAsync.android.ts +11 -0
- package/src/getNotificationChannelsAsync.ts +13 -0
- package/src/getPresentedNotificationsAsync.ts +18 -0
- package/src/index.ts +38 -0
- package/src/kepler/NotificationContent.ts +119 -0
- package/src/kepler/index.ts +16 -0
- package/src/kepler/native-notification-manager.ts +10 -0
- package/src/kepler/types/NotificationManagerTypes.ts +508 -0
- package/src/kepler/types/index.ts +16 -0
- package/src/presentNotificationAsync.ts +32 -0
- package/src/registerTaskAsync.ts +39 -0
- package/src/scheduleNotificationAsync.ts +335 -0
- package/src/setBadgeCountAsync.ts +32 -0
- package/src/setNotificationCategoryAsync.ts +37 -0
- package/src/setNotificationChannelAsync.android.ts +15 -0
- package/src/setNotificationChannelAsync.ts +28 -0
- package/src/setNotificationChannelGroupAsync.android.ts +18 -0
- package/src/setNotificationChannelGroupAsync.ts +21 -0
- package/src/unregisterForNotificationsAsync.ts +11 -0
- package/src/unregisterTaskAsync.ts +17 -0
- package/src/useLastNotificationResponse.ts +70 -0
- package/src/utils/keplerUuidUtils.ts +29 -0
- package/src/utils/updateDevicePushTokenAsync.ts +147 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ProxyNativeModule } from 'expo-modules-core';
|
|
2
|
+
export declare enum AndroidNotificationVisibility {
|
|
3
|
+
UNKNOWN = 0,
|
|
4
|
+
PUBLIC = 1,
|
|
5
|
+
PRIVATE = 2,
|
|
6
|
+
SECRET = 3
|
|
7
|
+
}
|
|
8
|
+
export declare enum AndroidAudioContentType {
|
|
9
|
+
UNKNOWN = 0,
|
|
10
|
+
SPEECH = 1,
|
|
11
|
+
MUSIC = 2,
|
|
12
|
+
MOVIE = 3,
|
|
13
|
+
SONIFICATION = 4
|
|
14
|
+
}
|
|
15
|
+
export declare enum AndroidImportance {
|
|
16
|
+
UNKNOWN = 0,
|
|
17
|
+
UNSPECIFIED = 1,
|
|
18
|
+
NONE = 2,
|
|
19
|
+
MIN = 3,
|
|
20
|
+
LOW = 4,
|
|
21
|
+
DEFAULT = 5,
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `DEFAULT` instead.
|
|
24
|
+
*/
|
|
25
|
+
DEEFAULT = 5,
|
|
26
|
+
HIGH = 6,
|
|
27
|
+
MAX = 7
|
|
28
|
+
}
|
|
29
|
+
export declare enum AndroidAudioUsage {
|
|
30
|
+
UNKNOWN = 0,
|
|
31
|
+
MEDIA = 1,
|
|
32
|
+
VOICE_COMMUNICATION = 2,
|
|
33
|
+
VOICE_COMMUNICATION_SIGNALLING = 3,
|
|
34
|
+
ALARM = 4,
|
|
35
|
+
NOTIFICATION = 5,
|
|
36
|
+
NOTIFICATION_RINGTONE = 6,
|
|
37
|
+
NOTIFICATION_COMMUNICATION_REQUEST = 7,
|
|
38
|
+
NOTIFICATION_COMMUNICATION_INSTANT = 8,
|
|
39
|
+
NOTIFICATION_COMMUNICATION_DELAYED = 9,
|
|
40
|
+
NOTIFICATION_EVENT = 10,
|
|
41
|
+
ASSISTANCE_ACCESSIBILITY = 11,
|
|
42
|
+
ASSISTANCE_NAVIGATION_GUIDANCE = 12,
|
|
43
|
+
ASSISTANCE_SONIFICATION = 13,
|
|
44
|
+
GAME = 14
|
|
45
|
+
}
|
|
46
|
+
export interface AudioAttributes {
|
|
47
|
+
usage: AndroidAudioUsage;
|
|
48
|
+
contentType: AndroidAudioContentType;
|
|
49
|
+
flags: {
|
|
50
|
+
enforceAudibility: boolean;
|
|
51
|
+
requestHardwareAudioVideoSynchronization: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export type AudioAttributesInput = Partial<AudioAttributes>;
|
|
55
|
+
/**
|
|
56
|
+
* An object represents a notification channel.
|
|
57
|
+
* @platform android
|
|
58
|
+
*/
|
|
59
|
+
export interface NotificationChannel {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string | null;
|
|
62
|
+
importance: AndroidImportance;
|
|
63
|
+
bypassDnd: boolean;
|
|
64
|
+
description: string | null;
|
|
65
|
+
groupId?: string | null;
|
|
66
|
+
lightColor: string;
|
|
67
|
+
lockscreenVisibility: AndroidNotificationVisibility;
|
|
68
|
+
showBadge: boolean;
|
|
69
|
+
sound: 'default' | 'custom' | null;
|
|
70
|
+
audioAttributes: AudioAttributes;
|
|
71
|
+
vibrationPattern: number[] | null;
|
|
72
|
+
enableLights: boolean;
|
|
73
|
+
enableVibrate: boolean;
|
|
74
|
+
}
|
|
75
|
+
type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
|
|
76
|
+
/**
|
|
77
|
+
* An object represents a notification channel to be set.
|
|
78
|
+
* @platform android
|
|
79
|
+
*/
|
|
80
|
+
export type NotificationChannelInput = RequiredBy<Omit<NotificationChannel, 'id' | 'audioAttributes' | 'sound'> & {
|
|
81
|
+
audioAttributes?: AudioAttributesInput;
|
|
82
|
+
sound?: string | null;
|
|
83
|
+
}, 'name' | 'importance'>;
|
|
84
|
+
export interface NotificationChannelManager extends ProxyNativeModule {
|
|
85
|
+
getNotificationChannelsAsync?: () => Promise<NotificationChannel[] | null>;
|
|
86
|
+
getNotificationChannelAsync?: (channelId: string) => Promise<NotificationChannel | null>;
|
|
87
|
+
setNotificationChannelAsync?: (channelId: string, channelConfiguration: NotificationChannelInput) => Promise<NotificationChannel | null>;
|
|
88
|
+
deleteNotificationChannelAsync?: (channelId: string) => Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=NotificationChannelManager.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationChannelManager.types.d.ts","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,oBAAY,6BAA6B;IACvC,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAGD,oBAAY,uBAAuB;IACjC,OAAO,IAAI;IACX,MAAM,IAAI;IACV,KAAK,IAAI;IACT,KAAK,IAAI;IACT,YAAY,IAAI;CACjB;AAGD,oBAAY,iBAAiB;IAC3B,OAAO,IAAI;IACX,WAAW,IAAI;IACf,IAAI,IAAI;IACR,GAAG,IAAI;IACP,GAAG,IAAI;IACP,OAAO,IAAI;IACX;;OAEG;IACH,QAAQ,IAAI;IACZ,IAAI,IAAI;IACR,GAAG,IAAI;CACR;AAGD,oBAAY,iBAAiB;IAC3B,OAAO,IAAI;IACX,KAAK,IAAI;IACT,mBAAmB,IAAI;IACvB,8BAA8B,IAAI;IAClC,KAAK,IAAI;IACT,YAAY,IAAI;IAChB,qBAAqB,IAAI;IACzB,kCAAkC,IAAI;IACtC,kCAAkC,IAAI;IACtC,kCAAkC,IAAI;IACtC,kBAAkB,KAAK;IACvB,wBAAwB,KAAK;IAC7B,8BAA8B,KAAK;IACnC,uBAAuB,KAAK;IAC5B,IAAI,KAAK;CACV;AAGD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,uBAAuB,CAAC;IACrC,KAAK,EAAE;QACL,iBAAiB,EAAE,OAAO,CAAC;QAC3B,wCAAwC,EAAE,OAAO,CAAC;KACnD,CAAC;CACH;AAKD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,6BAA6B,CAAC;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAC/C,IAAI,CACF,mBAAmB,EACjB,IAAI,GACJ,iBAAiB,GACjB,OAAO,CACV,GAAG;IAAE,eAAe,CAAC,EAAE,oBAAoB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACrE,MAAM,GAAG,YAAY,CACtB,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACnE,4BAA4B,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3E,2BAA2B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACzF,2BAA2B,CAAC,EAAE,CAC5B,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,wBAAwB,KAC3C,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACzC,8BAA8B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// @docsMissing
|
|
2
|
+
export var AndroidNotificationVisibility;
|
|
3
|
+
(function (AndroidNotificationVisibility) {
|
|
4
|
+
AndroidNotificationVisibility[AndroidNotificationVisibility["UNKNOWN"] = 0] = "UNKNOWN";
|
|
5
|
+
AndroidNotificationVisibility[AndroidNotificationVisibility["PUBLIC"] = 1] = "PUBLIC";
|
|
6
|
+
AndroidNotificationVisibility[AndroidNotificationVisibility["PRIVATE"] = 2] = "PRIVATE";
|
|
7
|
+
AndroidNotificationVisibility[AndroidNotificationVisibility["SECRET"] = 3] = "SECRET";
|
|
8
|
+
})(AndroidNotificationVisibility || (AndroidNotificationVisibility = {}));
|
|
9
|
+
// @docsMissing
|
|
10
|
+
export var AndroidAudioContentType;
|
|
11
|
+
(function (AndroidAudioContentType) {
|
|
12
|
+
AndroidAudioContentType[AndroidAudioContentType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
13
|
+
AndroidAudioContentType[AndroidAudioContentType["SPEECH"] = 1] = "SPEECH";
|
|
14
|
+
AndroidAudioContentType[AndroidAudioContentType["MUSIC"] = 2] = "MUSIC";
|
|
15
|
+
AndroidAudioContentType[AndroidAudioContentType["MOVIE"] = 3] = "MOVIE";
|
|
16
|
+
AndroidAudioContentType[AndroidAudioContentType["SONIFICATION"] = 4] = "SONIFICATION";
|
|
17
|
+
})(AndroidAudioContentType || (AndroidAudioContentType = {}));
|
|
18
|
+
// @docsMissing
|
|
19
|
+
export var AndroidImportance;
|
|
20
|
+
(function (AndroidImportance) {
|
|
21
|
+
AndroidImportance[AndroidImportance["UNKNOWN"] = 0] = "UNKNOWN";
|
|
22
|
+
AndroidImportance[AndroidImportance["UNSPECIFIED"] = 1] = "UNSPECIFIED";
|
|
23
|
+
AndroidImportance[AndroidImportance["NONE"] = 2] = "NONE";
|
|
24
|
+
AndroidImportance[AndroidImportance["MIN"] = 3] = "MIN";
|
|
25
|
+
AndroidImportance[AndroidImportance["LOW"] = 4] = "LOW";
|
|
26
|
+
AndroidImportance[AndroidImportance["DEFAULT"] = 5] = "DEFAULT";
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `DEFAULT` instead.
|
|
29
|
+
*/
|
|
30
|
+
AndroidImportance[AndroidImportance["DEEFAULT"] = 5] = "DEEFAULT";
|
|
31
|
+
AndroidImportance[AndroidImportance["HIGH"] = 6] = "HIGH";
|
|
32
|
+
AndroidImportance[AndroidImportance["MAX"] = 7] = "MAX";
|
|
33
|
+
})(AndroidImportance || (AndroidImportance = {}));
|
|
34
|
+
// @docsMissing
|
|
35
|
+
export var AndroidAudioUsage;
|
|
36
|
+
(function (AndroidAudioUsage) {
|
|
37
|
+
AndroidAudioUsage[AndroidAudioUsage["UNKNOWN"] = 0] = "UNKNOWN";
|
|
38
|
+
AndroidAudioUsage[AndroidAudioUsage["MEDIA"] = 1] = "MEDIA";
|
|
39
|
+
AndroidAudioUsage[AndroidAudioUsage["VOICE_COMMUNICATION"] = 2] = "VOICE_COMMUNICATION";
|
|
40
|
+
AndroidAudioUsage[AndroidAudioUsage["VOICE_COMMUNICATION_SIGNALLING"] = 3] = "VOICE_COMMUNICATION_SIGNALLING";
|
|
41
|
+
AndroidAudioUsage[AndroidAudioUsage["ALARM"] = 4] = "ALARM";
|
|
42
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION"] = 5] = "NOTIFICATION";
|
|
43
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_RINGTONE"] = 6] = "NOTIFICATION_RINGTONE";
|
|
44
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_REQUEST"] = 7] = "NOTIFICATION_COMMUNICATION_REQUEST";
|
|
45
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_INSTANT"] = 8] = "NOTIFICATION_COMMUNICATION_INSTANT";
|
|
46
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_COMMUNICATION_DELAYED"] = 9] = "NOTIFICATION_COMMUNICATION_DELAYED";
|
|
47
|
+
AndroidAudioUsage[AndroidAudioUsage["NOTIFICATION_EVENT"] = 10] = "NOTIFICATION_EVENT";
|
|
48
|
+
AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_ACCESSIBILITY"] = 11] = "ASSISTANCE_ACCESSIBILITY";
|
|
49
|
+
AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_NAVIGATION_GUIDANCE"] = 12] = "ASSISTANCE_NAVIGATION_GUIDANCE";
|
|
50
|
+
AndroidAudioUsage[AndroidAudioUsage["ASSISTANCE_SONIFICATION"] = 13] = "ASSISTANCE_SONIFICATION";
|
|
51
|
+
AndroidAudioUsage[AndroidAudioUsage["GAME"] = 14] = "GAME";
|
|
52
|
+
})(AndroidAudioUsage || (AndroidAudioUsage = {}));
|
|
53
|
+
//# sourceMappingURL=NotificationChannelManager.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationChannelManager.types.js","sourceRoot":"","sources":["../src/NotificationChannelManager.types.ts"],"names":[],"mappings":"AAEA,eAAe;AACf,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,uFAAW,CAAA;IACX,qFAAU,CAAA;IACV,uFAAW,CAAA;IACX,qFAAU,CAAA;AACZ,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAED,eAAe;AACf,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,2EAAW,CAAA;IACX,yEAAU,CAAA;IACV,uEAAS,CAAA;IACT,uEAAS,CAAA;IACT,qFAAgB,CAAA;AAClB,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAED,eAAe;AACf,MAAM,CAAN,IAAY,iBAaX;AAbD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,uEAAe,CAAA;IACf,yDAAQ,CAAA;IACR,uDAAO,CAAA;IACP,uDAAO,CAAA;IACP,+DAAW,CAAA;IACX;;OAEG;IACH,iEAAY,CAAA;IACZ,yDAAQ,CAAA;IACR,uDAAO,CAAA;AACT,CAAC,EAbW,iBAAiB,KAAjB,iBAAiB,QAa5B;AAED,eAAe;AACf,MAAM,CAAN,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IAC3B,+DAAW,CAAA;IACX,2DAAS,CAAA;IACT,uFAAuB,CAAA;IACvB,6GAAkC,CAAA;IAClC,2DAAS,CAAA;IACT,yEAAgB,CAAA;IAChB,2FAAyB,CAAA;IACzB,qHAAsC,CAAA;IACtC,qHAAsC,CAAA;IACtC,qHAAsC,CAAA;IACtC,sFAAuB,CAAA;IACvB,kGAA6B,CAAA;IAC7B,8GAAmC,CAAA;IACnC,gGAA4B,CAAA;IAC5B,0DAAS,CAAA;AACX,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\n// @docsMissing\nexport enum AndroidNotificationVisibility {\n UNKNOWN = 0,\n PUBLIC = 1,\n PRIVATE = 2,\n SECRET = 3,\n}\n\n// @docsMissing\nexport enum AndroidAudioContentType {\n UNKNOWN = 0,\n SPEECH = 1,\n MUSIC = 2,\n MOVIE = 3,\n SONIFICATION = 4,\n}\n\n// @docsMissing\nexport enum AndroidImportance {\n UNKNOWN = 0,\n UNSPECIFIED = 1,\n NONE = 2,\n MIN = 3,\n LOW = 4,\n DEFAULT = 5,\n /**\n * @deprecated Use `DEFAULT` instead.\n */\n DEEFAULT = 5,\n HIGH = 6,\n MAX = 7,\n}\n\n// @docsMissing\nexport enum AndroidAudioUsage {\n UNKNOWN = 0,\n MEDIA = 1,\n VOICE_COMMUNICATION = 2,\n VOICE_COMMUNICATION_SIGNALLING = 3,\n ALARM = 4,\n NOTIFICATION = 5,\n NOTIFICATION_RINGTONE = 6,\n NOTIFICATION_COMMUNICATION_REQUEST = 7,\n NOTIFICATION_COMMUNICATION_INSTANT = 8,\n NOTIFICATION_COMMUNICATION_DELAYED = 9,\n NOTIFICATION_EVENT = 10,\n ASSISTANCE_ACCESSIBILITY = 11,\n ASSISTANCE_NAVIGATION_GUIDANCE = 12,\n ASSISTANCE_SONIFICATION = 13,\n GAME = 14,\n}\n\n// @docsMissing\nexport interface AudioAttributes {\n usage: AndroidAudioUsage;\n contentType: AndroidAudioContentType;\n flags: {\n enforceAudibility: boolean;\n requestHardwareAudioVideoSynchronization: boolean;\n };\n}\n\n// We're making inner flags required to set intentionally.\n// Not providing `true` for a flag makes it false, it doesn't make sense\n// to let it be left undefined.\nexport type AudioAttributesInput = Partial<AudioAttributes>;\n\n/**\n * An object represents a notification channel.\n * @platform android\n */\nexport interface NotificationChannel {\n id: string;\n name: string | null;\n importance: AndroidImportance;\n bypassDnd: boolean;\n description: string | null;\n groupId?: string | null;\n lightColor: string;\n lockscreenVisibility: AndroidNotificationVisibility;\n showBadge: boolean;\n sound: 'default' | 'custom' | null;\n audioAttributes: AudioAttributes;\n vibrationPattern: number[] | null;\n enableLights: boolean;\n enableVibrate: boolean;\n}\n\ntype RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;\n\n/**\n * An object represents a notification channel to be set.\n * @platform android\n */\nexport type NotificationChannelInput = RequiredBy<\n Omit<\n NotificationChannel,\n | 'id' // id is handled separately as a function argument\n | 'audioAttributes' // need to make it AudioAttributesInput\n | 'sound'\n > & { audioAttributes?: AudioAttributesInput; sound?: string | null },\n 'name' | 'importance'\n>;\n\nexport interface NotificationChannelManager extends ProxyNativeModule {\n getNotificationChannelsAsync?: () => Promise<NotificationChannel[] | null>;\n getNotificationChannelAsync?: (channelId: string) => Promise<NotificationChannel | null>;\n setNotificationChannelAsync?: (\n channelId: string,\n channelConfiguration: NotificationChannelInput\n ) => Promise<NotificationChannel | null>;\n deleteNotificationChannelAsync?: (channelId: string) => Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NotificationPermissionsRequest, NotificationPermissionsStatus } from './NotificationPermissions.types';
|
|
2
|
+
/**
|
|
3
|
+
* Calling this function checks current permissions settings related to notifications.
|
|
4
|
+
* It lets you verify whether the app is currently allowed to display alerts, play sounds, etc.
|
|
5
|
+
* There is no user-facing effect of calling this.
|
|
6
|
+
* @return It returns a `Promise` resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
7
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).
|
|
8
|
+
* @example Check if the app is allowed to send any type of notifications (interrupting and non-interrupting–provisional on iOS).
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as Notifications from '@amazon-devices/expo-notifications';
|
|
11
|
+
*
|
|
12
|
+
* export async function allowsNotificationsAsync() {
|
|
13
|
+
* const settings = await Notifications.getPermissionsAsync();
|
|
14
|
+
* return (
|
|
15
|
+
* settings.granted || settings.ios?.status === Notifications.IosAuthorizationStatus.PROVISIONAL
|
|
16
|
+
* );
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
* @header permissions
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPermissionsAsync(): Promise<NotificationPermissionsStatus>;
|
|
22
|
+
/**
|
|
23
|
+
* Prompts the user for notification permissions according to request. **Request defaults to asking the user to allow displaying alerts,
|
|
24
|
+
* setting badge count and playing sounds**.
|
|
25
|
+
* @param permissions An object representing configuration for the request scope.
|
|
26
|
+
* @return It returns a Promise resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
27
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).
|
|
28
|
+
* @example Prompts the user to allow the app to show alerts, play sounds, set badge count and let Siri read out messages through AirPods.
|
|
29
|
+
* ```ts
|
|
30
|
+
* import * as Notifications from '@amazon-devices/expo-notifications';
|
|
31
|
+
*
|
|
32
|
+
* export function requestPermissionsAsync() {
|
|
33
|
+
* return await Notifications.requestPermissionsAsync({
|
|
34
|
+
* ios: {
|
|
35
|
+
* allowAlert: true,
|
|
36
|
+
* allowBadge: true,
|
|
37
|
+
* allowSound: true,
|
|
38
|
+
* allowAnnouncements: true,
|
|
39
|
+
* },
|
|
40
|
+
* });
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
* @header permissions
|
|
44
|
+
*/
|
|
45
|
+
export declare function requestPermissionsAsync(permissions?: NotificationPermissionsRequest): Promise<NotificationPermissionsStatus>;
|
|
46
|
+
/**
|
|
47
|
+
* Check or request permissions to send and receive push notifications.
|
|
48
|
+
* This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const [permissionResponse, requestPermission] = Notifications.usePermissions();
|
|
52
|
+
* ```
|
|
53
|
+
* @header permission
|
|
54
|
+
*/
|
|
55
|
+
export declare const usePermissions: (options?: import("expo-modules-core").PermissionHookOptions<NotificationPermissionsRequest> | undefined) => [NotificationPermissionsStatus | null, () => Promise<NotificationPermissionsStatus>, () => Promise<NotificationPermissionsStatus>];
|
|
56
|
+
//# sourceMappingURL=NotificationPermissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.d.ts","sourceRoot":"","sources":["../src/NotificationPermissions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AAGzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,2CAMxC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,8BAA8B,0CAczF;AAGD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,iPAMzB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createPermissionHook, Platform, UnavailabilityError } from 'expo-modules-core';
|
|
2
|
+
import NotificationPermissionsModule from './NotificationPermissionsModule';
|
|
3
|
+
/**
|
|
4
|
+
* Calling this function checks current permissions settings related to notifications.
|
|
5
|
+
* It lets you verify whether the app is currently allowed to display alerts, play sounds, etc.
|
|
6
|
+
* There is no user-facing effect of calling this.
|
|
7
|
+
* @return It returns a `Promise` resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
8
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).
|
|
9
|
+
* @example Check if the app is allowed to send any type of notifications (interrupting and non-interrupting–provisional on iOS).
|
|
10
|
+
* ```ts
|
|
11
|
+
* import * as Notifications from '@amazon-devices/expo-notifications';
|
|
12
|
+
*
|
|
13
|
+
* export async function allowsNotificationsAsync() {
|
|
14
|
+
* const settings = await Notifications.getPermissionsAsync();
|
|
15
|
+
* return (
|
|
16
|
+
* settings.granted || settings.ios?.status === Notifications.IosAuthorizationStatus.PROVISIONAL
|
|
17
|
+
* );
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
* @header permissions
|
|
21
|
+
*/
|
|
22
|
+
export async function getPermissionsAsync() {
|
|
23
|
+
if (!NotificationPermissionsModule.getPermissionsAsync) {
|
|
24
|
+
throw new UnavailabilityError('Notifications', 'getPermissionsAsync');
|
|
25
|
+
}
|
|
26
|
+
return await NotificationPermissionsModule.getPermissionsAsync();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Prompts the user for notification permissions according to request. **Request defaults to asking the user to allow displaying alerts,
|
|
30
|
+
* setting badge count and playing sounds**.
|
|
31
|
+
* @param permissions An object representing configuration for the request scope.
|
|
32
|
+
* @return It returns a Promise resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).
|
|
33
|
+
* On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).
|
|
34
|
+
* @example Prompts the user to allow the app to show alerts, play sounds, set badge count and let Siri read out messages through AirPods.
|
|
35
|
+
* ```ts
|
|
36
|
+
* import * as Notifications from '@amazon-devices/expo-notifications';
|
|
37
|
+
*
|
|
38
|
+
* export function requestPermissionsAsync() {
|
|
39
|
+
* return await Notifications.requestPermissionsAsync({
|
|
40
|
+
* ios: {
|
|
41
|
+
* allowAlert: true,
|
|
42
|
+
* allowBadge: true,
|
|
43
|
+
* allowSound: true,
|
|
44
|
+
* allowAnnouncements: true,
|
|
45
|
+
* },
|
|
46
|
+
* });
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
* @header permissions
|
|
50
|
+
*/
|
|
51
|
+
export async function requestPermissionsAsync(permissions) {
|
|
52
|
+
if (!NotificationPermissionsModule.requestPermissionsAsync) {
|
|
53
|
+
throw new UnavailabilityError('Notifications', 'requestPermissionsAsync');
|
|
54
|
+
}
|
|
55
|
+
const requestedPermissions = permissions ?? {
|
|
56
|
+
ios: {
|
|
57
|
+
allowAlert: true,
|
|
58
|
+
allowBadge: true,
|
|
59
|
+
allowSound: true,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const requestedPlatformPermissions = requestedPermissions[Platform.OS];
|
|
63
|
+
return await NotificationPermissionsModule.requestPermissionsAsync(requestedPlatformPermissions);
|
|
64
|
+
}
|
|
65
|
+
// @needsAudit
|
|
66
|
+
/**
|
|
67
|
+
* Check or request permissions to send and receive push notifications.
|
|
68
|
+
* This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const [permissionResponse, requestPermission] = Notifications.usePermissions();
|
|
72
|
+
* ```
|
|
73
|
+
* @header permission
|
|
74
|
+
*/
|
|
75
|
+
export const usePermissions = createPermissionHook({
|
|
76
|
+
requestMethod: requestPermissionsAsync,
|
|
77
|
+
getMethod: getPermissionsAsync,
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=NotificationPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.js","sourceRoot":"","sources":["../src/NotificationPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAMxF,OAAO,6BAA6B,MAAM,iCAAiC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,IAAI,CAAC,6BAA6B,CAAC,mBAAmB,EAAE,CAAC;QACvD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,MAAM,6BAA6B,CAAC,mBAAmB,EAAE,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,WAA4C;IACxF,IAAI,CAAC,6BAA6B,CAAC,uBAAuB,EAAE,CAAC;QAC3D,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,oBAAoB,GAAG,WAAW,IAAI;QAC1C,GAAG,EAAE;YACH,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB;KACF,CAAC;IACF,MAAM,4BAA4B,GAAG,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvE,OAAO,MAAM,6BAA6B,CAAC,uBAAuB,CAAC,4BAA4B,CAAC,CAAC;AACnG,CAAC;AAED,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAGhD;IACA,aAAa,EAAE,uBAAuB;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC,CAAC","sourcesContent":["import { createPermissionHook, Platform, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n NotificationPermissionsRequest,\n NotificationPermissionsStatus,\n} from './NotificationPermissions.types';\nimport NotificationPermissionsModule from './NotificationPermissionsModule';\n\n/**\n * Calling this function checks current permissions settings related to notifications.\n * It lets you verify whether the app is currently allowed to display alerts, play sounds, etc.\n * There is no user-facing effect of calling this.\n * @return It returns a `Promise` resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).\n * On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).\n * @example Check if the app is allowed to send any type of notifications (interrupting and non-interrupting–provisional on iOS).\n * ```ts\n * import * as Notifications from '@amazon-devices/expo-notifications';\n *\n * export async function allowsNotificationsAsync() {\n * const settings = await Notifications.getPermissionsAsync();\n * return (\n * settings.granted || settings.ios?.status === Notifications.IosAuthorizationStatus.PROVISIONAL\n * );\n * }\n * ```\n * @header permissions\n */\nexport async function getPermissionsAsync() {\n if (!NotificationPermissionsModule.getPermissionsAsync) {\n throw new UnavailabilityError('Notifications', 'getPermissionsAsync');\n }\n\n return await NotificationPermissionsModule.getPermissionsAsync();\n}\n\n/**\n * Prompts the user for notification permissions according to request. **Request defaults to asking the user to allow displaying alerts,\n * setting badge count and playing sounds**.\n * @param permissions An object representing configuration for the request scope.\n * @return It returns a Promise resolving to an object represents permission settings ([`NotificationPermissionsStatus`](#notificationpermissionsstatus)).\n * On iOS, make sure you [properly interpret the permissions response](#interpret-the-ios-permissions-response).\n * @example Prompts the user to allow the app to show alerts, play sounds, set badge count and let Siri read out messages through AirPods.\n * ```ts\n * import * as Notifications from '@amazon-devices/expo-notifications';\n *\n * export function requestPermissionsAsync() {\n * return await Notifications.requestPermissionsAsync({\n * ios: {\n * allowAlert: true,\n * allowBadge: true,\n * allowSound: true,\n * allowAnnouncements: true,\n * },\n * });\n * }\n * ```\n * @header permissions\n */\nexport async function requestPermissionsAsync(permissions?: NotificationPermissionsRequest) {\n if (!NotificationPermissionsModule.requestPermissionsAsync) {\n throw new UnavailabilityError('Notifications', 'requestPermissionsAsync');\n }\n\n const requestedPermissions = permissions ?? {\n ios: {\n allowAlert: true,\n allowBadge: true,\n allowSound: true,\n },\n };\n const requestedPlatformPermissions = requestedPermissions[Platform.OS];\n return await NotificationPermissionsModule.requestPermissionsAsync(requestedPlatformPermissions);\n}\n\n// @needsAudit\n/**\n * Check or request permissions to send and receive push notifications.\n * This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.\n * @example\n * ```ts\n * const [permissionResponse, requestPermission] = Notifications.usePermissions();\n * ```\n * @header permission\n */\nexport const usePermissions = createPermissionHook<\n NotificationPermissionsStatus,\n NotificationPermissionsRequest\n>({\n requestMethod: requestPermissionsAsync,\n getMethod: getPermissionsAsync,\n});\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { PermissionResponse, PermissionHookOptions } from 'expo-modules-core';
|
|
2
|
+
export declare enum IosAlertStyle {
|
|
3
|
+
NONE = 0,
|
|
4
|
+
BANNER = 1,
|
|
5
|
+
ALERT = 2
|
|
6
|
+
}
|
|
7
|
+
export declare enum IosAllowsPreviews {
|
|
8
|
+
NEVER = 0,
|
|
9
|
+
ALWAYS = 1,
|
|
10
|
+
WHEN_AUTHENTICATED = 2
|
|
11
|
+
}
|
|
12
|
+
export declare enum IosAuthorizationStatus {
|
|
13
|
+
NOT_DETERMINED = 0,
|
|
14
|
+
DENIED = 1,
|
|
15
|
+
AUTHORIZED = 2,
|
|
16
|
+
PROVISIONAL = 3,
|
|
17
|
+
EPHEMERAL = 4
|
|
18
|
+
}
|
|
19
|
+
export { PermissionHookOptions };
|
|
20
|
+
export interface NotificationPermissionsStatus extends PermissionResponse {
|
|
21
|
+
android?: {
|
|
22
|
+
importance: number;
|
|
23
|
+
interruptionFilter?: number;
|
|
24
|
+
};
|
|
25
|
+
ios?: {
|
|
26
|
+
status: IosAuthorizationStatus;
|
|
27
|
+
allowsDisplayInNotificationCenter: boolean | null;
|
|
28
|
+
allowsDisplayOnLockScreen: boolean | null;
|
|
29
|
+
allowsDisplayInCarPlay: boolean | null;
|
|
30
|
+
allowsAlert: boolean | null;
|
|
31
|
+
allowsBadge: boolean | null;
|
|
32
|
+
allowsSound: boolean | null;
|
|
33
|
+
allowsCriticalAlerts?: boolean | null;
|
|
34
|
+
alertStyle: IosAlertStyle;
|
|
35
|
+
allowsPreviews?: IosAllowsPreviews;
|
|
36
|
+
providesAppNotificationSettings?: boolean;
|
|
37
|
+
allowsAnnouncements?: boolean | null;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Available configuration for permission request on iOS platform.
|
|
42
|
+
* See Apple documentation for [`UNAuthorizationOptions`](https://developer.apple.com/documentation/usernotifications/unauthorizationoptions) to learn more.
|
|
43
|
+
*/
|
|
44
|
+
export interface IosNotificationPermissionsRequest {
|
|
45
|
+
/**
|
|
46
|
+
* The ability to display alerts.
|
|
47
|
+
*/
|
|
48
|
+
allowAlert?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The ability to update the app’s badge.
|
|
51
|
+
*/
|
|
52
|
+
allowBadge?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The ability to play sounds.
|
|
55
|
+
*/
|
|
56
|
+
allowSound?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The ability to display notifications in a CarPlay environment.
|
|
59
|
+
*/
|
|
60
|
+
allowDisplayInCarPlay?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The ability to play sounds for critical alerts.
|
|
63
|
+
*/
|
|
64
|
+
allowCriticalAlerts?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* An option indicating the system should display a button for in-app notification settings.
|
|
67
|
+
*/
|
|
68
|
+
provideAppNotificationSettings?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The ability to post noninterrupting notifications provisionally to the Notification Center.
|
|
71
|
+
*/
|
|
72
|
+
allowProvisional?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The ability for Siri to automatically read out messages over AirPods.
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
77
|
+
allowAnnouncements?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export type NativeNotificationPermissionsRequest = IosNotificationPermissionsRequest | object;
|
|
80
|
+
/**
|
|
81
|
+
* An interface representing the permissions request scope configuration.
|
|
82
|
+
* Each option corresponds to a different native platform authorization option.
|
|
83
|
+
*/
|
|
84
|
+
export interface NotificationPermissionsRequest {
|
|
85
|
+
/**
|
|
86
|
+
* Available configuration for permission request on iOS platform.
|
|
87
|
+
*/
|
|
88
|
+
ios?: IosNotificationPermissionsRequest;
|
|
89
|
+
/**
|
|
90
|
+
* On Android, all available permissions are granted by default, and if a user declines any permission, an app cannot prompt the user to change.
|
|
91
|
+
*/
|
|
92
|
+
android?: object;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=NotificationPermissions.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.types.d.ts","sourceRoot":"","sources":["../src/NotificationPermissions.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,oBAAY,aAAa;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED,oBAAY,iBAAiB;IAC3B,KAAK,IAAI;IACT,MAAM,IAAI;IACV,kBAAkB,IAAI;CACvB;AAED,oBAAY,sBAAsB;IAChC,cAAc,IAAI;IAClB,MAAM,IAAI;IACV,UAAU,IAAI;IACd,WAAW,IAAI;IACf,SAAS,IAAI;CACd;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAGjC,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,OAAO,CAAC,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,MAAM,EAAE,sBAAsB,CAAC;QAC/B,iCAAiC,EAAE,OAAO,GAAG,IAAI,CAAC;QAClD,yBAAyB,EAAE,OAAO,GAAG,IAAI,CAAC;QAC1C,sBAAsB,EAAE,OAAO,GAAG,IAAI,CAAC;QACvC,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QACtC,UAAU,EAAE,aAAa,CAAC;QAC1B,cAAc,CAAC,EAAE,iBAAiB,CAAC;QACnC,+BAA+B,CAAC,EAAE,OAAO,CAAC;QAC1C,mBAAmB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KACtC,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,MAAM,oCAAoC,GAAG,iCAAiC,GAAG,MAAM,CAAC;AAE9F;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,GAAG,CAAC,EAAE,iCAAiC,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export var IosAlertStyle;
|
|
2
|
+
(function (IosAlertStyle) {
|
|
3
|
+
IosAlertStyle[IosAlertStyle["NONE"] = 0] = "NONE";
|
|
4
|
+
IosAlertStyle[IosAlertStyle["BANNER"] = 1] = "BANNER";
|
|
5
|
+
IosAlertStyle[IosAlertStyle["ALERT"] = 2] = "ALERT";
|
|
6
|
+
})(IosAlertStyle || (IosAlertStyle = {}));
|
|
7
|
+
export var IosAllowsPreviews;
|
|
8
|
+
(function (IosAllowsPreviews) {
|
|
9
|
+
IosAllowsPreviews[IosAllowsPreviews["NEVER"] = 0] = "NEVER";
|
|
10
|
+
IosAllowsPreviews[IosAllowsPreviews["ALWAYS"] = 1] = "ALWAYS";
|
|
11
|
+
IosAllowsPreviews[IosAllowsPreviews["WHEN_AUTHENTICATED"] = 2] = "WHEN_AUTHENTICATED";
|
|
12
|
+
})(IosAllowsPreviews || (IosAllowsPreviews = {}));
|
|
13
|
+
export var IosAuthorizationStatus;
|
|
14
|
+
(function (IosAuthorizationStatus) {
|
|
15
|
+
IosAuthorizationStatus[IosAuthorizationStatus["NOT_DETERMINED"] = 0] = "NOT_DETERMINED";
|
|
16
|
+
IosAuthorizationStatus[IosAuthorizationStatus["DENIED"] = 1] = "DENIED";
|
|
17
|
+
IosAuthorizationStatus[IosAuthorizationStatus["AUTHORIZED"] = 2] = "AUTHORIZED";
|
|
18
|
+
IosAuthorizationStatus[IosAuthorizationStatus["PROVISIONAL"] = 3] = "PROVISIONAL";
|
|
19
|
+
IosAuthorizationStatus[IosAuthorizationStatus["EPHEMERAL"] = 4] = "EPHEMERAL";
|
|
20
|
+
})(IosAuthorizationStatus || (IosAuthorizationStatus = {}));
|
|
21
|
+
//# sourceMappingURL=NotificationPermissions.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.types.js","sourceRoot":"","sources":["../src/NotificationPermissions.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,mDAAS,CAAA;AACX,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,2DAAS,CAAA;IACT,6DAAU,CAAA;IACV,qFAAsB,CAAA;AACxB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,uFAAkB,CAAA;IAClB,uEAAU,CAAA;IACV,+EAAc,CAAA;IACd,iFAAe,CAAA;IACf,6EAAa,CAAA;AACf,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC","sourcesContent":["import { PermissionResponse, PermissionHookOptions } from 'expo-modules-core';\n\nexport enum IosAlertStyle {\n NONE = 0,\n BANNER = 1,\n ALERT = 2,\n}\n\nexport enum IosAllowsPreviews {\n NEVER = 0,\n ALWAYS = 1,\n WHEN_AUTHENTICATED = 2,\n}\n\nexport enum IosAuthorizationStatus {\n NOT_DETERMINED = 0,\n DENIED = 1,\n AUTHORIZED = 2,\n PROVISIONAL = 3,\n EPHEMERAL = 4,\n}\n\nexport { PermissionHookOptions };\n\n// @docsMissing\nexport interface NotificationPermissionsStatus extends PermissionResponse {\n android?: {\n importance: number;\n interruptionFilter?: number;\n };\n ios?: {\n status: IosAuthorizationStatus;\n allowsDisplayInNotificationCenter: boolean | null;\n allowsDisplayOnLockScreen: boolean | null;\n allowsDisplayInCarPlay: boolean | null;\n allowsAlert: boolean | null;\n allowsBadge: boolean | null;\n allowsSound: boolean | null;\n allowsCriticalAlerts?: boolean | null;\n alertStyle: IosAlertStyle;\n allowsPreviews?: IosAllowsPreviews;\n providesAppNotificationSettings?: boolean;\n allowsAnnouncements?: boolean | null;\n };\n}\n\n/**\n * Available configuration for permission request on iOS platform.\n * See Apple documentation for [`UNAuthorizationOptions`](https://developer.apple.com/documentation/usernotifications/unauthorizationoptions) to learn more.\n */\nexport interface IosNotificationPermissionsRequest {\n /**\n * The ability to display alerts.\n */\n allowAlert?: boolean;\n /**\n * The ability to update the app’s badge.\n */\n allowBadge?: boolean;\n /**\n * The ability to play sounds.\n */\n allowSound?: boolean;\n /**\n * The ability to display notifications in a CarPlay environment.\n */\n allowDisplayInCarPlay?: boolean;\n /**\n * The ability to play sounds for critical alerts.\n */\n allowCriticalAlerts?: boolean;\n /**\n * An option indicating the system should display a button for in-app notification settings.\n */\n provideAppNotificationSettings?: boolean;\n /**\n * The ability to post noninterrupting notifications provisionally to the Notification Center.\n */\n allowProvisional?: boolean;\n /**\n * The ability for Siri to automatically read out messages over AirPods.\n * @deprecated\n */\n allowAnnouncements?: boolean;\n}\n\nexport type NativeNotificationPermissionsRequest = IosNotificationPermissionsRequest | object;\n\n/**\n * An interface representing the permissions request scope configuration.\n * Each option corresponds to a different native platform authorization option.\n */\nexport interface NotificationPermissionsRequest {\n /**\n * Available configuration for permission request on iOS platform.\n */\n ios?: IosNotificationPermissionsRequest;\n /**\n * On Android, all available permissions are granted by default, and if a user declines any permission, an app cannot prompt the user to change.\n */\n android?: object;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.d.ts","sourceRoot":"","sources":["../src/NotificationPermissionsModule.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;wBA4EjF,6BAA6B;AAXlC,wBAWmC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PermissionStatus, Platform } from 'expo-modules-core';
|
|
2
|
+
function convertPermissionStatus(status) {
|
|
3
|
+
switch (status) {
|
|
4
|
+
case 'granted':
|
|
5
|
+
return {
|
|
6
|
+
status: PermissionStatus.GRANTED,
|
|
7
|
+
expires: 'never',
|
|
8
|
+
canAskAgain: false,
|
|
9
|
+
granted: true,
|
|
10
|
+
};
|
|
11
|
+
case 'denied':
|
|
12
|
+
return {
|
|
13
|
+
status: PermissionStatus.DENIED,
|
|
14
|
+
expires: 'never',
|
|
15
|
+
canAskAgain: false,
|
|
16
|
+
granted: false,
|
|
17
|
+
};
|
|
18
|
+
default:
|
|
19
|
+
return {
|
|
20
|
+
status: PermissionStatus.UNDETERMINED,
|
|
21
|
+
expires: 'never',
|
|
22
|
+
canAskAgain: true,
|
|
23
|
+
granted: false,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function resolvePermissionAsync({ shouldAsk, }) {
|
|
28
|
+
if (!Platform.isDOMAvailable) {
|
|
29
|
+
return convertPermissionStatus('denied');
|
|
30
|
+
}
|
|
31
|
+
const { Notification = {} } = window;
|
|
32
|
+
if (typeof Notification.requestPermission !== 'undefined') {
|
|
33
|
+
let status = Notification.permission;
|
|
34
|
+
if (shouldAsk) {
|
|
35
|
+
status = await new Promise((resolve, reject) => {
|
|
36
|
+
let resolved = false;
|
|
37
|
+
function resolveOnce(status) {
|
|
38
|
+
if (!resolved) {
|
|
39
|
+
resolved = true;
|
|
40
|
+
resolve(status);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Some browsers require a callback argument and some return a Promise
|
|
44
|
+
Notification.requestPermission(resolveOnce)?.then(resolveOnce)?.catch(reject);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return convertPermissionStatus(status);
|
|
48
|
+
}
|
|
49
|
+
else if (typeof navigator !== 'undefined' && navigator?.permissions?.query) {
|
|
50
|
+
// TODO(Bacon): Support `push` in the future when it's stable.
|
|
51
|
+
const query = await navigator.permissions.query({ name: 'notifications' });
|
|
52
|
+
return convertPermissionStatus(query.state);
|
|
53
|
+
}
|
|
54
|
+
// Platforms like iOS Safari don't support Notifications so return denied.
|
|
55
|
+
return convertPermissionStatus('denied');
|
|
56
|
+
}
|
|
57
|
+
export default {
|
|
58
|
+
addListener: () => { },
|
|
59
|
+
removeListeners: () => { },
|
|
60
|
+
async getPermissionsAsync() {
|
|
61
|
+
return resolvePermissionAsync({ shouldAsk: false });
|
|
62
|
+
},
|
|
63
|
+
async requestPermissionsAsync(request) {
|
|
64
|
+
return resolvePermissionAsync({ shouldAsk: true });
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=NotificationPermissionsModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.js","sourceRoot":"","sources":["../src/NotificationPermissionsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQ/D,SAAS,uBAAuB,CAC9B,MAA0C;IAE1C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO;gBACL,MAAM,EAAE,gBAAgB,CAAC,OAAO;gBAChC,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,KAAK;gBAClB,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,KAAK,QAAQ;YACX,OAAO;gBACL,MAAM,EAAE,gBAAgB,CAAC,MAAM;gBAC/B,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,KAAK;gBAClB,OAAO,EAAE,KAAK;aACf,CAAC;QACJ;YACE,OAAO;gBACL,MAAM,EAAE,gBAAgB,CAAC,YAAY;gBACrC,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,IAAI;gBACjB,OAAO,EAAE,KAAK;aACf,CAAC;IACN,CAAC;AACH,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,EACpC,SAAS,GAGV;IACC,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC7B,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,MAAa,CAAC;IAC5C,IAAI,OAAO,YAAY,CAAC,iBAAiB,KAAK,WAAW,EAAE,CAAC;QAC1D,IAAI,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC;QACrC,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC7C,IAAI,QAAQ,GAAG,KAAK,CAAC;gBACrB,SAAS,WAAW,CAAC,MAAc;oBACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,QAAQ,GAAG,IAAI,CAAC;wBAChB,OAAO,CAAC,MAAM,CAAC,CAAC;oBAClB,CAAC;gBACH,CAAC;gBACD,sEAAsE;gBACtE,YAAY,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;SAAM,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;QAC7E,8DAA8D;QAC9D,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;QAC3E,OAAO,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,0EAA0E;IAC1E,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC;AAED,eAAe;IACb,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;IACzB,KAAK,CAAC,mBAAmB;QACvB,OAAO,sBAAsB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,KAAK,CAAC,uBAAuB,CAC3B,OAA6C;QAE7C,OAAO,sBAAsB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;CAC+B,CAAC","sourcesContent":["import { PermissionStatus, Platform } from 'expo-modules-core';\n\nimport {\n NativeNotificationPermissionsRequest,\n NotificationPermissionsStatus,\n} from './NotificationPermissions.types';\nimport { NotificationPermissionsModule } from './NotificationPermissionsModule.types';\n\nfunction convertPermissionStatus(\n status?: NotificationPermission | 'prompt'\n): NotificationPermissionsStatus {\n switch (status) {\n case 'granted':\n return {\n status: PermissionStatus.GRANTED,\n expires: 'never',\n canAskAgain: false,\n granted: true,\n };\n case 'denied':\n return {\n status: PermissionStatus.DENIED,\n expires: 'never',\n canAskAgain: false,\n granted: false,\n };\n default:\n return {\n status: PermissionStatus.UNDETERMINED,\n expires: 'never',\n canAskAgain: true,\n granted: false,\n };\n }\n}\n\nasync function resolvePermissionAsync({\n shouldAsk,\n}: {\n shouldAsk: boolean;\n}): Promise<NotificationPermissionsStatus> {\n if (!Platform.isDOMAvailable) {\n return convertPermissionStatus('denied');\n }\n\n const { Notification = {} } = window as any;\n if (typeof Notification.requestPermission !== 'undefined') {\n let status = Notification.permission;\n if (shouldAsk) {\n status = await new Promise((resolve, reject) => {\n let resolved = false;\n function resolveOnce(status: string) {\n if (!resolved) {\n resolved = true;\n resolve(status);\n }\n }\n // Some browsers require a callback argument and some return a Promise\n Notification.requestPermission(resolveOnce)?.then(resolveOnce)?.catch(reject);\n });\n }\n return convertPermissionStatus(status);\n } else if (typeof navigator !== 'undefined' && navigator?.permissions?.query) {\n // TODO(Bacon): Support `push` in the future when it's stable.\n const query = await navigator.permissions.query({ name: 'notifications' });\n return convertPermissionStatus(query.state);\n }\n // Platforms like iOS Safari don't support Notifications so return denied.\n return convertPermissionStatus('denied');\n}\n\nexport default {\n addListener: () => {},\n removeListeners: () => {},\n async getPermissionsAsync(): Promise<NotificationPermissionsStatus> {\n return resolvePermissionAsync({ shouldAsk: false });\n },\n async requestPermissionsAsync(\n request: NativeNotificationPermissionsRequest\n ): Promise<NotificationPermissionsStatus> {\n return resolvePermissionAsync({ shouldAsk: true });\n },\n} as NotificationPermissionsModule;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.kepler.d.ts","sourceRoot":"","sources":["../src/NotificationPermissionsModule.kepler.ts"],"names":[],"mappings":";AAOA,wBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.kepler.js","sourceRoot":"","sources":["../src/NotificationPermissionsModule.kepler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * PROPRIETARY/CONFIDENTIAL\n *\n * Use is subject to license terms.\n */\nexport default {};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.native.d.ts","sourceRoot":"","sources":["../src/NotificationPermissionsModule.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;;AAEtF,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.native.js","sourceRoot":"","sources":["../src/NotificationPermissionsModule.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,eAAe,mBAAmB,CAChC,mCAAmC,CACpC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nimport { NotificationPermissionsModule } from './NotificationPermissionsModule.types';\n\nexport default requireNativeModule<NotificationPermissionsModule>(\n 'ExpoNotificationPermissionsModule'\n);\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProxyNativeModule } from 'expo-modules-core';
|
|
2
|
+
import { NotificationPermissionsStatus, NativeNotificationPermissionsRequest } from './NotificationPermissions.types';
|
|
3
|
+
export interface NotificationPermissionsModule extends ProxyNativeModule {
|
|
4
|
+
getPermissionsAsync?: () => Promise<NotificationPermissionsStatus>;
|
|
5
|
+
requestPermissionsAsync?: (request: NativeNotificationPermissionsRequest) => Promise<NotificationPermissionsStatus>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=NotificationPermissionsModule.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.types.d.ts","sourceRoot":"","sources":["../src/NotificationPermissionsModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,6BAA6B,EAC7B,oCAAoC,EACrC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACtE,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACnE,uBAAuB,CAAC,EAAE,CACxB,OAAO,EAAE,oCAAoC,KAC1C,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPermissionsModule.types.js","sourceRoot":"","sources":["../src/NotificationPermissionsModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport {\n NotificationPermissionsStatus,\n NativeNotificationPermissionsRequest,\n} from './NotificationPermissions.types';\n\nexport interface NotificationPermissionsModule extends ProxyNativeModule {\n getPermissionsAsync?: () => Promise<NotificationPermissionsStatus>;\n requestPermissionsAsync?: (\n request: NativeNotificationPermissionsRequest\n ) => Promise<NotificationPermissionsStatus>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPresenterModule.d.ts","sourceRoot":"","sources":["../src/NotificationPresenterModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;wBAK7E,2BAA2B;AAHhC,wBAGiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationPresenterModule.js","sourceRoot":"","sources":["../src/NotificationPresenterModule.ts"],"names":[],"mappings":"AAEA,eAAe;IACb,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CACK,CAAC","sourcesContent":["import { NotificationPresenterModule } from './NotificationPresenterModule.types';\n\nexport default {\n addListener: () => {},\n removeListeners: () => {},\n} as NotificationPresenterModule;\n"]}
|