expo-notifications 0.27.7 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +11 -13
  2. package/README.md +1 -1
  3. package/android/build.gradle +7 -93
  4. package/android/src/main/java/expo/modules/notifications/NotificationsPackage.java +0 -2
  5. package/android/src/main/java/expo/modules/notifications/badge/BadgeModule.kt +1 -1
  6. package/android/src/main/java/expo/modules/notifications/notifications/channels/NotificationChannelGroupManagerModule.kt +2 -1
  7. package/android/src/main/java/expo/modules/notifications/notifications/channels/NotificationChannelManagerModule.kt +1 -1
  8. package/android/src/main/java/expo/modules/notifications/notifications/emitting/NotificationsEmitter.kt +5 -12
  9. package/android/src/main/java/expo/modules/notifications/notifications/handling/NotificationsHandler.kt +7 -1
  10. package/android/src/main/java/expo/modules/notifications/notifications/handling/SingleNotificationHandlerTask.java +8 -4
  11. package/android/src/main/java/expo/modules/notifications/serverregistration/ServerRegistrationModule.kt +2 -2
  12. package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +0 -1
  13. package/build/BackgroundNotificationTasksModule.d.ts.map +1 -1
  14. package/build/BadgeModule.d.ts.map +1 -1
  15. package/build/BadgeModule.native.d.ts.map +1 -1
  16. package/build/BadgeModule.web.js.map +1 -1
  17. package/build/DevicePushTokenAutoRegistration.fx.js.map +1 -1
  18. package/build/NotificationChannelGroupManager.d.ts.map +1 -1
  19. package/build/NotificationChannelManager.d.ts.map +1 -1
  20. package/build/NotificationChannelManager.types.d.ts +1 -2
  21. package/build/NotificationChannelManager.types.d.ts.map +1 -1
  22. package/build/NotificationChannelManager.types.js.map +1 -1
  23. package/build/NotificationPermissions.js.map +1 -1
  24. package/build/NotificationPermissionsModule.d.ts.map +1 -1
  25. package/build/NotificationPermissionsModule.js.map +1 -1
  26. package/build/NotificationPresenterModule.d.ts.map +1 -1
  27. package/build/NotificationScheduler.d.ts.map +1 -1
  28. package/build/NotificationScheduler.types.d.ts +2 -14
  29. package/build/NotificationScheduler.types.d.ts.map +1 -1
  30. package/build/NotificationScheduler.types.js.map +1 -1
  31. package/build/Notifications.types.d.ts +25 -14
  32. package/build/Notifications.types.d.ts.map +1 -1
  33. package/build/Notifications.types.js.map +1 -1
  34. package/build/NotificationsEmitter.js.map +1 -1
  35. package/build/NotificationsEmitterModule.d.ts.map +1 -1
  36. package/build/NotificationsEmitterModule.js.map +1 -1
  37. package/build/NotificationsHandler.js.map +1 -1
  38. package/build/NotificationsHandlerModule.d.ts.map +1 -1
  39. package/build/NotificationsHandlerModule.js.map +1 -1
  40. package/build/PushTokenManager.d.ts.map +1 -1
  41. package/build/PushTokenManager.js.map +1 -1
  42. package/build/ServerRegistrationModule.d.ts.map +1 -1
  43. package/build/ServerRegistrationModule.web.d.ts.map +1 -1
  44. package/build/ServerRegistrationModule.web.js.map +1 -1
  45. package/build/Tokens.types.d.ts +8 -8
  46. package/build/Tokens.types.d.ts.map +1 -1
  47. package/build/Tokens.types.js.map +1 -1
  48. package/build/cancelAllScheduledNotificationsAsync.js.map +1 -1
  49. package/build/cancelScheduledNotificationAsync.js.map +1 -1
  50. package/build/deleteNotificationCategoryAsync.js.map +1 -1
  51. package/build/deleteNotificationChannelAsync.android.js.map +1 -1
  52. package/build/deleteNotificationChannelGroupAsync.android.js.map +1 -1
  53. package/build/dismissAllNotificationsAsync.js.map +1 -1
  54. package/build/dismissNotificationAsync.js.map +1 -1
  55. package/build/getAllScheduledNotificationsAsync.js.map +1 -1
  56. package/build/getBadgeCountAsync.js.map +1 -1
  57. package/build/getDevicePushTokenAsync.js.map +1 -1
  58. package/build/getDevicePushTokenAsync.web.js +2 -2
  59. package/build/getDevicePushTokenAsync.web.js.map +1 -1
  60. package/build/getExpoPushTokenAsync.js.map +1 -1
  61. package/build/getNextTriggerDateAsync.js.map +1 -1
  62. package/build/getNotificationCategoriesAsync.js.map +1 -1
  63. package/build/getNotificationChannelAsync.android.js.map +1 -1
  64. package/build/getNotificationChannelGroupAsync.android.js.map +1 -1
  65. package/build/getNotificationChannelGroupsAsync.android.js.map +1 -1
  66. package/build/getNotificationChannelsAsync.android.js.map +1 -1
  67. package/build/getPresentedNotificationsAsync.js.map +1 -1
  68. package/build/presentNotificationAsync.js.map +1 -1
  69. package/build/registerTaskAsync.js.map +1 -1
  70. package/build/scheduleNotificationAsync.js +1 -1
  71. package/build/scheduleNotificationAsync.js.map +1 -1
  72. package/build/setBadgeCountAsync.js.map +1 -1
  73. package/build/setNotificationCategoryAsync.js.map +1 -1
  74. package/build/setNotificationChannelAsync.android.js.map +1 -1
  75. package/build/setNotificationChannelGroupAsync.android.js.map +1 -1
  76. package/build/unregisterForNotificationsAsync.js.map +1 -1
  77. package/build/unregisterTaskAsync.js.map +1 -1
  78. package/build/useLastNotificationResponse.d.ts +2 -1
  79. package/build/useLastNotificationResponse.d.ts.map +1 -1
  80. package/build/useLastNotificationResponse.js +2 -1
  81. package/build/useLastNotificationResponse.js.map +1 -1
  82. package/build/utils/updateDevicePushTokenAsync.js.map +1 -1
  83. package/package.json +5 -5
  84. package/plugin/build/withNotificationsAndroid.d.ts +2 -2
  85. package/plugin/build/withNotificationsAndroid.js +6 -6
  86. package/plugin/build/withNotificationsIOS.js +2 -2
  87. package/src/NotificationChannelManager.types.ts +1 -1
  88. package/src/NotificationScheduler.types.ts +6 -16
  89. package/src/Notifications.types.ts +28 -13
  90. package/src/Tokens.types.ts +12 -8
  91. package/src/getDevicePushTokenAsync.web.ts +2 -2
  92. package/src/useLastNotificationResponse.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -10,25 +10,23 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 0.27.7 — 2024-04-15
