expo-notifications 0.28.16 → 1.0.0-canary-20240904-69100c1

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 (75) hide show
  1. package/CHANGELOG.md +17 -18
  2. package/README.md +1 -3
  3. package/android/build.gradle +13 -2
  4. package/android/src/main/java/expo/modules/notifications/Exceptions.kt +0 -13
  5. package/android/src/main/java/expo/modules/notifications/notifications/JSONNotificationContentBuilder.java +1 -1
  6. package/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java +4 -1
  7. package/android/src/main/java/expo/modules/notifications/notifications/debug/DebugLogging.kt +1 -0
  8. package/android/src/main/java/expo/modules/notifications/notifications/handling/NotificationsHandler.kt +1 -2
  9. package/android/src/main/java/expo/modules/notifications/notifications/handling/SingleNotificationHandlerTask.java +2 -2
  10. package/android/src/main/java/expo/modules/notifications/notifications/model/triggers/FirebaseNotificationTrigger.kt +43 -0
  11. package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ChannelAwareNotificationBuilder.java +6 -7
  12. package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java +0 -3
  13. package/android/src/main/java/expo/modules/notifications/service/NotificationsService.kt +48 -44
  14. package/android/src/main/java/expo/modules/notifications/service/delegates/ExpoPresentationDelegate.kt +17 -3
  15. package/build/NotificationPermissions.d.ts +0 -1
  16. package/build/NotificationPermissions.d.ts.map +1 -1
  17. package/build/NotificationPermissions.js +0 -1
  18. package/build/NotificationPermissions.js.map +1 -1
  19. package/build/NotificationPermissions.types.d.ts +0 -5
  20. package/build/NotificationPermissions.types.d.ts.map +1 -1
  21. package/build/NotificationPermissions.types.js.map +1 -1
  22. package/build/Notifications.types.d.ts +3 -4
  23. package/build/Notifications.types.d.ts.map +1 -1
  24. package/build/Notifications.types.js.map +1 -1
  25. package/build/NotificationsEmitter.d.ts +5 -5
  26. package/build/NotificationsEmitter.d.ts.map +1 -1
  27. package/build/NotificationsEmitter.js +3 -3
  28. package/build/NotificationsEmitter.js.map +1 -1
  29. package/build/NotificationsHandler.d.ts.map +1 -1
  30. package/build/NotificationsHandler.js +2 -2
  31. package/build/NotificationsHandler.js.map +1 -1
  32. package/build/TokenEmitter.d.ts +3 -3
  33. package/build/TokenEmitter.d.ts.map +1 -1
  34. package/build/TokenEmitter.js +3 -3
  35. package/build/TokenEmitter.js.map +1 -1
  36. package/build/Tokens.types.d.ts +10 -13
  37. package/build/Tokens.types.d.ts.map +1 -1
  38. package/build/Tokens.types.js.map +1 -1
  39. package/build/getDevicePushTokenAsync.web.d.ts.map +1 -1
  40. package/build/getDevicePushTokenAsync.web.js +2 -1
  41. package/build/getDevicePushTokenAsync.web.js.map +1 -1
  42. package/build/getExpoPushTokenAsync.d.ts.map +1 -1
  43. package/build/getExpoPushTokenAsync.js +2 -5
  44. package/build/getExpoPushTokenAsync.js.map +1 -1
  45. package/build/setBadgeCountAsync.d.ts +1 -1
  46. package/build/setBadgeCountAsync.js +1 -1
  47. package/build/setBadgeCountAsync.js.map +1 -1
  48. package/build/setNotificationCategoryAsync.d.ts +2 -3
  49. package/build/setNotificationCategoryAsync.d.ts.map +1 -1
  50. package/build/setNotificationCategoryAsync.js +2 -3
  51. package/build/setNotificationCategoryAsync.js.map +1 -1
  52. package/ios/EXNotifications/Building/EXNotificationBuilder.m +4 -10
  53. package/ios/EXNotifications/Notifications/Categories/EXNotificationCategoriesModule.m +15 -43
  54. package/ios/EXNotifications/Notifications/EXNotificationCenterDelegate.m +4 -6
  55. package/ios/EXNotifications/Notifications/EXNotificationSerializer.m +11 -24
  56. package/ios/EXNotifications/Permissions/EXUserFacingNotificationsPermissionsRequester.m +10 -26
  57. package/ios/EXNotifications.podspec +3 -1
  58. package/package.json +12 -9
  59. package/src/NotificationPermissions.ts +0 -1
  60. package/src/NotificationPermissions.types.ts +0 -5
  61. package/src/Notifications.types.ts +10 -6
  62. package/src/NotificationsEmitter.ts +7 -7
  63. package/src/NotificationsHandler.ts +9 -4
  64. package/src/TokenEmitter.ts +5 -5
  65. package/src/Tokens.types.ts +10 -13
  66. package/src/getDevicePushTokenAsync.web.ts +2 -1
  67. package/src/getExpoPushTokenAsync.ts +2 -8
  68. package/src/setBadgeCountAsync.ts +1 -1
  69. package/src/setNotificationCategoryAsync.ts +2 -3
  70. package/tsconfig.json +1 -1
  71. package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationPresentationEffect.java +0 -11
  72. package/android/src/main/java/expo/modules/notifications/notifications/interfaces/NotificationPresentationEffectsManager.java +0 -7
  73. package/android/src/main/java/expo/modules/notifications/notifications/model/triggers/FirebaseNotificationTrigger.java +0 -61
  74. package/android/src/main/java/expo/modules/notifications/notifications/presentation/ExpoNotificationPresentationEffectsManager.java +0 -63
  75. package/android/src/main/java/expo/modules/notifications/notifications/presentation/effects/BaseNotificationEffect.java +0 -53
