expo-notifications 0.30.1-canary-20250407-10a9b42 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +2 -20
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/notifications/NotificationsPackage.java +0 -2
- package/android/src/main/java/expo/modules/notifications/Utils.kt +1 -1
- package/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java +9 -16
- package/android/src/main/java/expo/modules/notifications/notifications/RemoteMessageSerializer.java +1 -9
- package/android/src/main/java/expo/modules/notifications/notifications/channels/serializers/ExpoNotificationsChannelSerializer.java +1 -14
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/ExpoNotificationPresentationModule.kt +0 -33
- package/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.kt +1 -1
- package/android/src/main/java/expo/modules/notifications/service/delegates/FirebaseMessagingDelegate.kt +2 -2
- package/android/src/main/java/expo/modules/notifications/tokens/PushTokenModule.kt +22 -36
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/FirebaseTokenListener.kt +14 -0
- package/build/NotificationPresenterModule.types.d.ts +1 -2
- package/build/NotificationPresenterModule.types.d.ts.map +1 -1
- package/build/NotificationPresenterModule.types.js.map +1 -1
- package/build/NotificationScheduler.types.d.ts +11 -15
- package/build/NotificationScheduler.types.d.ts.map +1 -1
- package/build/NotificationScheduler.types.js.map +1 -1
- package/build/Notifications.types.d.ts +1 -1
- package/build/Notifications.types.js.map +1 -1
- package/build/PushTokenManager.d.ts.map +1 -1
- package/build/PushTokenManager.js +7 -1
- package/build/PushTokenManager.js.map +1 -1
- package/build/PushTokenManager.types.d.ts +7 -2
- package/build/PushTokenManager.types.d.ts.map +1 -1
- package/build/PushTokenManager.types.js +5 -1
- package/build/PushTokenManager.types.js.map +1 -1
- package/build/TokenEmitter.d.ts.map +1 -1
- package/build/TokenEmitter.js +2 -3
- package/build/TokenEmitter.js.map +1 -1
- package/build/presentNotificationAsync.d.ts +2 -0
- package/build/presentNotificationAsync.d.ts.map +1 -1
- package/build/presentNotificationAsync.js +4 -11
- package/build/presentNotificationAsync.js.map +1 -1
- package/build/scheduleNotificationAsync.d.ts +7 -4
- package/build/scheduleNotificationAsync.d.ts.map +1 -1
- package/build/scheduleNotificationAsync.js +8 -5
- package/build/scheduleNotificationAsync.js.map +1 -1
- package/build/utils/mapNotificationResponse.d.ts +52 -12
- package/build/utils/mapNotificationResponse.d.ts.map +1 -1
- package/build/utils/mapNotificationResponse.js +16 -5
- package/build/utils/mapNotificationResponse.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/EXNotifications/Notifications/Presenting/PresentationModule.swift +1 -46
- package/ios/EXNotifications/Notifications/Records.swift +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42-sources.jar → 0.30.1/expo.modules.notifications-0.30.1-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.module → 0.30.1/expo.modules.notifications-0.30.1.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.pom → 0.30.1/expo.modules.notifications-0.30.1.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1/expo.modules.notifications-0.30.1.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512 +1 -1
- package/package.json +8 -7
- package/src/NotificationPresenterModule.types.ts +1 -5
- package/src/NotificationScheduler.types.ts +11 -15
- package/src/Notifications.types.ts +1 -1
- package/src/PushTokenManager.ts +7 -1
- package/src/PushTokenManager.types.ts +6 -2
- package/src/TokenEmitter.ts +2 -3
- package/src/presentNotificationAsync.ts +6 -16
- package/src/scheduleNotificationAsync.ts +8 -5
- package/src/utils/mapNotificationResponse.ts +16 -5
- package/android/src/main/java/expo/modules/notifications/tokens/PushTokenManager.java +0 -88
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/FirebaseTokenListener.java +0 -16
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/PushTokenListener.java +0 -14
- package/android/src/main/java/expo/modules/notifications/tokens/interfaces/PushTokenManager.java +0 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.30.1-canary-20250407-10a9b42/expo.modules.notifications-0.30.1-canary-20250407-10a9b42.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,10 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.30.1 — 2025-04-08
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
13
17
|
## 0.30.0 — 2025-04-04
|
|
14
18
|
|
|
15
19
|
### 🐛 Bug fixes
|
|
16
20
|
|
|
21
|
+
- remove unneeded Long conversions on Android ([#35976](https://github.com/expo/expo/pull/35976) by [@vonovak](https://github.com/vonovak))
|
|
22
|
+
- [post-swift-conversion] fix data serialization ([#35975](https://github.com/expo/expo/pull/35975) by [@vonovak](https://github.com/vonovak))
|
|
23
|
+
- simplify push token event management ([#35944](https://github.com/expo/expo/pull/35944) by [@vonovak](https://github.com/vonovak))
|
|
24
|
+
- fix Android `NotificationContent` not containing JSON data object ([#35942](https://github.com/expo/expo/pull/35942) by [@vonovak](https://github.com/vonovak))
|
|
25
|
+
- [post-swift-conversion] fix regressions in `CalendarTriggerRecord` ([#35937](https://github.com/expo/expo/pull/35937) by [@vonovak](https://github.com/vonovak))
|
|
26
|
+
- remove deprecated `presentNotificationAsync` ([#35900](https://github.com/expo/expo/pull/35900) by [@vonovak](https://github.com/vonovak))
|
|
17
27
|
- [post-swift-conversion] UNTextInputNotificationAction wasn't provided with options ([#35903](https://github.com/expo/expo/pull/35903) by [@vonovak](https://github.com/vonovak))
|
|
18
28
|
- [post-swift-conversion] event emitter should not influence notification presentation ([#35858](https://github.com/expo/expo/pull/35858) by [@vonovak](https://github.com/vonovak))
|
|
19
29
|
- correctly serialize `null` trigger on iOS ([#35672](https://github.com/expo/expo/pull/35672) by [@vonovak](https://github.com/vonovak))
|
package/README.md
CHANGED
|
@@ -350,7 +350,6 @@ The following methods are exported by the `expo-notifications` module:
|
|
|
350
350
|
- [`setBadgeCountAsync`](#setbadgecountasyncbadgecount-number-options-setbadgecountoptions-promiseboolean) -- sets the application badge number value
|
|
351
351
|
- **scheduling notifications**
|
|
352
352
|
- [`getAllScheduledNotificationsAsync`](#getallschedulednotificationsasync-promisenotification) -- fetches information about all scheduled notifications
|
|
353
|
-
- [`presentNotificationAsync`](#presentnotificationasynccontent-notificationcontentinput-identifier-string-promisestring) -- schedules a notification for immediate trigger
|
|
354
353
|
- [`scheduleNotificationAsync`](#schedulenotificationasyncnotificationrequest-notificationrequestinput-promisestring) -- schedules a notification to be triggered in the future
|
|
355
354
|
- [`cancelScheduledNotificationAsync`](#cancelschedulednotificationasyncidentifier-string-promisevoid) -- removes a specific scheduled notification
|
|
356
355
|
- [`cancelAllScheduledNotificationsAsync`](#cancelallschedulednotificationsasync-promisevoid) -- removes all scheduled notifications
|
|
@@ -901,12 +900,6 @@ Fetches information about all scheduled notifications.
|
|
|
901
900
|
|
|
902
901
|
It returns a `Promise` resolving to an array of objects conforming to the [`Notification`](#notification) interface.
|
|
903
902
|
|
|
904
|
-
### `presentNotificationAsync(content: NotificationContentInput, identifier?: string): Promise<string>`
|
|
905
|
-
|
|
906
|
-
Schedules a notification for immediate trigger.
|
|
907
|
-
|
|
908
|
-
> **Note:** This method has been deprecated in favor of using an explicit `NotificationHandler` and the `scheduleNotificationAsync` method. More info may be found at https://expo.fyi/presenting-notifications-deprecated.
|
|
909
|
-
|
|
910
903
|
#### Arguments
|
|
911
904
|
|
|
912
905
|
The only argument to this function is a [`NotificationContentInput`](#notificationcontentinput).
|
|
@@ -917,18 +910,7 @@ It returns a `Promise` resolving with the notification's identifier once the not
|
|
|
917
910
|
|
|
918
911
|
#### Examples
|
|
919
912
|
|
|
920
|
-
##### Presenting the notification to the user
|
|
921
|
-
|
|
922
|
-
```ts
|
|
923
|
-
import * as Notifications from 'expo-notifications';
|
|
924
|
-
|
|
925
|
-
Notifications.presentNotificationAsync({
|
|
926
|
-
title: 'Look at that notification',
|
|
927
|
-
body: "I'm so proud of myself!",
|
|
928
|
-
});
|
|
929
|
-
```
|
|
930
|
-
|
|
931
|
-
##### Presenting the notification to the user (recommended way)
|
|
913
|
+
##### Presenting the notification to the user
|
|
932
914
|
|
|
933
915
|
```ts
|
|
934
916
|
import * as Notifications from 'expo-notifications';
|
|
@@ -1415,7 +1397,7 @@ export type NotificationContent = {
|
|
|
1415
1397
|
|
|
1416
1398
|
### `NotificationContentInput`
|
|
1417
1399
|
|
|
1418
|
-
An object representing notification content that you pass
|
|
1400
|
+
An object representing notification content that you pass as a part of `NotificationRequestInput`.
|
|
1419
1401
|
|
|
1420
1402
|
```ts
|
|
1421
1403
|
export interface NotificationContentInput {
|
package/android/build.gradle
CHANGED
|
@@ -5,13 +5,13 @@ plugins {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
group = 'host.exp.exponent'
|
|
8
|
-
version = '0.30.1
|
|
8
|
+
version = '0.30.1'
|
|
9
9
|
|
|
10
10
|
android {
|
|
11
11
|
namespace "expo.modules.notifications"
|
|
12
12
|
defaultConfig {
|
|
13
13
|
versionCode 21
|
|
14
|
-
versionName '0.30.1
|
|
14
|
+
versionName '0.30.1'
|
|
15
15
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -14,7 +14,6 @@ import expo.modules.notifications.notifications.NotificationManager;
|
|
|
14
14
|
import expo.modules.notifications.notifications.categories.serializers.ExpoNotificationsCategoriesSerializer;
|
|
15
15
|
import expo.modules.notifications.notifications.channels.AndroidXNotificationsChannelsProvider;
|
|
16
16
|
import expo.modules.notifications.service.delegates.ExpoNotificationLifecycleListener;
|
|
17
|
-
import expo.modules.notifications.tokens.PushTokenManager;
|
|
18
17
|
|
|
19
18
|
public class NotificationsPackage extends BasePackage {
|
|
20
19
|
|
|
@@ -27,7 +26,6 @@ public class NotificationsPackage extends BasePackage {
|
|
|
27
26
|
@Override
|
|
28
27
|
public List<SingletonModule> createSingletonModules(Context context) {
|
|
29
28
|
return Arrays.asList(
|
|
30
|
-
new PushTokenManager(),
|
|
31
29
|
mNotificationManager
|
|
32
30
|
);
|
|
33
31
|
}
|
|
@@ -86,7 +86,7 @@ internal val isBundleConvertibleToJSValue: BundleConversionTester = { bundle: Bu
|
|
|
86
86
|
/**
|
|
87
87
|
* Returns true if the argument is a valid JSON string, false otherwise
|
|
88
88
|
*/
|
|
89
|
-
internal fun isValidJSONString(test:
|
|
89
|
+
internal fun isValidJSONString(test: String?): Boolean {
|
|
90
90
|
when (test is String) {
|
|
91
91
|
true -> {
|
|
92
92
|
try {
|
package/android/src/main/java/expo/modules/notifications/notifications/NotificationSerializer.java
CHANGED
|
@@ -2,6 +2,7 @@ package expo.modules.notifications.notifications;
|
|
|
2
2
|
|
|
3
3
|
import static expo.modules.notifications.UtilsKt.filteredBundleForJSTypeConverter;
|
|
4
4
|
import static expo.modules.notifications.UtilsKt.isValidJSONString;
|
|
5
|
+
import static expo.modules.notifications.notifications.model.NotificationResponse.DEFAULT_ACTION_IDENTIFIER;
|
|
5
6
|
|
|
6
7
|
import android.os.Bundle;
|
|
7
8
|
|
|
@@ -31,12 +32,6 @@ import expo.modules.notifications.notifications.model.TextInputNotificationRespo
|
|
|
31
32
|
import expo.modules.notifications.notifications.model.triggers.FirebaseNotificationTrigger;
|
|
32
33
|
|
|
33
34
|
import expo.modules.notifications.notifications.triggers.ChannelAwareTrigger;
|
|
34
|
-
import expo.modules.notifications.notifications.triggers.DailyTrigger;
|
|
35
|
-
import expo.modules.notifications.notifications.triggers.DateTrigger;
|
|
36
|
-
import expo.modules.notifications.notifications.triggers.MonthlyTrigger;
|
|
37
|
-
import expo.modules.notifications.notifications.triggers.TimeIntervalTrigger;
|
|
38
|
-
import expo.modules.notifications.notifications.triggers.WeeklyTrigger;
|
|
39
|
-
import expo.modules.notifications.notifications.triggers.YearlyTrigger;
|
|
40
35
|
|
|
41
36
|
public class NotificationSerializer {
|
|
42
37
|
public static Bundle toBundle(NotificationResponse response) {
|
|
@@ -64,14 +59,13 @@ public class NotificationSerializer {
|
|
|
64
59
|
Bundle content = toBundle(request.getContent());
|
|
65
60
|
Bundle existingContentData = content.getBundle("data");
|
|
66
61
|
if (existingContentData == null) {
|
|
67
|
-
if(requestTrigger instanceof FirebaseNotificationTrigger trigger) {
|
|
62
|
+
if (requestTrigger instanceof FirebaseNotificationTrigger trigger) {
|
|
68
63
|
RemoteMessage message = trigger.getRemoteMessage();
|
|
69
|
-
RemoteMessage.Notification notification = message.getNotification();
|
|
70
64
|
Map<String, String> data = message.getData();
|
|
71
65
|
String dataBody = data.get("body");
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
//
|
|
66
|
+
if (isValidJSONString(dataBody)) {
|
|
67
|
+
// If the body is a JSON object string, the notification was sent by the Expo notification service,
|
|
68
|
+
// so we do the expected remapping of fields (we JSON-parse the string into an object in JS)
|
|
75
69
|
content.putString("dataString", dataBody);
|
|
76
70
|
} else {
|
|
77
71
|
// The message was sent directly from Firebase or some other service,
|
|
@@ -127,7 +121,7 @@ public class NotificationSerializer {
|
|
|
127
121
|
serializedContent.putString("priority", content.getPriority().getEnumValue());
|
|
128
122
|
}
|
|
129
123
|
if (content.getVibrationPattern() != null) {
|
|
130
|
-
serializedContent.
|
|
124
|
+
serializedContent.putLongArray("vibrationPattern", content.getVibrationPattern());
|
|
131
125
|
}
|
|
132
126
|
serializedContent.putBoolean("autoDismiss", content.isAutoDismiss());
|
|
133
127
|
if (content.getCategoryId() != null) {
|
|
@@ -196,9 +190,8 @@ public class NotificationSerializer {
|
|
|
196
190
|
serializedContent.putString("title", extras.getString("title"));
|
|
197
191
|
String body = extras.getString("body");
|
|
198
192
|
if (isValidJSONString(body) ) {
|
|
199
|
-
// If the body is a JSON string,
|
|
200
|
-
// the
|
|
201
|
-
// so we do the expected remapping of fields
|
|
193
|
+
// If the body is a JSON object string, the notification was sent by the Expo notification service,
|
|
194
|
+
// so we do the expected remapping of fields (we JSON-parse the string into an object in JS)
|
|
202
195
|
serializedContent.putString("dataString", body);
|
|
203
196
|
serializedContent.putString("body", extras.getString("message"));
|
|
204
197
|
} else {
|
|
@@ -222,7 +215,7 @@ public class NotificationSerializer {
|
|
|
222
215
|
serializedNotification.putBundle("request", serializedRequest);
|
|
223
216
|
|
|
224
217
|
Bundle serializedResponse = new Bundle();
|
|
225
|
-
serializedResponse.putString("actionIdentifier",
|
|
218
|
+
serializedResponse.putString("actionIdentifier", DEFAULT_ACTION_IDENTIFIER);
|
|
226
219
|
serializedResponse.putBundle("notification", serializedNotification);
|
|
227
220
|
|
|
228
221
|
return serializedResponse;
|
package/android/src/main/java/expo/modules/notifications/notifications/RemoteMessageSerializer.java
CHANGED
|
@@ -95,7 +95,7 @@ public class RemoteMessageSerializer {
|
|
|
95
95
|
serializedNotification.putStringArray("titleLocalizationArgs", notification.getTitleLocalizationArgs());
|
|
96
96
|
serializedNotification.putString("titleLocalizationKey", notification.getTitleLocalizationKey());
|
|
97
97
|
if (notification.getVibrateTimings() != null) {
|
|
98
|
-
serializedNotification.
|
|
98
|
+
serializedNotification.putLongArray("vibrateTimings", notification.getVibrateTimings());
|
|
99
99
|
}
|
|
100
100
|
if (notification.getVisibility() != null) {
|
|
101
101
|
serializedNotification.putInt("visibility", notification.getVisibility());
|
|
@@ -104,12 +104,4 @@ public class RemoteMessageSerializer {
|
|
|
104
104
|
}
|
|
105
105
|
return serializedNotification;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
public static int[] intArrayFromLongArray(long[] longArray) {
|
|
109
|
-
int[] intArray = new int[longArray.length];
|
|
110
|
-
for (int i = 0; i < longArray.length; i++) {
|
|
111
|
-
intArray[i] = (int)(longArray[i]);
|
|
112
|
-
}
|
|
113
|
-
return intArray;
|
|
114
|
-
}
|
|
115
107
|
}
|
|
@@ -38,7 +38,7 @@ public class ExpoNotificationsChannelSerializer implements NotificationsChannelS
|
|
|
38
38
|
result.putBoolean(SHOW_BADGE_KEY, channel.canShowBadge());
|
|
39
39
|
result.putString(SOUND_KEY, toString(channel.getSound()));
|
|
40
40
|
result.putBundle(SOUND_AUDIO_ATTRIBUTES_KEY, toBundle(channel.getAudioAttributes()));
|
|
41
|
-
result.
|
|
41
|
+
result.putLongArray(VIBRATION_PATTERN_KEY, channel.getVibrationPattern());
|
|
42
42
|
result.putBoolean(ENABLE_LIGHTS_KEY, channel.shouldShowLights());
|
|
43
43
|
result.putBoolean(ENABLE_VIBRATE_KEY, channel.shouldVibrate());
|
|
44
44
|
return result;
|
|
@@ -85,17 +85,4 @@ public class ExpoNotificationsChannelSerializer implements NotificationsChannelS
|
|
|
85
85
|
|
|
86
86
|
return result;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
@Nullable
|
|
90
|
-
private double[] toArray(@Nullable long[] array) {
|
|
91
|
-
if (array == null) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
double[] result = new double[array.length];
|
|
96
|
-
for (int i = 0; i < array.length; i++) {
|
|
97
|
-
result[i] = array[i];
|
|
98
|
-
}
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
88
|
}
|
|
@@ -2,24 +2,18 @@ package expo.modules.notifications.notifications.presentation
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.os.Bundle
|
|
5
|
-
import expo.modules.core.arguments.ReadableArguments
|
|
6
5
|
import expo.modules.kotlin.Promise
|
|
7
6
|
import expo.modules.kotlin.exception.Exceptions
|
|
8
7
|
import expo.modules.kotlin.modules.Module
|
|
9
8
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
10
9
|
import expo.modules.notifications.ResultReceiverBody
|
|
11
10
|
import expo.modules.notifications.createDefaultResultReceiver
|
|
12
|
-
import expo.modules.notifications.notifications.ArgumentsNotificationContentBuilder
|
|
13
11
|
import expo.modules.notifications.notifications.NotificationSerializer
|
|
14
|
-
import expo.modules.notifications.notifications.interfaces.INotificationContent
|
|
15
|
-
import expo.modules.notifications.notifications.interfaces.NotificationTrigger
|
|
16
12
|
import expo.modules.notifications.notifications.model.Notification
|
|
17
|
-
import expo.modules.notifications.notifications.model.NotificationRequest
|
|
18
13
|
import expo.modules.notifications.service.NotificationsService
|
|
19
14
|
import expo.modules.notifications.service.NotificationsService.Companion.dismiss
|
|
20
15
|
import expo.modules.notifications.service.NotificationsService.Companion.dismissAll
|
|
21
16
|
import expo.modules.notifications.service.NotificationsService.Companion.getAllPresented
|
|
22
|
-
import expo.modules.notifications.service.NotificationsService.Companion.present
|
|
23
17
|
|
|
24
18
|
open class ExpoNotificationPresentationModule : Module() {
|
|
25
19
|
private val context: Context
|
|
@@ -31,25 +25,6 @@ open class ExpoNotificationPresentationModule : Module() {
|
|
|
31
25
|
override fun definition() = ModuleDefinition {
|
|
32
26
|
Name("ExpoNotificationPresenter")
|
|
33
27
|
|
|
34
|
-
AsyncFunction("presentNotificationAsync") { identifier: String, payload: ReadableArguments, promise: Promise ->
|
|
35
|
-
val content = ArgumentsNotificationContentBuilder(context).setPayload(payload).build()
|
|
36
|
-
val request = createNotificationRequest(identifier, content, null)
|
|
37
|
-
val notification = Notification(request)
|
|
38
|
-
present(
|
|
39
|
-
context,
|
|
40
|
-
notification,
|
|
41
|
-
null,
|
|
42
|
-
createResultReceiver { resultCode: Int, resultData: Bundle? ->
|
|
43
|
-
if (resultCode == NotificationsService.SUCCESS_CODE) {
|
|
44
|
-
promise.resolve(identifier)
|
|
45
|
-
} else {
|
|
46
|
-
val e = resultData?.getSerializable(NotificationsService.EXCEPTION_KEY) as? Exception
|
|
47
|
-
promise.reject("ERR_NOTIFICATION_PRESENTATION_FAILED", "Notification could not be presented.", e)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
28
|
AsyncFunction("getPresentedNotificationsAsync") { promise: Promise ->
|
|
54
29
|
getAllPresented(
|
|
55
30
|
context,
|
|
@@ -99,14 +74,6 @@ open class ExpoNotificationPresentationModule : Module() {
|
|
|
99
74
|
)
|
|
100
75
|
}
|
|
101
76
|
|
|
102
|
-
protected open fun createNotificationRequest(
|
|
103
|
-
identifier: String,
|
|
104
|
-
content: INotificationContent,
|
|
105
|
-
trigger: NotificationTrigger?
|
|
106
|
-
): NotificationRequest {
|
|
107
|
-
return NotificationRequest(identifier, content, null)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
77
|
protected open fun serializeNotifications(notifications: Collection<Notification>): List<Bundle> {
|
|
111
78
|
return notifications.map(NotificationSerializer::toBundle)
|
|
112
79
|
}
|
|
@@ -288,7 +288,7 @@ open class ExpoNotificationBuilder(
|
|
|
288
288
|
val requestPriorityValue =
|
|
289
289
|
requestPriority?.nativeValue ?: NotificationPriority.DEFAULT.nativeValue
|
|
290
290
|
|
|
291
|
-
// TODO (barthap): This is going to be a dead code upon removing presentNotificationAsync()
|
|
291
|
+
// TODO (barthap, vonovak): This is going to be a dead code upon removing presentNotificationAsync()
|
|
292
292
|
// shouldShowAlert() will always be false here.
|
|
293
293
|
return if (notificationBehavior.shouldShowAlert()) {
|
|
294
294
|
// Display as a heads-up notification, as per the behavior
|
|
@@ -49,8 +49,8 @@ open class FirebaseMessagingDelegate(protected val context: Context) : FirebaseM
|
|
|
49
49
|
if (!sTokenListenersReferences.containsKey(listener)) {
|
|
50
50
|
sTokenListenersReferences[listener] = WeakReference(listener)
|
|
51
51
|
// Since it's a new listener and we know of a last valid token, let's let them know.
|
|
52
|
-
|
|
53
|
-
listener.onNewToken(
|
|
52
|
+
sLastToken?.let {
|
|
53
|
+
listener.onNewToken(it)
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
package expo.modules.notifications.tokens
|
|
2
2
|
|
|
3
|
-
import android.os.Bundle
|
|
4
3
|
import com.google.firebase.messaging.FirebaseMessaging
|
|
5
|
-
import expo.modules.core.interfaces.services.EventEmitter
|
|
6
4
|
import expo.modules.kotlin.Promise
|
|
7
5
|
import expo.modules.kotlin.modules.Module
|
|
8
6
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
9
|
-
import expo.modules.notifications.
|
|
10
|
-
import expo.modules.notifications.tokens.interfaces.
|
|
11
|
-
import expo.modules.notifications.tokens.interfaces.PushTokenManager
|
|
7
|
+
import expo.modules.notifications.service.delegates.FirebaseMessagingDelegate.Companion.addTokenListener
|
|
8
|
+
import expo.modules.notifications.tokens.interfaces.FirebaseTokenListener
|
|
12
9
|
|
|
13
10
|
private const val NEW_TOKEN_EVENT_NAME = "onDevicePushToken"
|
|
14
11
|
private const val NEW_TOKEN_EVENT_TOKEN_KEY = "devicePushToken"
|
|
15
12
|
private const val REGISTRATION_FAIL_CODE = "E_REGISTRATION_FAILED"
|
|
16
13
|
private const val UNREGISTER_FOR_NOTIFICATIONS_FAIL_CODE = "E_UNREGISTER_FOR_NOTIFICATIONS_FAILED"
|
|
17
14
|
|
|
18
|
-
class PushTokenModule : Module(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
class PushTokenModule : Module(), FirebaseTokenListener {
|
|
16
|
+
|
|
17
|
+
init {
|
|
18
|
+
addTokenListener(this@PushTokenModule)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Callback called when [FirebaseMessagingDelegate] gets notified of a new token.
|
|
23
|
+
* Emits a [NEW_TOKEN_EVENT_NAME] event.
|
|
24
|
+
*
|
|
25
|
+
* @param token New push token.
|
|
26
|
+
*/
|
|
27
|
+
override fun onNewToken(token: String) {
|
|
28
|
+
sendEvent(
|
|
29
|
+
NEW_TOKEN_EVENT_NAME,
|
|
30
|
+
mapOf(
|
|
31
|
+
NEW_TOKEN_EVENT_TOKEN_KEY to token
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
22
35
|
|
|
23
36
|
override fun definition() = ModuleDefinition {
|
|
24
37
|
Name("ExpoPushTokenManager")
|
|
25
38
|
|
|
26
39
|
Events("onDevicePushToken")
|
|
27
40
|
|
|
28
|
-
OnCreate {
|
|
29
|
-
eventEmitter = appContext.legacyModule()
|
|
30
|
-
?: throw ModuleNotFoundException(EventEmitter::class)
|
|
31
|
-
|
|
32
|
-
// Register the module as a listener in PushTokenManager singleton module.
|
|
33
|
-
// Deregistration happens in onDestroy callback.
|
|
34
|
-
tokenManager?.addListener(this@PushTokenModule)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
OnDestroy {
|
|
38
|
-
tokenManager?.removeListener(this@PushTokenModule)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
41
|
/**
|
|
42
42
|
* Fetches Firebase push token and resolves the promise.
|
|
43
43
|
*
|
|
@@ -88,18 +88,4 @@ class PushTokenModule : Module(), PushTokenListener {
|
|
|
88
88
|
null
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Callback called when [PushTokenManager] gets notified of a new token.
|
|
94
|
-
* Emits a [NEW_TOKEN_EVENT_NAME] event.
|
|
95
|
-
*
|
|
96
|
-
* @param token New push token.
|
|
97
|
-
*/
|
|
98
|
-
override fun onNewToken(token: String) {
|
|
99
|
-
eventEmitter?.let {
|
|
100
|
-
val eventBody = Bundle()
|
|
101
|
-
eventBody.putString(NEW_TOKEN_EVENT_TOKEN_KEY, token)
|
|
102
|
-
it.emit(NEW_TOKEN_EVENT_NAME, eventBody)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
91
|
}
|
package/android/src/main/java/expo/modules/notifications/tokens/interfaces/FirebaseTokenListener.kt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
package expo.modules.notifications.tokens.interfaces
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface used to register in [NotificationsService]
|
|
5
|
+
* and be notified of new device push tokens.
|
|
6
|
+
*/
|
|
7
|
+
interface FirebaseTokenListener {
|
|
8
|
+
/**
|
|
9
|
+
* Callback called when new push token is generated.
|
|
10
|
+
*
|
|
11
|
+
* @param token New push token
|
|
12
|
+
*/
|
|
13
|
+
fun onNewToken(token: String)
|
|
14
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ProxyNativeModule } from 'expo-modules-core';
|
|
2
|
-
import { Notification
|
|
2
|
+
import { Notification } from './Notifications.types';
|
|
3
3
|
export interface NotificationPresenterModule extends ProxyNativeModule {
|
|
4
4
|
getPresentedNotificationsAsync?: () => Promise<Notification[]>;
|
|
5
|
-
presentNotificationAsync?: (identifier: string, content: NotificationContentInput) => Promise<string>;
|
|
6
5
|
dismissNotificationAsync?: (identifier: string) => Promise<void>;
|
|
7
6
|
dismissAllNotificationsAsync?: () => Promise<void>;
|
|
8
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPresenterModule.types.d.ts","sourceRoot":"","sources":["../src/NotificationPresenterModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"NotificationPresenterModule.types.d.ts","sourceRoot":"","sources":["../src/NotificationPresenterModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,8BAA8B,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC/D,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,4BAA4B,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPresenterModule.types.js","sourceRoot":"","sources":["../src/NotificationPresenterModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport { Notification
|
|
1
|
+
{"version":3,"file":"NotificationPresenterModule.types.js","sourceRoot":"","sources":["../src/NotificationPresenterModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ProxyNativeModule } from 'expo-modules-core';\n\nimport { Notification } from './Notifications.types';\n\nexport interface NotificationPresenterModule extends ProxyNativeModule {\n getPresentedNotificationsAsync?: () => Promise<Notification[]>;\n dismissNotificationAsync?: (identifier: string) => Promise<void>;\n dismissAllNotificationsAsync?: () => Promise<void>;\n}\n"]}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { ProxyNativeModule } from 'expo-modules-core';
|
|
2
2
|
import { NotificationRequest, NotificationContentInput } from './Notifications.types';
|
|
3
|
-
type CalendarTriggerInputValue = {
|
|
4
|
-
timezone?: string;
|
|
5
|
-
year?: number;
|
|
6
|
-
month?: number;
|
|
7
|
-
weekday?: number;
|
|
8
|
-
weekOfMonth?: number;
|
|
9
|
-
weekOfYear?: number;
|
|
10
|
-
weekdayOrdinal?: number;
|
|
11
|
-
day?: number;
|
|
12
|
-
hour?: number;
|
|
13
|
-
minute?: number;
|
|
14
|
-
second?: number;
|
|
15
|
-
};
|
|
16
3
|
export interface NotificationSchedulerModule extends ProxyNativeModule {
|
|
17
4
|
getAllScheduledNotificationsAsync?: () => Promise<NotificationRequest[]>;
|
|
18
5
|
scheduleNotificationAsync?: (identifier: string, notificationContent: NotificationContentInput, trigger: NativeNotificationTriggerInput) => Promise<string>;
|
|
@@ -28,7 +15,17 @@ export interface NativeCalendarTriggerInput {
|
|
|
28
15
|
type: 'calendar';
|
|
29
16
|
channelId?: string;
|
|
30
17
|
repeats?: boolean;
|
|
31
|
-
|
|
18
|
+
timezone?: string;
|
|
19
|
+
year?: number;
|
|
20
|
+
month?: number;
|
|
21
|
+
weekday?: number;
|
|
22
|
+
weekOfMonth?: number;
|
|
23
|
+
weekOfYear?: number;
|
|
24
|
+
weekdayOrdinal?: number;
|
|
25
|
+
day?: number;
|
|
26
|
+
hour?: number;
|
|
27
|
+
minute?: number;
|
|
28
|
+
second?: number;
|
|
32
29
|
}
|
|
33
30
|
export interface NativeTimeIntervalTriggerInput {
|
|
34
31
|
type: 'timeInterval';
|
|
@@ -70,5 +67,4 @@ export interface NativeDateTriggerInput {
|
|
|
70
67
|
timestamp: number;
|
|
71
68
|
}
|
|
72
69
|
export type NativeNotificationTriggerInput = null | NativeChannelAwareTriggerInput | NativeDateTriggerInput | NativeCalendarTriggerInput | NativeTimeIntervalTriggerInput | NativeDailyTriggerInput | NativeWeeklyTriggerInput | NativeMonthlyTriggerInput | NativeYearlyTriggerInput;
|
|
73
|
-
export {};
|
|
74
70
|
//# sourceMappingURL=NotificationScheduler.types.d.ts.map
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"NotificationScheduler.types.d.ts","sourceRoot":"","sources":["../src/NotificationScheduler.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -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\
|
|
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: NativeNotificationTriggerInput\n ) => Promise<string>;\n cancelScheduledNotificationAsync?: (identifier: string) => Promise<void>;\n cancelAllScheduledNotificationsAsync?: () => Promise<void>;\n getNextTriggerDateAsync?: (trigger: NativeNotificationTriggerInput) => Promise<number>;\n}\n\nexport interface NativeChannelAwareTriggerInput {\n type: 'channel';\n channelId?: string;\n}\n\n// ISO8601 calendar pattern-matching\nexport interface NativeCalendarTriggerInput {\n type: 'calendar';\n channelId?: string;\n repeats?: boolean;\n timezone?: string;\n year?: number;\n month?: number;\n weekday?: number;\n weekOfMonth?: number;\n weekOfYear?: number;\n weekdayOrdinal?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n}\n\nexport interface NativeTimeIntervalTriggerInput {\n type: 'timeInterval';\n channelId?: string;\n repeats: boolean;\n seconds: number;\n}\n\nexport interface NativeDailyTriggerInput {\n type: 'daily';\n channelId?: string;\n hour: number;\n minute: number;\n}\n\nexport interface NativeWeeklyTriggerInput {\n type: 'weekly';\n channelId?: string;\n weekday: number;\n hour: number;\n minute: number;\n}\n\nexport interface NativeYearlyTriggerInput {\n type: 'yearly';\n channelId?: string;\n day: number;\n month: number;\n hour: number;\n minute: number;\n}\n\nexport interface NativeMonthlyTriggerInput {\n type: 'monthly';\n channelId?: string;\n day: number;\n hour: number;\n minute: number;\n}\n\nexport interface NativeDateTriggerInput {\n type: 'date';\n channelId?: string;\n timestamp: number; // seconds since 1970\n}\n\nexport type NativeNotificationTriggerInput =\n | null\n | NativeChannelAwareTriggerInput\n | NativeDateTriggerInput\n | NativeCalendarTriggerInput\n | NativeTimeIntervalTriggerInput\n | NativeDailyTriggerInput\n | NativeWeeklyTriggerInput\n | NativeMonthlyTriggerInput\n | NativeYearlyTriggerInput;\n"]}
|
|
@@ -487,7 +487,7 @@ export interface NotificationRequest {
|
|
|
487
487
|
trigger: NotificationTrigger;
|
|
488
488
|
}
|
|
489
489
|
/**
|
|
490
|
-
* An object which represents notification content that you pass in
|
|
490
|
+
* An object which represents notification content that you pass in as a part of `NotificationRequestInput`.
|
|
491
491
|
*/
|
|
492
492
|
export type NotificationContentInput = {
|
|
493
493
|
/**
|