13
+ ## 0.28.0 — 2024-04-18
14
14
 
15
- ### 💡 Others
16
-
17
- - [iOS] Add privacy manifest describing required reason API usage. ([#27770](https://github.com/expo/expo/pull/27770) by [@aleqsio](https://github.com/aleqsio))
15
+ ### 🐛 Bug fixes
18
16
 
19
- ## 0.27.6 2024-01-26
17
+ - [Android] Fix notifications events were using an incorrect event emitter. ([#28207](https://github.com/expo/expo/pull/28207) by [@lukmccall](https://github.com/lukmccall))
20
18
 
21
- ### 🐛 Bug fixes
19
+ ### 💡 Others
22
20
 
23
- - Throw `UnavailabilityError` when trying to use `setNotificationCategoryAsync` on web. ([#26511](https://github.com/expo/expo/pull/26511) by [@marklawlor](https://github.com/marklawlor))
24
- - Remove `.native` hardcoded platform imports ([#26511](https://github.com/expo/expo/pull/26511) by [@marklawlor](https://github.com/marklawlor))
25
- - On `Android`, added events to module definition to clear warnings. ([#26654](https://github.com/expo/expo/pull/26654) by [@alanjhughes](https://github.com/alanjhughes))
21
+ - [iOS] Add privacy manifest describing required reason API usage. ([#27770](https://github.com/expo/expo/pull/27770) by [@aleqsio](https://github.com/aleqsio))
22
+ - drop unused web `name` property. ([#27437](https://github.com/expo/expo/pull/27437) by [@EvanBacon](https://github.com/EvanBacon))
23
+ - Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
26
24
 
27
- ## 0.27.5 2024-01-25
25
+ ## 0.27.5 - 2024-01-25
28
26
 
29
27
  _This version does not introduce any user-facing changes._
30
28
 
31
- ## 0.27.4 2024-01-20
29
+ ## 0.27.4 - 2024-01-20
32
30
 
33
31
  ### 🐛 Bug fixes
34
32
 
@@ -36,13 +34,13 @@ _This version does not introduce any user-facing changes._
36
34
  - Remove `.native` hardcoded platform imports ([#26511](https://github.com/expo/expo/pull/26511) by [@marklawlor](https://github.com/marklawlor))
37
35
  - On `Android`, added events to module definition to clear warnings. ([#26654](https://github.com/expo/expo/pull/26654) by [@alanjhughes](https://github.com/alanjhughes))
38
36
 
39
- ## 0.27.3 2024-01-10
37
+ ## 0.27.3 - 2024-01-10
40
38
 
41
39
  ### 🐛 Bug fixes
42
40
 
43
41
  - [Android] Fix `expo-notifications` requiring the `expo-task-manager` module to start. ([#26227](https://github.com/expo/expo/pull/26227) by [@behenate](https://github.com/behenate))
44
42
 
45
- ## 0.27.2 2023-12-19
43
+ ## 0.27.2 - 2023-12-19
46
44
 
47
45
  _This version does not introduce any user-facing changes._
48
46
 
package/README.md CHANGED
@@ -517,7 +517,7 @@ A single and required argument is a subscription returned by `addPushTokenListen
517
517
 
518
518
  ## Listening to notification events
519
519
 
520
- Notification events include incoming notifications, interactions your users perform with notifications (this can be tapping on a notification, or interacting with it via [notification categories](#managing-notification-categories-interactive-notifications)), and rare occasions when your notifications may be dropped.
520
+ Notification events include incoming notifications, interactions your users perform with notifications (this can be tapping on a notification, or interacting with it via [notification categories](#manage-notification-categories-interactive-notifications)), and rare occasions when your notifications may be dropped.
521
521
 
522
522
  A few different listeners are exposed, so we've provided a chart below which will hopefully help you understand when you can expect each one to be triggered:
523
523
 
@@ -1,100 +1,20 @@
1
1
  apply plugin: 'com.android.library'
2
- apply plugin: 'kotlin-android'
3
- apply plugin: 'maven-publish'
4
2
 
5
3
  group = 'host.exp.exponent'
6
- version = '0.27.7'
4
+ version = '0.28.0'
7
5
 
8
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
- if (expoModulesCorePlugin.exists()) {
10
- apply from: expoModulesCorePlugin
11
- applyKotlinExpoModulesCorePlugin()
12
- // Remove this check, but keep the contents after SDK49 support is dropped
13
- if (safeExtGet("expoProvidesDefaultConfig", false)) {
14
- useExpoPublishing()
15
- useCoreDependencies()
16
- }
17
- }
18
-
19
- buildscript {
20
- // Simple helper that allows the root project to override versions declared by this library.
21
- ext.safeExtGet = { prop, fallback ->
22
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
23
- }
24
-
25
- // Ensures backward compatibility
26
- ext.getKotlinVersion = {
27
- if (ext.has("kotlinVersion")) {
28
- ext.kotlinVersion()
29
- } else {
30
- ext.safeExtGet("kotlinVersion", "1.8.10")
31
- }
32
- }
33
-
34
- repositories {
35
- mavenCentral()
36
- }
37
-
38
- dependencies {
39
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
40
- }
41
- }
42
-
43
- // Remove this if and it's contents, when support for SDK49 is dropped
44
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
45
- afterEvaluate {
46
- publishing {
47
- publications {
48
- release(MavenPublication) {
49
- from components.release
50
- }
51
- }
52
- repositories {
53
- maven {
54
- url = mavenLocal().url
55
- }
56
- }
57
- }
58
- }
59
- }
7
+ apply from: expoModulesCorePlugin
8
+ applyKotlinExpoModulesCorePlugin()
9
+ useCoreDependencies()
10
+ useDefaultAndroidSdkVersions()
11
+ useExpoPublishing()
60
12
 
61
13
  android {
62
- // Remove this if and it's contents, when support for SDK49 is dropped
63
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
64
- compileSdkVersion safeExtGet("compileSdkVersion", 34)
65
-
66
- defaultConfig {
67
- minSdkVersion safeExtGet("minSdkVersion", 23)
68
- targetSdkVersion safeExtGet("targetSdkVersion", 34)
69
- }
70
-
71
- publishing {
72
- singleVariant("release") {
73
- withSourcesJar()
74
- }
75
- }
76
-
77
- lintOptions {
78
- abortOnError false
79
- }
80
- }
81
-
82
- def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
83
- if (agpVersion.tokenize('.')[0].toInteger() < 8) {
84
- compileOptions {
85
- sourceCompatibility JavaVersion.VERSION_11
86
- targetCompatibility JavaVersion.VERSION_11
87
- }
88
-
89
- kotlinOptions {
90
- jvmTarget = JavaVersion.VERSION_11.majorVersion
91
- }
92
- }
93
-
94
14
  namespace "expo.modules.notifications"
95
15
  defaultConfig {
96
16
  versionCode 21
97
- versionName '0.27.7'
17
+ versionName '0.28.0'
98
18
  }
99
19
 
100
20
  buildFeatures {
@@ -103,12 +23,6 @@ android {
103
23
  }
104
24
 
105
25
  dependencies {
106
- // Remove this if and it's contents, when support for SDK49 is dropped
107
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
108
- implementation project(':expo-modules-core')
109
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
110
- }
111
-
112
26
  api 'androidx.core:core:1.5.0'
113
27
  api 'androidx.lifecycle:lifecycle-runtime:2.2.0'
114
28
  api 'androidx.lifecycle:lifecycle-process:2.2.0'
@@ -6,11 +6,9 @@ import java.util.Arrays;
6
6
  import java.util.List;
7
7
 
8
8
  import expo.modules.core.BasePackage;
9
- import expo.modules.core.ExportedModule;
10
9
  import expo.modules.core.interfaces.InternalModule;
11
10
  import expo.modules.core.interfaces.SingletonModule;
12
11
  import expo.modules.notifications.notifications.NotificationManager;
13
- import expo.modules.notifications.notifications.categories.ExpoNotificationCategoriesModule;
14
12
  import expo.modules.notifications.notifications.categories.serializers.ExpoNotificationsCategoriesSerializer;
15
13
  import expo.modules.notifications.notifications.channels.AndroidXNotificationsChannelsProvider;
16
14
  import expo.modules.notifications.tokens.PushTokenManager;
@@ -8,7 +8,7 @@ class BadgeModule : Module() {
8
8
  override fun definition() = ModuleDefinition {
9
9
  Name("ExpoBadgeModule")
10
10
 
11
- AsyncFunction("getBadgeCountAsync") {
11
+ AsyncFunction<Int>("getBadgeCountAsync") {
12
12
  BadgeHelper.badgeCount
13
13
  }
14
14
 
@@ -1,6 +1,7 @@
1
1
  package expo.modules.notifications.notifications.channels
2
2
 
3
3
  import android.os.Build
4
+ import android.os.Bundle
4
5
  import expo.modules.core.arguments.ReadableArguments
5
6
  import expo.modules.kotlin.modules.Module
6
7
  import expo.modules.kotlin.modules.ModuleDefinition
@@ -34,7 +35,7 @@ class NotificationChannelGroupManagerModule : Module() {
34
35
  }
35
36
  }
36
37
 
37
- AsyncFunction("getNotificationChannelGroupsAsync") {
38
+ AsyncFunction<List<Bundle?>?>("getNotificationChannelGroupsAsync") {
38
39
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
39
40
  groupManager
40
41
  .notificationChannelGroups
@@ -30,7 +30,7 @@ open class NotificationChannelManagerModule : Module() {
30
30
  channelSerializer = provider.channelSerializer
31
31
  }
32
32
 
33
- AsyncFunction("getNotificationChannelsAsync") {
33
+ AsyncFunction<List<Bundle?>>("getNotificationChannelsAsync") {
34
34
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
35
35
  return@AsyncFunction emptyList<Bundle>()
36
36
  }
@@ -4,7 +4,6 @@ import android.os.Bundle
4
4
  import expo.modules.core.interfaces.services.EventEmitter
5
5
  import expo.modules.kotlin.modules.Module
6
6
  import expo.modules.kotlin.modules.ModuleDefinition
7
- import expo.modules.notifications.ModuleNotFoundException
8
7
  import expo.modules.notifications.notifications.NotificationSerializer
9
8
  import expo.modules.notifications.notifications.interfaces.NotificationListener
10
9
  import expo.modules.notifications.notifications.interfaces.NotificationManager
@@ -30,9 +29,6 @@ open class NotificationsEmitter : Module(), NotificationListener {
30
29
  )
31
30
 
32
31
  OnCreate {
33
- eventEmitter = appContext.legacyModule<EventEmitter>()
34
- ?: throw ModuleNotFoundException(EventEmitter::class)
35
-
36
32
  // Register the module as a listener in NotificationManager singleton module.
37
33
  // Deregistration happens in onDestroy callback.
38
34
  notificationManager = requireNotNull(appContext.legacyModuleRegistry.getSingletonModule("NotificationManager", NotificationManager::class.java))
@@ -43,7 +39,7 @@ open class NotificationsEmitter : Module(), NotificationListener {
43
39
  notificationManager.removeListener(this@NotificationsEmitter)
44
40
  }
45
41
 
46
- AsyncFunction("getLastNotificationResponseAsync") {
42
+ AsyncFunction<Bundle?>("getLastNotificationResponseAsync") {
47
43
  lastNotificationResponse?.let(NotificationSerializer::toBundle)
48
44
  }
49
45
  }
@@ -55,7 +51,7 @@ open class NotificationsEmitter : Module(), NotificationListener {
55
51
  * @param notification Notification received
56
52
  */
57
53
  override fun onNotificationReceived(notification: Notification) {
58
- eventEmitter?.emit(NEW_MESSAGE_EVENT_NAME, NotificationSerializer.toBundle(notification))
54
+ sendEvent(NEW_MESSAGE_EVENT_NAME, NotificationSerializer.toBundle(notification))
59
55
  }
60
56
 
61
57
  /**
@@ -67,11 +63,8 @@ open class NotificationsEmitter : Module(), NotificationListener {
67
63
  */
68
64
  override fun onNotificationResponseReceived(response: NotificationResponse): Boolean {
69
65
  lastNotificationResponse = response
70
- eventEmitter?.let {
71
- it.emit(NEW_RESPONSE_EVENT_NAME, NotificationSerializer.toBundle(response))
72
- return true
73
- }
74
- return false
66
+ sendEvent(NEW_RESPONSE_EVENT_NAME, NotificationSerializer.toBundle(response))
67
+ return true
75
68
  }
76
69
 
77
70
  /**
@@ -79,6 +72,6 @@ open class NotificationsEmitter : Module(), NotificationListener {
79
72
  * Emits a [MESSAGES_DELETED_EVENT_NAME] event.
80
73
  */
81
74
  override fun onNotificationsDropped() {
82
- eventEmitter?.emit(MESSAGES_DELETED_EVENT_NAME, Bundle.EMPTY)
75
+ sendEvent(MESSAGES_DELETED_EVENT_NAME, Bundle.EMPTY)
83
76
  }
84
77
  }
@@ -115,7 +115,13 @@ open class NotificationsHandler : Module(), NotificationListener {
115
115
  */
116
116
  override fun onNotificationReceived(notification: Notification) {
117
117
  val context = appContext.reactContext ?: return
118
- val task = SingleNotificationHandlerTask(context, handler, moduleRegistry, notification, this)
118
+ val task = SingleNotificationHandlerTask(
119
+ context,
120
+ appContext.eventEmitter(this),
121
+ handler,
122
+ notification,
123
+ this
124
+ )
119
125
  tasksMap[task.identifier] = task
120
126
  task.start()
121
127
  }
@@ -5,10 +5,8 @@ import android.os.Bundle;
5
5
  import android.os.Handler;
6
6
  import android.os.ResultReceiver;
7
7
 
8
- import expo.modules.core.ModuleRegistry;
9
8
  import expo.modules.core.Promise;
10
9
  import expo.modules.core.interfaces.services.EventEmitter;
11
-
12
10
  import expo.modules.notifications.notifications.NotificationSerializer;
13
11
  import expo.modules.notifications.notifications.model.Notification;
14
12
  import expo.modules.notifications.notifications.model.NotificationBehavior;
@@ -42,10 +40,16 @@ public class SingleNotificationHandlerTask {
42
40
 
43
41
  private Runnable mTimeoutRunnable = SingleNotificationHandlerTask.this::handleTimeout;
44
42
 
45
- /* package */ SingleNotificationHandlerTask(Context context, Handler handler, ModuleRegistry moduleRegistry, Notification notification, NotificationsHandler delegate) {
43
+ /* package */ SingleNotificationHandlerTask(
44
+ Context context,
45
+ EventEmitter eventEmitter,
46
+ Handler handler,
47
+ Notification notification,
48
+ NotificationsHandler delegate
49
+ ) {
46
50
  mContext = context;
47
51
  mHandler = handler;
48
- mEventEmitter = moduleRegistry.getModule(EventEmitter.class);
52
+ mEventEmitter = eventEmitter;
49
53
  mNotification = notification;
50
54
  mDelegate = delegate;
51
55
  }
@@ -15,9 +15,9 @@ open class ServerRegistrationModule : Module() {
15
15
  override fun definition() = ModuleDefinition {
16
16
  Name("NotificationsServerRegistrationModule")
17
17
 
18
- AsyncFunction("getInstallationIdAsync", this@ServerRegistrationModule::getInstallationId)
18
+ AsyncFunction<String>("getInstallationIdAsync", this@ServerRegistrationModule::getInstallationId)
19
19
 
20
- AsyncFunction("getRegistrationInfoAsync") {
20
+ AsyncFunction<String?>("getRegistrationInfoAsync") {
21
21
  mRegistrationInfo.get()
22
22
  }
23
23
 
@@ -593,7 +593,6 @@ open class NotificationsService : BroadcastReceiver() {
593
593
  }
594
594
 
595
595
  open fun handleIntent(context: Context, intent: Intent?) {
596
- Log.e("dupa", intent.toString())
597
596
  if (intent != null && SETUP_ACTIONS.contains(intent.action)) {
598
597
  onSetupScheduledNotifications(context, intent)
599
598
  } else if (intent?.action === NOTIFICATION_EVENT_ACTION) {
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundNotificationTasksModule.d.ts","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.ts"],"names":[],"mappings":";gCACoC,MAAM,GAAG,QAAQ,IAAI,CAAC;kCAGpB,MAAM,GAAG,QAAQ,IAAI,CAAC;;AAJ5D,wBAOE"}
1
+ {"version":3,"file":"BackgroundNotificationTasksModule.d.ts","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.ts"],"names":[],"mappings":";gCACoC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;kCAGpB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;;AAJ5D,wBAOE"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeModule.d.ts","sourceRoot":"","sources":["../src/BadgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;AAElD,wBAGiB"}
1
+ {"version":3,"file":"BadgeModule.d.ts","sourceRoot":"","sources":["../src/BadgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;wBAK7C,WAAW;AAHhB,wBAGiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeModule.native.d.ts","sourceRoot":"","sources":["../src/BadgeModule.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;AAIlD,wBAQiB"}
1
+ {"version":3,"file":"BadgeModule.native.d.ts","sourceRoot":"","sources":["../src/BadgeModule.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;wBAY7C,WAAW;AARhB,wBAQiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeModule.web.js","sourceRoot":"","sources":["../src/BadgeModule.web.ts"],"names":[],"mappings":"AAEA,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,MAAM,WAAW,GAAgB;IAC/B,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;IACzB,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAC7B,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QAChD,uEAAuE;QACvE,kFAAkF;QAClF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,OAAO,KAAK,CAAC;SACd;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,UAAU,GAAG,CAAC,EAAE;YAClB,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACjC;aAAM;YACL,MAAM,CAAC,KAAK,EAAE,CAAC;SAChB;QACD,iBAAiB,GAAG,UAAU,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { BadgeModule } from './BadgeModule.types';\n\nlet lastSetBadgeCount = 0;\n\nconst badgeModule: BadgeModule = {\n addListener: () => {},\n removeListeners: () => {},\n getBadgeCountAsync: async () => {\n return lastSetBadgeCount;\n },\n setBadgeCountAsync: async (badgeCount, options) => {\n // If this module is loaded in SSR (NextJS), we can't modify the badge.\n // It also can't load the badgin module, that instantly invokes methods on window.\n if (typeof window === 'undefined') {\n return false;\n }\n const badgin = require('badgin');\n if (badgeCount > 0) {\n badgin.set(badgeCount, options);\n } else {\n badgin.clear();\n }\n lastSetBadgeCount = badgeCount;\n return true;\n },\n};\n\nexport default badgeModule;\n"]}
1
+ {"version":3,"file":"BadgeModule.web.js","sourceRoot":"","sources":["../src/BadgeModule.web.ts"],"names":[],"mappings":"AAEA,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B,MAAM,WAAW,GAAgB;IAC/B,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;IACzB,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAC7B,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QAChD,uEAAuE;QACvE,kFAAkF;QAClF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;QACD,iBAAiB,GAAG,UAAU,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { BadgeModule } from './BadgeModule.types';\n\nlet lastSetBadgeCount = 0;\n\nconst badgeModule: BadgeModule = {\n addListener: () => {},\n removeListeners: () => {},\n getBadgeCountAsync: async () => {\n return lastSetBadgeCount;\n },\n setBadgeCountAsync: async (badgeCount, options) => {\n // If this module is loaded in SSR (NextJS), we can't modify the badge.\n // It also can't load the badgin module, that instantly invokes methods on window.\n if (typeof window === 'undefined') {\n return false;\n }\n const badgin = require('badgin');\n if (badgeCount > 0) {\n badgin.set(badgeCount, options);\n } else {\n badgin.clear();\n }\n lastSetBadgeCount = badgeCount;\n return true;\n },\n};\n\nexport default badgeModule;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DevicePushTokenAutoRegistration.fx.js","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,IAAI,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAExH,IAAI,mBAAmB,GAA2B,IAAI,CAAC;AACvD,KAAK,UAAU,oBAAoB,CAAC,KAAsB;IACxD,+BAA+B;IAC/B,mBAAmB,EAAE,KAAK,EAAE,CAAC;IAC7B,mBAAmB,GAAG,IAAI,eAAe,EAAE,CAAC;IAC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D,+BAA+B;IAC/B,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACnC,IAAI;YACF,wEAAwE;YACxE,yEAAyE;YACzE,2BAA2B;YAC3B,MAAM,gBAAgB,GAAG,MAAM,wBAAwB,CAAC,wBAAyB,EAAE,CAAC;YAEpF,IAAI,CAAC,gBAAgB,EAAE;gBACrB,8BAA8B;gBAC9B,OAAO;aACR;YAED,MAAM,YAAY,GAAuC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACtF,IAAI,YAAY,EAAE,SAAS,EAAE;gBAC3B,uCAAuC;gBACvC,+BAA+B;gBAC/B,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC;aACnC;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CACV,0GAA0G,EAC1G,CAAC,CACF,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IAEH,mCAAmC;IACnC,uCAAuC;IACvC,oCAAoC;IACpC,wBAAwB,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;CAClG;KAAM;IACL,OAAO,CAAC,IAAI,CACV,2IAA2I,EAC3I,IAAI,mBAAmB,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAChF,CAAC;CACH","sourcesContent":["import 'abort-controller/polyfill';\nimport { UnavailabilityError } from 'expo-modules-core';\n\nimport ServerRegistrationModule from './ServerRegistrationModule';\nimport { addPushTokenListener } from './TokenEmitter';\nimport { DevicePushToken } from './Tokens.types';\nimport getDevicePushTokenAsync from './getDevicePushTokenAsync';\nimport { updateDevicePushTokenAsync as updateDevicePushTokenAsyncWithSignal } from './utils/updateDevicePushTokenAsync';\n\nlet lastAbortController: AbortController | null = null;\nasync function updatePushTokenAsync(token: DevicePushToken) {\n // Abort current update process\n lastAbortController?.abort();\n lastAbortController = new AbortController();\n return await updateDevicePushTokenAsyncWithSignal(lastAbortController.signal, token);\n}\n\n/**\n * Encapsulates device server registration data\n */\nexport type DevicePushTokenRegistration = {\n isEnabled: boolean;\n};\n\n/**\n * Sets the registration information so that the device push token gets pushed\n * to the given registration endpoint\n * @param enabled\n */\nexport async function setAutoServerRegistrationEnabledAsync(enabled: boolean) {\n // We are overwriting registration, so we shouldn't let\n // any pending request complete.\n lastAbortController?.abort();\n\n if (!ServerRegistrationModule.setRegistrationInfoAsync) {\n throw new UnavailabilityError('ServerRegistrationModule', 'setRegistrationInfoAsync');\n }\n\n await ServerRegistrationModule.setRegistrationInfoAsync(\n enabled ? JSON.stringify({ isEnabled: enabled }) : null\n );\n}\n\n// note(Chmiela): This function is exported only for testing purposes.\nexport async function __handlePersistedRegistrationInfoAsync(\n registrationInfo: string | null | undefined\n) {\n if (!registrationInfo) {\n // No registration info, nothing to do\n return;\n }\n\n let registration: DevicePushTokenRegistration | null = null;\n try {\n registration = JSON.parse(registrationInfo);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while fetching registration information for auto token updates.',\n e\n );\n }\n\n if (!registration?.isEnabled) {\n // Registration is invalid or not enabled, nothing more to do\n return;\n }\n\n try {\n // Since the registration is enabled, fetching a \"new\" device token\n // shouldn't be a problem.\n const latestDevicePushToken = await getDevicePushTokenAsync();\n await updatePushTokenAsync(latestDevicePushToken);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n}\n\nif (ServerRegistrationModule.getRegistrationInfoAsync) {\n // A global scope (to get all the updates) device push token\n // subscription, never cleared.\n addPushTokenListener(async (token) => {\n try {\n // Before updating the push token on server we always check if we should\n // Since modules can't change their method availability while running, we\n // can assert it's defined.\n const registrationInfo = await ServerRegistrationModule.getRegistrationInfoAsync!();\n\n if (!registrationInfo) {\n // Registration is not enabled\n return;\n }\n\n const registration: DevicePushTokenRegistration | null = JSON.parse(registrationInfo);\n if (registration?.isEnabled) {\n // Dispatch an abortable task to update\n // registration with new token.\n await updatePushTokenAsync(token);\n }\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n });\n\n // Verify if persisted registration\n // has successfully uploaded last known\n // device push token. If not, retry.\n ServerRegistrationModule.getRegistrationInfoAsync().then(__handlePersistedRegistrationInfoAsync);\n} else {\n console.warn(\n `[expo-notifications] Error encountered while fetching auto-registration state, new tokens will not be automatically registered on server.`,\n new UnavailabilityError('ServerRegistrationModule', 'getRegistrationInfoAsync')\n );\n}\n"]}
1
+ {"version":3,"file":"DevicePushTokenAutoRegistration.fx.js","sourceRoot":"","sources":["../src/DevicePushTokenAutoRegistration.fx.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,IAAI,oCAAoC,EAAE,MAAM,oCAAoC,CAAC;AAExH,IAAI,mBAAmB,GAA2B,IAAI,CAAC;AACvD,KAAK,UAAU,oBAAoB,CAAC,KAAsB;IACxD,+BAA+B;IAC/B,mBAAmB,EAAE,KAAK,EAAE,CAAC;IAC7B,mBAAmB,GAAG,IAAI,eAAe,EAAE,CAAC;IAC5C,OAAO,MAAM,oCAAoC,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvF,CAAC;AASD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAAC,OAAgB;IAC1E,uDAAuD;IACvD,gCAAgC;IAChC,mBAAmB,EAAE,KAAK,EAAE,CAAC;IAE7B,IAAI,CAAC,wBAAwB,CAAC,wBAAwB,EAAE,CAAC;QACvD,MAAM,IAAI,mBAAmB,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,wBAAwB,CAAC,wBAAwB,CACrD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I,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACtF,IAAI,YAAY,EAAE,SAAS,EAAE,CAAC;gBAC5B,uCAAuC;gBACvC,+BAA+B;gBAC/B,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CACV,0GAA0G,EAC1G,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,mCAAmC;IACnC,uCAAuC;IACvC,oCAAoC;IACpC,wBAAwB,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;AACnG,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,IAAI,CACV,2IAA2I,EAC3I,IAAI,mBAAmB,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAChF,CAAC;AACJ,CAAC","sourcesContent":["import 'abort-controller/polyfill';\nimport { UnavailabilityError } from 'expo-modules-core';\n\nimport ServerRegistrationModule from './ServerRegistrationModule';\nimport { addPushTokenListener } from './TokenEmitter';\nimport { DevicePushToken } from './Tokens.types';\nimport getDevicePushTokenAsync from './getDevicePushTokenAsync';\nimport { updateDevicePushTokenAsync as updateDevicePushTokenAsyncWithSignal } from './utils/updateDevicePushTokenAsync';\n\nlet lastAbortController: AbortController | null = null;\nasync function updatePushTokenAsync(token: DevicePushToken) {\n // Abort current update process\n lastAbortController?.abort();\n lastAbortController = new AbortController();\n return await updateDevicePushTokenAsyncWithSignal(lastAbortController.signal, token);\n}\n\n/**\n * Encapsulates device server registration data\n */\nexport type DevicePushTokenRegistration = {\n isEnabled: boolean;\n};\n\n/**\n * Sets the registration information so that the device push token gets pushed\n * to the given registration endpoint\n * @param enabled\n */\nexport async function setAutoServerRegistrationEnabledAsync(enabled: boolean) {\n // We are overwriting registration, so we shouldn't let\n // any pending request complete.\n lastAbortController?.abort();\n\n if (!ServerRegistrationModule.setRegistrationInfoAsync) {\n throw new UnavailabilityError('ServerRegistrationModule', 'setRegistrationInfoAsync');\n }\n\n await ServerRegistrationModule.setRegistrationInfoAsync(\n enabled ? JSON.stringify({ isEnabled: enabled }) : null\n );\n}\n\n// note(Chmiela): This function is exported only for testing purposes.\nexport async function __handlePersistedRegistrationInfoAsync(\n registrationInfo: string | null | undefined\n) {\n if (!registrationInfo) {\n // No registration info, nothing to do\n return;\n }\n\n let registration: DevicePushTokenRegistration | null = null;\n try {\n registration = JSON.parse(registrationInfo);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while fetching registration information for auto token updates.',\n e\n );\n }\n\n if (!registration?.isEnabled) {\n // Registration is invalid or not enabled, nothing more to do\n return;\n }\n\n try {\n // Since the registration is enabled, fetching a \"new\" device token\n // shouldn't be a problem.\n const latestDevicePushToken = await getDevicePushTokenAsync();\n await updatePushTokenAsync(latestDevicePushToken);\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n}\n\nif (ServerRegistrationModule.getRegistrationInfoAsync) {\n // A global scope (to get all the updates) device push token\n // subscription, never cleared.\n addPushTokenListener(async (token) => {\n try {\n // Before updating the push token on server we always check if we should\n // Since modules can't change their method availability while running, we\n // can assert it's defined.\n const registrationInfo = await ServerRegistrationModule.getRegistrationInfoAsync!();\n\n if (!registrationInfo) {\n // Registration is not enabled\n return;\n }\n\n const registration: DevicePushTokenRegistration | null = JSON.parse(registrationInfo);\n if (registration?.isEnabled) {\n // Dispatch an abortable task to update\n // registration with new token.\n await updatePushTokenAsync(token);\n }\n } catch (e) {\n console.warn(\n '[expo-notifications] Error encountered while updating server registration with latest device push token.',\n e\n );\n }\n });\n\n // Verify if persisted registration\n // has successfully uploaded last known\n // device push token. If not, retry.\n ServerRegistrationModule.getRegistrationInfoAsync().then(__handlePersistedRegistrationInfoAsync);\n} else {\n console.warn(\n `[expo-notifications] Error encountered while fetching auto-registration state, new tokens will not be automatically registered on server.`,\n new UnavailabilityError('ServerRegistrationModule', 'getRegistrationInfoAsync')\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationChannelGroupManager.d.ts","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;;AAE1F,wBAGqC"}
1
+ {"version":3,"file":"NotificationChannelGroupManager.d.ts","sourceRoot":"","sources":["../src/NotificationChannelGroupManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;wBAKrF,+BAA+B;AAHpC,wBAGqC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationChannelManager.d.ts","sourceRoot":"","sources":["../src/NotificationChannelManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;;AAEhF,wBAGgC"}
1
+ {"version":3,"file":"NotificationChannelManager.d.ts","sourceRoot":"","sources":["../src/NotificationChannelManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;wBAK3E,0BAA0B;AAH/B,wBAGgC"}
@@ -72,7 +72,7 @@ export interface NotificationChannel {
72
72
  enableLights: boolean;
73
73
  enableVibrate: boolean;
74
74
  }
75
- type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
75
+ export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
76
76
  /**
77
77
  * An object represents a notification channel to be set.
78
78
  * @platform android
@@ -87,5 +87,4 @@ export interface NotificationChannelManager extends ProxyNativeModule {
87
87
  setNotificationChannelAsync?: (channelId: string, channelConfiguration: NotificationChannelInput) => Promise<NotificationChannel | null>;
88
88
  deleteNotificationChannelAsync?: (channelId: string) => Promise<void>;
89
89
  }
90
- export {};
91
90
  //# sourceMappingURL=NotificationChannelManager.types.d.ts.map
@@ -1 +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,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IAAI,CAAC,CAAC;IACzC,8BAA8B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
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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AAC,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"}
@@ -1 +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"]}
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\nexport type 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"]}
@@ -1 +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;QACtD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;KACvE;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;QAC1D,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;KAC3E;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 '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 '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"]}
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 '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 '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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPermissionsModule.d.ts","sourceRoot":"","sources":["../src/NotificationPermissionsModule.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;;AAiEtF,wBAWmC"}
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"}
@@ -1 +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;QACd,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;KACL;AACH,CAAC;AAED,KAAK,UAAU,sBAAsB,CAAC,EACpC,SAAS,GAGV;IACC,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;QAC5B,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;KAC1C;IAED,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,MAAa,CAAC;IAC5C,IAAI,OAAO,YAAY,CAAC,iBAAiB,KAAK,WAAW,EAAE;QACzD,IAAI,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC;QACrC,IAAI,SAAS,EAAE;YACb,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;wBACb,QAAQ,GAAG,IAAI,CAAC;wBAChB,OAAO,CAAC,MAAM,CAAC,CAAC;qBACjB;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;SACJ;QACD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;KACxC;SAAM,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE;QAC5E,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;KAC7C;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"]}
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;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C,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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPresenterModule.d.ts","sourceRoot":"","sources":["../src/NotificationPresenterModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;;AAElF,wBAGiC"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationScheduler.d.ts","sourceRoot":"","sources":["../src/NotificationScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;;AAE5E,wBAGiC"}
1
+ {"version":3,"file":"NotificationScheduler.d.ts","sourceRoot":"","sources":["../src/NotificationScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;wBAKvE,2BAA2B;AAHhC,wBAGiC"}
@@ -1,5 +1,5 @@
1
1
  import { ProxyNativeModule } from 'expo-modules-core';
2
- import { NotificationRequest, NotificationContentInput } from './Notifications.types';
2
+ import { NotificationRequest, NotificationContentInput, CalendarTriggerInputValue } from './Notifications.types';
3
3
  export interface NotificationSchedulerModule extends ProxyNativeModule {
4
4
  getAllScheduledNotificationsAsync?: () => Promise<NotificationRequest[]>;
5
5
  scheduleNotificationAsync?: (identifier: string, notificationContent: NotificationContentInput, trigger: NotificationTriggerInput) => Promise<string>;
@@ -15,19 +15,7 @@ export interface CalendarTriggerInput {
15
15
  type: 'calendar';
16
16
  channelId?: string;
17
17
  repeats?: boolean;
18
- value: {
19
- timezone?: string;
20
- year?: number;
21
- month?: number;
22
- weekday?: number;
23
- weekOfMonth?: number;
24
- weekOfYear?: number;
25
- weekdayOrdinal?: number;
26
- day?: number;
27
- hour?: number;
28
- minute?: number;
29
- second?: number;
30
- };
18
+ value: CalendarTriggerInputValue;
31
19
  }
32
20
  export interface TimeIntervalTriggerInput {
33
21
  type: 'timeInterval';
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationScheduler.types.d.ts","sourceRoot":"","sources":["../src/NotificationScheduler.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,iCAAiC,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;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C,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,wBAAwB,GAChC,IAAI,GACJ,wBAAwB,GACxB,gBAAgB,GAChB,oBAAoB,GACpB,wBAAwB,GACxB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"NotificationScheduler.types.d.ts","sourceRoot":"","sources":["../src/NotificationScheduler.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,iCAAiC,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACzE,yBAAyB,CAAC,EAAE,CAC1B,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,wBAAwB,EAC7C,OAAO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AAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,wBAAwB,GAChC,IAAI,GACJ,wBAAwB,GACxB,gBAAgB,GAChB,oBAAoB,GACpB,wBAAwB,GACxB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationScheduler.types.js","sourceRoot":"","sources":["../src/NotificationScheduler.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport { NotificationRequest, NotificationContentInput } from './Notifications.types';\n\nexport interface NotificationSchedulerModule extends ProxyNativeModule {\n getAllScheduledNotificationsAsync?: () => Promise<NotificationRequest[]>;\n scheduleNotificationAsync?: (\n identifier: string,\n notificationContent: NotificationContentInput,\n trigger: NotificationTriggerInput\n ) => Promise<string>;\n cancelScheduledNotificationAsync?: (identifier: string) => Promise<void>;\n cancelAllScheduledNotificationsAsync?: () => Promise<void>;\n getNextTriggerDateAsync?: (trigger: NotificationTriggerInput) => Promise<number>;\n}\n\nexport interface ChannelAwareTriggerInput {\n type: 'channel';\n channelId?: string;\n}\n\n// ISO8601 calendar pattern-matching\nexport interface CalendarTriggerInput {\n type: 'calendar';\n channelId?: string;\n repeats?: boolean;\n value: {\n timezone?: string;\n\n year?: number;\n month?: number;\n weekday?: number;\n weekOfMonth?: number;\n weekOfYear?: number;\n weekdayOrdinal?: number;\n day?: number;\n\n hour?: number;\n minute?: number;\n second?: number;\n };\n}\n\nexport interface TimeIntervalTriggerInput {\n type: 'timeInterval';\n channelId?: string;\n repeats: boolean;\n seconds: number;\n}\n\nexport interface DailyTriggerInput {\n type: 'daily';\n channelId?: string;\n hour: number;\n minute: number;\n}\n\nexport interface WeeklyTriggerInput {\n type: 'weekly';\n channelId?: string;\n weekday: number;\n hour: number;\n minute: number;\n}\n\nexport interface YearlyTriggerInput {\n type: 'yearly';\n channelId?: string;\n day: number;\n month: number;\n hour: number;\n minute: number;\n}\n\nexport interface DateTriggerInput {\n type: 'date';\n channelId?: string;\n timestamp: number; // seconds since 1970\n}\n\nexport type NotificationTriggerInput =\n | null\n | ChannelAwareTriggerInput\n | DateTriggerInput\n | CalendarTriggerInput\n | TimeIntervalTriggerInput\n | DailyTriggerInput\n | WeeklyTriggerInput\n | YearlyTriggerInput;\n"]}
1
+ {"version":3,"file":"NotificationScheduler.types.js","sourceRoot":"","sources":["../src/NotificationScheduler.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport {\n NotificationRequest,\n NotificationContentInput,\n CalendarTriggerInputValue,\n} from './Notifications.types';\n\nexport interface NotificationSchedulerModule extends ProxyNativeModule {\n getAllScheduledNotificationsAsync?: () => Promise<NotificationRequest[]>;\n scheduleNotificationAsync?: (\n identifier: string,\n notificationContent: NotificationContentInput,\n trigger: NotificationTriggerInput\n ) => Promise<string>;\n cancelScheduledNotificationAsync?: (identifier: string) => Promise<void>;\n cancelAllScheduledNotificationsAsync?: () => Promise<void>;\n getNextTriggerDateAsync?: (trigger: NotificationTriggerInput) => Promise<number>;\n}\n\nexport interface ChannelAwareTriggerInput {\n type: 'channel';\n channelId?: string;\n}\n\n// ISO8601 calendar pattern-matching\nexport interface CalendarTriggerInput {\n type: 'calendar';\n channelId?: string;\n repeats?: boolean;\n value: CalendarTriggerInputValue;\n}\n\nexport interface TimeIntervalTriggerInput {\n type: 'timeInterval';\n channelId?: string;\n repeats: boolean;\n seconds: number;\n}\n\nexport interface DailyTriggerInput {\n type: 'daily';\n channelId?: string;\n hour: number;\n minute: number;\n}\n\nexport interface WeeklyTriggerInput {\n type: 'weekly';\n channelId?: string;\n weekday: number;\n hour: number;\n minute: number;\n}\n\nexport interface YearlyTriggerInput {\n type: 'yearly';\n channelId?: string;\n day: number;\n month: number;\n hour: number;\n minute: number;\n}\n\nexport interface DateTriggerInput {\n type: 'date';\n channelId?: string;\n timestamp: number; // seconds since 1970\n}\n\nexport type NotificationTriggerInput =\n | null\n | ChannelAwareTriggerInput\n | DateTriggerInput\n | CalendarTriggerInput\n | TimeIntervalTriggerInput\n | DailyTriggerInput\n | WeeklyTriggerInput\n | YearlyTriggerInput;\n"]}