package/CHANGELOG.md CHANGED
@@ -4,61 +4,58 @@
4
4
 
5
5
  ### 🛠 Breaking changes
6
6
 
7
- ### 🎉 New features
8
-
9
- ### 🐛 Bug fixes
7
+ - Bumped iOS deployment target to 15.1. ([#30840](https://github.com/expo/expo/pull/30840), [#30862](https://github.com/expo/expo/pull/30862) by [@tsapeta](https://github.com/tsapeta))
10
8
 
11
- ### 💡 Others
12
-
13
- ## 0.28.16 — 2024-08-21
9
+ ### 🎉 New features
14
10
 
15
11
  ### 🐛 Bug fixes
16
12
 
13
+ - [Android] Take `channelId` into account when presenting notifications. ([#31201](https://github.com/expo/expo/pull/31201) by [@vonovak](https://github.com/vonovak))
14
+ - Add missing `react` and `react-native` peer dependencies for isolated modules. ([#30478](https://github.com/expo/expo/pull/30478) by [@byCedric](https://github.com/byCedric))
15
+ - [Android] Eliminate unsupported types when processing notification intents from onCreate/onNewIntent. ([#30750](https://github.com/expo/expo/pull/30750) by [@douglowder](https://github.com/douglowder))
17
16
  - [Android] Fix content.data in scheduled notifications surfaced to JS. ([#31048](https://github.com/expo/expo/pull/31048) by [@douglowder](https://github.com/douglowder))
17
+ - [Android] fix local notifications with null trigger. ([#31157](https://github.com/expo/expo/pull/31157) by [@douglowder](https://github.com/douglowder))
18
18
 
19
- ## 0.28.15 — 2024-08-05
20
-
21
- ### 🐛 Bug fixes
19
+ ### 💡 Others
22
20
 
23
- - [Android] Eliminate unsupported types when processing notification intents from onCreate/onNewIntent. ([#30750](https://github.com/expo/expo/pull/30750) by [@douglowder](https://github.com/douglowder))
21
+ - Keep using the legacy event emitter as the module is not fully migrated to Expo Modules API. ([#28946](https://github.com/expo/expo/pull/28946) by [@tsapeta](https://github.com/tsapeta))
24
22
 
25
- ## 0.28.14 2024-07-30
23
+ ## 0.28.14 - 2024-07-30
26
24
 
27
25
  ### 🐛 Bug fixes
28
26
 
29
27
  - `useLastNotificationResponse` should have only one effect. ([#30653](https://github.com/expo/expo/pull/30653) by [@douglowder](https://github.com/douglowder))
30
28
 
31
- ## 0.28.13 2024-07-29
29
+ ## 0.28.13 - 2024-07-29
32
30
 
33
31
  ### 🐛 Bug fixes
34
32
 
35
33
  - [Android] map Expo and Firebase notifications correctly. ([#30615](https://github.com/expo/expo/pull/30615) by [@douglowder](https://github.com/douglowder))
36
- - [Android] Apply requested changes from #30615. ([#30658](https://github.com/expo/expo/pull/30615) by [@lukmccall](https://github.com/lukmccall))
37
34
 
38
- ## 0.28.12 2024-07-25
35
+ ## 0.28.12 - 2024-07-25
39
36
 
40
37
  ### 🐛 Bug fixes
41
38
 
42
39
  - [Android] Android 11 crash when click foreground notifications. ([#30207](https://github.com/expo/expo/pull/30207) by [@GrinZero](https://github.com/GrinZero))
43
40
  - Notification's textInput content would contain `placeholder` instead of the actual user input ([#27479](https://github.com/expo/expo/pull/27479) by [@Victor-FT](https://github.com/Victor-FT))
44
41
 
45
- ## 0.28.11 2024-07-22
42
+ ## 0.28.11 - 2024-07-22
46
43
 
47
44
  ### 🐛 Bug fixes
48
45
 
49
46
  - [Android] Fix serialization of vibration pattern. ([#30495](https://github.com/expo/expo/pull/30495) by [@douglowder](https://github.com/douglowder))
50
47
 
51
- ## 0.28.10 2024-07-15
48
+ ## 0.28.10 - 2024-07-15
52
49
 
53
50
  ### 🐛 Bug fixes
54
51
 
55
52
  - [Android] fix getLastNotificationResponseAsync. ([#30301](https://github.com/expo/expo/pull/30301) by [@douglowder](https://github.com/douglowder))
56
53
 
57
- ## 0.28.9 2024-06-12
54
+ ## 0.28.9 - 2024-06-12
58
55
 
59
56
  _This version does not introduce any user-facing changes._
60
57
 
61
- ## 0.28.8 2024-06-10
58
+ ## 0.28.8 - 2024-06-10
62
59
 
63
60
  ### 🐛 Bug fixes
64
61
 
@@ -88,6 +85,8 @@ _This version does not introduce any user-facing changes._
88
85
 
89
86
  - [Android] Correctly map response in useLastNotificationResponse hook. ([#28938](https://github.com/expo/expo/pull/28938) by [@douglowder](https://github.com/douglowder))
90
87
 
88
+ ## 0.28.3 — 2024-05-16
89
+
91
90
  ### 💡 Others
92
91
 
93
92
  - [iOS] Add support for `interruptionLevel`. ([#28921](https://github.com/expo/expo/pull/28921) by [@lukmccall](https://github.com/lukmccall))
package/README.md CHANGED
@@ -50,7 +50,7 @@ In order to be able to receive push notifications on the device:
50
50
 
51
51
  ### Configure for Android
52
52
 
53
- In order to be able to receive push notifications on the device ensure that your project is set up for Firebase. For more information on how to do it, see [this guide](https://docs.expo.dev/guides/setup-native-firebase/#bare-workflow-setup).
53
+ In order to be able to receive push notifications on the device ensure that your project is set up for Firebase. For more information on how to do it, see [this guide](https://docs.expo.dev/guides/using-firebase/#install-and-initialize-react-native-firebase).
54
54
 
55
55
  This module requires permission to subscribe to device boot. It's used to setup the scheduled notifications right after the device (re)starts. The `RECEIVE_BOOT_COMPLETED` permission is added automatically.
56
56
 
@@ -825,7 +825,6 @@ An optional object of conforming to the following interface:
825
825
  allowCriticalAlerts?: boolean;
826
826
  provideAppNotificationSettings?: boolean;
827
827
  allowProvisional?: boolean;
828
- allowAnnouncements?: boolean;
829
828
  }
830
829
  }
831
830
  ```
@@ -849,7 +848,6 @@ export function requestPermissionsAsync() {
849
848
  allowAlert: true,
850
849
  allowBadge: true,
851
850
  allowSound: true,
852
- allowAnnouncements: true,
853
851
  },
854
852
  });
855
853
  }
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '0.28.16'
4
+ version = '0.28.3'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,12 +14,23 @@ android {
14
14
  namespace "expo.modules.notifications"
15
15
  defaultConfig {
16
16
  versionCode 21
17
- versionName '0.28.16'
17
+ versionName '0.28.3'
18
18
  }
19
19
 
20
20
  buildFeatures {
21
21
  buildConfig true
22
22
  }
23
+ testOptions {
24
+ unitTests.all { test ->
25
+ testLogging {
26
+ outputs.upToDateWhen { false }
27
+ events "passed", "failed", "skipped", "standardError"
28
+ showCauses true
29
+ showExceptions true
30
+ showStandardStreams true
31
+ }
32
+ }
33
+ }
23
34
  }
24
35
 
25
36
  dependencies {
@@ -7,16 +7,3 @@ class ModuleNotFoundException(moduleClass: KClass<*>) :
7
7
  CodedException(message = "$moduleClass module not found")
8
8
 
9
9
  class NotificationWasAlreadyHandledException(val id: String) : CodedException("Failed to handle notification $id, it has already been handled.")
10
-
11
- fun expo.modules.kotlin.Promise.toLegacyPromise(): expo.modules.core.Promise {
12
- val newPromise = this
13
- return object : expo.modules.core.Promise {
14
- override fun resolve(value: Any?) {
15
- newPromise.resolve(value)
16
- }
17
-
18
- override fun reject(c: String?, m: String?, e: Throwable?) {
19
- newPromise.reject(c ?: "unknown", m, e)
20
- }
21
- }
22
- }
@@ -100,7 +100,7 @@ public class JSONNotificationContentBuilder extends NotificationContent.Builder
100
100
  // do nothing
101
101
  }
102
102
 
103
- // do not play a default sound only if the value is a valid Uri
103
+ // play a default sound only if the value is NOT a valid Uri
104
104
  return getSound(payload) == null;
105
105
  }
106
106
 
@@ -76,7 +76,10 @@ public class NotificationSerializer {
76
76
  // and we copy the data as is
77
77
  content.putBundle("data", toBundle(data));
78
78
  }
79
- } else if(request.getTrigger() instanceof SchedulableNotificationTrigger) {
79
+ } else if(
80
+ request.getTrigger() instanceof SchedulableNotificationTrigger ||
81
+ request.getTrigger() == null
82
+ ) {
80
83
  JSONObject body = request.getContent().getBody();
81
84
  if (body != null) {
82
85
  // Expo sends notification.body as data.message, and JSON stringifies data.body
@@ -74,6 +74,7 @@ object DebugLogging {
74
74
  notification.notificationRequest.content.subtitle: ${notification.notificationRequest.content.subtitle}
75
75
  notification.notificationRequest.content.text: ${notification.notificationRequest.content.text}
76
76
  notification.notificationRequest.content.sound: ${notification.notificationRequest.content.sound}
77
+ notification.notificationRequest.content.channelID: ${notification.notificationRequest.trigger.notificationChannel}
77
78
  notification.notificationRequest.content.body: ${notification.notificationRequest.content.body}
78
79
  notification.notificationRequest.content.color: ${notification.notificationRequest.content.color}
79
80
  notification.notificationRequest.content.vibrationPattern: ${notification.notificationRequest.content.vibrationPattern.contentToString()}
@@ -13,7 +13,6 @@ import expo.modules.notifications.notifications.interfaces.NotificationListener
13
13
  import expo.modules.notifications.notifications.interfaces.NotificationManager
14
14
  import expo.modules.notifications.notifications.model.Notification
15
15
  import expo.modules.notifications.notifications.model.NotificationBehavior
16
- import expo.modules.notifications.toLegacyPromise
17
16
 
18
17
  class NotificationBehaviourRecord : Record {
19
18
  @Field
@@ -102,7 +101,7 @@ open class NotificationsHandler : Module(), NotificationListener {
102
101
  with(behavior) {
103
102
  task.handleResponse(
104
103
  NotificationBehavior(shouldShowAlert, shouldPlaySound, shouldSetBadge, priority),
105
- promise.toLegacyPromise()
104
+ promise
106
105
  )
107
106
  }
108
107
  }
@@ -5,7 +5,7 @@ import android.os.Bundle;
5
5
  import android.os.Handler;
6
6
  import android.os.ResultReceiver;
7
7
 
8
- import expo.modules.core.Promise;
8
+ import expo.modules.kotlin.Promise;
9
9
  import expo.modules.core.interfaces.services.EventEmitter;
10
10
  import expo.modules.notifications.notifications.NotificationSerializer;
11
11
  import expo.modules.notifications.notifications.model.Notification;
@@ -98,7 +98,7 @@ public class SingleNotificationHandlerTask {
98
98
  protected void onReceiveResult(int resultCode, Bundle resultData) {
99
99
  super.onReceiveResult(resultCode, resultData);
100
100
  if (resultCode == NotificationsService.SUCCESS_CODE) {
101
- promise.resolve(null);
101
+ promise.resolve();
102
102
  } else {
103
103
  Exception e = (Exception) resultData.getSerializable(NotificationsService.EXCEPTION_KEY);
104
104
  promise.reject("ERR_NOTIFICATION_PRESENTATION_FAILED", "Notification presentation failed.", e);
@@ -0,0 +1,43 @@
1
+ package expo.modules.notifications.notifications.model.triggers
2
+
3
+ import android.os.Build
4
+ import android.os.Parcel
5
+ import android.os.Parcelable
6
+ import androidx.annotation.RequiresApi
7
+ import com.google.firebase.messaging.RemoteMessage
8
+ import expo.modules.notifications.notifications.interfaces.NotificationTrigger
9
+
10
+ /**
11
+ * A trigger representing an incoming remote Firebase notification.
12
+ */
13
+ class FirebaseNotificationTrigger(private val remoteMessage: RemoteMessage) : NotificationTrigger {
14
+
15
+ private constructor(parcel: Parcel) : this(
16
+ parcel.readParcelable(FirebaseNotificationTrigger::class.java.classLoader)
17
+ ?: throw IllegalArgumentException("RemoteMessage from readParcelable must not be null")
18
+ )
19
+
20
+ fun getRemoteMessage(): RemoteMessage = remoteMessage
21
+
22
+ @RequiresApi(api = Build.VERSION_CODES.O)
23
+ override fun getNotificationChannel(): String? {
24
+ val channelId = remoteMessage.notification?.channelId ?: remoteMessage.data["channelId"]
25
+ return channelId ?: super.getNotificationChannel()
26
+ }
27
+
28
+ override fun describeContents(): Int {
29
+ return 0
30
+ }
31
+
32
+ override fun writeToParcel(dest: Parcel, flags: Int) {
33
+ dest.writeParcelable(remoteMessage, 0)
34
+ }
35
+
36
+ companion object {
37
+ @JvmField
38
+ val CREATOR = object : Parcelable.Creator<FirebaseNotificationTrigger> {
39
+ override fun createFromParcel(parcel: Parcel) = FirebaseNotificationTrigger(parcel)
40
+ override fun newArray(size: Int) = arrayOfNulls<FirebaseNotificationTrigger>(size)
41
+ }
42
+ }
43
+ }
@@ -53,19 +53,18 @@ public abstract class ChannelAwareNotificationBuilder extends BaseNotificationBu
53
53
  return getFallbackNotificationChannel().getId();
54
54
  }
55
55
 
56
- String channelId = trigger.getNotificationChannel();
57
- if (channelId == null) {
56
+ String requestedChannelId = trigger.getNotificationChannel();
57
+ if (requestedChannelId == null) {
58
58
  return getFallbackNotificationChannel().getId();
59
59
  }
60
60
 
61
- NotificationsChannelManager manager = getNotificationsChannelManager();
62
- NotificationChannel channel = manager.getNotificationChannel(channelId);
63
- if (channel == null) {
64
- Log.e("notifications", String.format("Channel '%s' doesn't exists. Fallback to '%s' channel", channelId, FALLBACK_CHANNEL_ID));
61
+ NotificationChannel channelForRequestedId = getNotificationsChannelManager().getNotificationChannel(requestedChannelId);
62
+ if (channelForRequestedId == null) {
63
+ Log.e("notifications", String.format("Channel '%s' doesn't exists. Fallback to '%s' channel", requestedChannelId, FALLBACK_CHANNEL_ID));
65
64
  return getFallbackNotificationChannel().getId();
66
65
  }
67
66
 
68
- return channel.getId();
67
+ return channelForRequestedId.getId();
69
68
  }
70
69
 
71
70
  @NonNull
@@ -7,7 +7,6 @@ import android.content.pm.PackageManager;
7
7
  import android.content.res.Resources;
8
8
  import android.graphics.Bitmap;
9
9
  import android.graphics.BitmapFactory;
10
- import android.os.Build;
11
10
  import android.os.Bundle;
12
11
  import android.os.Parcel;
13
12
  import android.provider.Settings;
@@ -34,8 +33,6 @@ public class ExpoNotificationBuilder extends ChannelAwareNotificationBuilder {
34
33
  public static final String EXTRAS_MARSHALLED_NOTIFICATION_REQUEST_KEY = "expo.notification_request";
35
34
  private static final String EXTRAS_BODY_KEY = "body";
36
35
 
37
- private static final long[] NO_VIBRATE_PATTERN = new long[]{0, 0};
38
-
39
36
  public ExpoNotificationBuilder(Context context) {
40
37
  super(context);
41
38
  }
@@ -10,6 +10,7 @@ import android.net.Uri
10
10
  import android.os.*
11
11
  import android.util.Log
12
12
  import androidx.core.app.RemoteInput
13
+ import expo.modules.core.interfaces.DoNotStrip
13
14
  import expo.modules.notifications.BuildConfig
14
15
  import expo.modules.notifications.notifications.model.*
15
16
  import expo.modules.notifications.service.delegates.ExpoCategoriesDelegate
@@ -86,9 +87,9 @@ open class NotificationsService : BroadcastReceiver() {
86
87
  fun getAllPresented(context: Context, receiver: ResultReceiver? = null) {
87
88
  doWork(
88
89
  context,
89
- Intent(NOTIFICATION_EVENT_ACTION, getUriBuilder().build()).also {
90
- it.putExtra(EVENT_TYPE_KEY, GET_ALL_DISPLAYED_TYPE)
91
- it.putExtra(RECEIVER_KEY, receiver)
90
+ Intent(NOTIFICATION_EVENT_ACTION, getUriBuilder().build()).apply {
91
+ putExtra(EVENT_TYPE_KEY, GET_ALL_DISPLAYED_TYPE)
92
+ putExtra(RECEIVER_KEY, receiver)
92
93
  }
93
94
  )
94
95
  }
@@ -105,11 +106,11 @@ open class NotificationsService : BroadcastReceiver() {
105
106
  val data = getUriBuilderForIdentifier(notification.notificationRequest.identifier).appendPath("present").build()
106
107
  doWork(
107
108
  context,
108
- Intent(NOTIFICATION_EVENT_ACTION, data).also { intent ->
109
- intent.putExtra(EVENT_TYPE_KEY, PRESENT_TYPE)
110
- intent.putExtra(NOTIFICATION_KEY, notification)
111
- intent.putExtra(NOTIFICATION_BEHAVIOR_KEY, behavior)
112
- intent.putExtra(RECEIVER_KEY, receiver)
109
+ Intent(NOTIFICATION_EVENT_ACTION, data).apply {
110
+ putExtra(EVENT_TYPE_KEY, PRESENT_TYPE)
111
+ putExtra(NOTIFICATION_KEY, notification)
112
+ putExtra(NOTIFICATION_BEHAVIOR_KEY, behavior)
113
+ putExtra(RECEIVER_KEY, receiver)
113
114
  }
114
115
  )
115
116
  }
@@ -125,10 +126,10 @@ open class NotificationsService : BroadcastReceiver() {
125
126
  val data = getUriBuilderForIdentifier(notification.notificationRequest.identifier).appendPath("receive").build()
126
127
  doWork(
127
128
  context,
128
- Intent(NOTIFICATION_EVENT_ACTION, data).also { intent ->
129
- intent.putExtra(EVENT_TYPE_KEY, RECEIVE_TYPE)
130
- intent.putExtra(NOTIFICATION_KEY, notification)
131
- intent.putExtra(RECEIVER_KEY, receiver)
129
+ Intent(NOTIFICATION_EVENT_ACTION, data).apply {
130
+ putExtra(EVENT_TYPE_KEY, RECEIVE_TYPE)
131
+ putExtra(NOTIFICATION_KEY, notification)
132
+ putExtra(RECEIVER_KEY, receiver)
132
133
  }
133
134
  )
134
135
  }
@@ -144,10 +145,10 @@ open class NotificationsService : BroadcastReceiver() {
144
145
  val data = getUriBuilder().appendPath("dismiss").build()
145
146
  doWork(
146
147
  context,
147
- Intent(NOTIFICATION_EVENT_ACTION, data).also { intent ->
148
- intent.putExtra(EVENT_TYPE_KEY, DISMISS_SELECTED_TYPE)
149
- intent.putExtra(IDENTIFIERS_KEY, identifiers)
150
- intent.putExtra(RECEIVER_KEY, receiver)
148
+ Intent(NOTIFICATION_EVENT_ACTION, data).apply {
149
+ putExtra(EVENT_TYPE_KEY, DISMISS_SELECTED_TYPE)
150
+ putExtra(IDENTIFIERS_KEY, identifiers)
151
+ putExtra(RECEIVER_KEY, receiver)
151
152
  }
152
153
  )
153
154
  }
@@ -162,9 +163,9 @@ open class NotificationsService : BroadcastReceiver() {
162
163
  val data = getUriBuilder().appendPath("dismiss").build()
163
164
  doWork(
164
165
  context,
165
- Intent(NOTIFICATION_EVENT_ACTION, data).also { intent ->
166
- intent.putExtra(EVENT_TYPE_KEY, DISMISS_ALL_TYPE)
167
- intent.putExtra(RECEIVER_KEY, receiver)
166
+ Intent(NOTIFICATION_EVENT_ACTION, data).apply {
167
+ putExtra(EVENT_TYPE_KEY, DISMISS_ALL_TYPE)
168
+ putExtra(RECEIVER_KEY, receiver)
168
169
  }
169
170
  )
170
171
  }
@@ -177,8 +178,8 @@ open class NotificationsService : BroadcastReceiver() {
177
178
  fun handleDropped(context: Context) {
178
179
  doWork(
179
180
  context,
180
- Intent(NOTIFICATION_EVENT_ACTION).also { intent ->
181
- intent.putExtra(EVENT_TYPE_KEY, DROPPED_TYPE)
181
+ Intent(NOTIFICATION_EVENT_ACTION).apply {
182
+ putExtra(EVENT_TYPE_KEY, DROPPED_TYPE)
182
183
  }
183
184
  )
184
185
  }
@@ -196,9 +197,9 @@ open class NotificationsService : BroadcastReceiver() {
196
197
  getUriBuilder()
197
198
  .appendPath("categories")
198
199
  .build()
199
- ).also {
200
- it.putExtra(EVENT_TYPE_KEY, GET_CATEGORIES_TYPE)
201
- it.putExtra(RECEIVER_KEY, receiver)
200
+ ).apply {
201
+ putExtra(EVENT_TYPE_KEY, GET_CATEGORIES_TYPE)
202
+ putExtra(RECEIVER_KEY, receiver)
202
203
  }
203
204
  )
204
205
  }
@@ -218,10 +219,10 @@ open class NotificationsService : BroadcastReceiver() {
218
219
  .appendPath("categories")
219
220
  .appendPath(category.identifier)
220
221
  .build()
221
- ).also {
222
- it.putExtra(EVENT_TYPE_KEY, SET_CATEGORY_TYPE)
223
- it.putExtra(NOTIFICATION_CATEGORY_KEY, category as Parcelable)
224
- it.putExtra(RECEIVER_KEY, receiver)
222
+ ).apply {
223
+ putExtra(EVENT_TYPE_KEY, SET_CATEGORY_TYPE)
224
+ putExtra(NOTIFICATION_CATEGORY_KEY, category as Parcelable)
225
+ putExtra(RECEIVER_KEY, receiver)
225
226
  }
226
227
  )
227
228
  }
@@ -241,10 +242,10 @@ open class NotificationsService : BroadcastReceiver() {
241
242
  .appendPath("categories")
242
243
  .appendPath(identifier)
243
244
  .build()
244
- ).also {
245
- it.putExtra(EVENT_TYPE_KEY, DELETE_CATEGORY_TYPE)
246
- it.putExtra(IDENTIFIER_KEY, identifier)
247
- it.putExtra(RECEIVER_KEY, receiver)
245
+ ).apply {
246
+ putExtra(EVENT_TYPE_KEY, DELETE_CATEGORY_TYPE)
247
+ putExtra(IDENTIFIER_KEY, identifier)
248
+ putExtra(RECEIVER_KEY, receiver)
248
249
  }
249
250
  )
250
251
  }
@@ -266,12 +267,13 @@ open class NotificationsService : BroadcastReceiver() {
266
267
  }
267
268
 
268
269
  /**
269
- * Fetches scheduled notification asynchronously.
270
+ * Fetches scheduled notification asynchronously. Used in Expo Go's ScopedNotificationScheduler.kt
270
271
  *
271
272
  * @param context Context this is being called from
272
273
  * @param identifier Identifier of the notification to be fetched
273
274
  * @param resultReceiver Receiver to be called with the results
274
275
  */
276
+ @DoNotStrip
275
277
  fun getScheduledNotification(context: Context, identifier: String, resultReceiver: ResultReceiver? = null) {
276
278
  doWork(
277
279
  context,
@@ -305,10 +307,10 @@ open class NotificationsService : BroadcastReceiver() {
305
307
  .appendPath("scheduled")
306
308
  .appendPath(notificationRequest.identifier)
307
309
  .build()
308
- ).also { intent ->
309
- intent.putExtra(EVENT_TYPE_KEY, SCHEDULE_TYPE)
310
- intent.putExtra(NOTIFICATION_REQUEST_KEY, notificationRequest as Parcelable)
311
- intent.putExtra(RECEIVER_KEY, resultReceiver)
310
+ ).apply {
311
+ putExtra(EVENT_TYPE_KEY, SCHEDULE_TYPE)
312
+ putExtra(NOTIFICATION_REQUEST_KEY, notificationRequest as Parcelable)
313
+ putExtra(RECEIVER_KEY, resultReceiver)
312
314
  }
313
315
  )
314
316
  }
@@ -338,10 +340,10 @@ open class NotificationsService : BroadcastReceiver() {
338
340
  getUriBuilder()
339
341
  .appendPath("scheduled")
340
342
  .build()
341
- ).also { intent ->
342
- intent.putExtra(EVENT_TYPE_KEY, REMOVE_SELECTED_TYPE)
343
- intent.putExtra(IDENTIFIERS_KEY, identifiers.toTypedArray())
344
- intent.putExtra(RECEIVER_KEY, resultReceiver)
343
+ ).apply {
344
+ putExtra(EVENT_TYPE_KEY, REMOVE_SELECTED_TYPE)
345
+ putExtra(IDENTIFIERS_KEY, identifiers.toTypedArray())
346
+ putExtra(RECEIVER_KEY, resultReceiver)
345
347
  }
346
348
  )
347
349
  }
@@ -355,9 +357,9 @@ open class NotificationsService : BroadcastReceiver() {
355
357
  fun removeAllScheduledNotifications(context: Context, resultReceiver: ResultReceiver? = null) {
356
358
  doWork(
357
359
  context,
358
- Intent(NOTIFICATION_EVENT_ACTION).also { intent ->
359
- intent.putExtra(EVENT_TYPE_KEY, REMOVE_ALL_TYPE)
360
- intent.putExtra(RECEIVER_KEY, resultReceiver)
360
+ Intent(NOTIFICATION_EVENT_ACTION).apply {
361
+ putExtra(EVENT_TYPE_KEY, REMOVE_ALL_TYPE)
362
+ putExtra(RECEIVER_KEY, resultReceiver)
361
363
  }
362
364
  )
363
365
  }
@@ -511,6 +513,8 @@ open class NotificationsService : BroadcastReceiver() {
511
513
  return response
512
514
  }
513
515
 
516
+ // this is used by Expo Go's Kernel.kt
517
+ @DoNotStrip
514
518
  fun getNotificationResponseFromOpenIntent(intent: Intent): NotificationResponse? {
515
519
  intent.getByteArrayExtra(NOTIFICATION_RESPONSE_KEY)?.let { return unmarshalObject(NotificationResponse.CREATOR, it) }
516
520
  intent.getByteArrayExtra(TEXT_INPUT_NOTIFICATION_RESPONSE_KEY)?.let { return unmarshalObject(TextInputNotificationResponse.CREATOR, it) }
@@ -4,6 +4,7 @@ import android.app.NotificationManager
4
4
  import android.content.Context
5
5
  import android.media.RingtoneManager
6
6
  import android.net.Uri
7
+ import android.os.Build
7
8
  import android.os.Bundle
8
9
  import android.os.Parcel
9
10
  import android.provider.Settings
@@ -21,11 +22,13 @@ import expo.modules.notifications.notifications.presentation.builders.ExpoNotifi
21
22
  import expo.modules.notifications.service.interfaces.PresentationDelegate
22
23
  import org.json.JSONException
23
24
  import org.json.JSONObject
24
- import java.util.*
25
+ import java.util.Date
25
26
 
26
27
  open class ExpoPresentationDelegate(
27
- protected val context: Context
28
+ protected val context: Context,
29
+ private val notificationManager: NotificationManagerCompat = NotificationManagerCompat.from(context)
28
30
  ) : PresentationDelegate {
31
+
29
32
  companion object {
30
33
  protected const val ANDROID_NOTIFICATION_ID = 0
31
34
 
@@ -87,9 +90,10 @@ open class ExpoPresentationDelegate(
87
90
  override fun presentNotification(notification: Notification, behavior: NotificationBehavior?) {
88
91
  if (behavior != null && !behavior.shouldShowAlert()) {
89
92
  if (behavior.shouldPlaySound()) {
93
+ val sound = getNotificationSoundUri(notification) ?: Settings.System.DEFAULT_NOTIFICATION_URI
90
94
  RingtoneManager.getRingtone(
91
95
  context,
92
- notification.notificationRequest.content.sound ?: Settings.System.DEFAULT_NOTIFICATION_URI
96
+ sound
93
97
  ).play()
94
98
  }
95
99
  return
@@ -101,6 +105,16 @@ open class ExpoPresentationDelegate(
101
105
  )
102
106
  }
103
107
 
108
+ private fun getNotificationSoundUri(notification: Notification): Uri? {
109
+ return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
110
+ notification.notificationRequest.trigger.notificationChannel?.let {
111
+ notificationManager.getNotificationChannel(it)?.sound
112
+ }
113
+ } else {
114
+ notification.notificationRequest.content.sound
115
+ }
116
+ }
117
+
104
118
  protected open fun getNotifyId(request: NotificationRequest?): Int {
105
119
  return ANDROID_NOTIFICATION_ID
106
120
  }
@@ -35,7 +35,6 @@ export declare function getPermissionsAsync(): Promise<NotificationPermissionsSt
35
35
  * allowAlert: true,
36
36
  * allowBadge: true,
37
37
  * allowSound: true,
38
- * allowAnnouncements: true,
39
38
  * },
40
39
  * });
41
40
  * }
@@ -1 +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"}
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;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,CAAC,EAAE,8BAA8B,0CAczF;AAGD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,iPAMzB,CAAC"}
@@ -41,7 +41,6 @@ export async function getPermissionsAsync() {
41
41
  * allowAlert: true,
42
42
  * allowBadge: true,
43
43
  * allowSound: true,
44
- * allowAnnouncements: true,
45
44
  * },
46
45
  * });
47
46
  * }
@@ -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;QACtD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;KACvE;IAED,OAAO,MAAM,6BAA6B,CAAC,mBAAmB,EAAE,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;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 * },\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"]}
@@ -70,11 +70,6 @@ export interface IosNotificationPermissionsRequest {
70
70
  * The ability to post noninterrupting notifications provisionally to the Notification Center.
71
71
  */
72
72
  allowProvisional?: boolean;
73
- /**
74
- * The ability for Siri to automatically read out messages over AirPods.
75
- * @deprecated
76
- */
77
- allowAnnouncements?: boolean;
78
73
  }
79
74
  export type NativeNotificationPermissionsRequest = IosNotificationPermissionsRequest | object;
80
75
  /**
@@ -1 +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"}
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;CAC5B;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"}