expo-notifications 0.28.15 → 1.0.0-canary-20240814-ce0f7d5
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 +15 -13
- package/README.md +1 -3
- package/android/build.gradle +2 -2
- package/build/NotificationPermissions.d.ts +0 -1
- package/build/NotificationPermissions.d.ts.map +1 -1
- package/build/NotificationPermissions.js +0 -1
- package/build/NotificationPermissions.js.map +1 -1
- package/build/NotificationPermissions.types.d.ts +0 -5
- package/build/NotificationPermissions.types.d.ts.map +1 -1
- package/build/NotificationPermissions.types.js.map +1 -1
- package/build/Notifications.types.d.ts +3 -4
- package/build/Notifications.types.d.ts.map +1 -1
- package/build/Notifications.types.js.map +1 -1
- package/build/NotificationsEmitter.d.ts +5 -5
- package/build/NotificationsEmitter.d.ts.map +1 -1
- package/build/NotificationsEmitter.js +3 -3
- package/build/NotificationsEmitter.js.map +1 -1
- package/build/NotificationsHandler.d.ts.map +1 -1
- package/build/NotificationsHandler.js +2 -2
- package/build/NotificationsHandler.js.map +1 -1
- package/build/TokenEmitter.d.ts +3 -3
- package/build/TokenEmitter.d.ts.map +1 -1
- package/build/TokenEmitter.js +3 -3
- package/build/TokenEmitter.js.map +1 -1
- package/build/Tokens.types.d.ts +10 -13
- package/build/Tokens.types.d.ts.map +1 -1
- package/build/Tokens.types.js.map +1 -1
- package/build/getDevicePushTokenAsync.web.d.ts.map +1 -1
- package/build/getDevicePushTokenAsync.web.js +2 -1
- package/build/getDevicePushTokenAsync.web.js.map +1 -1
- package/build/getExpoPushTokenAsync.d.ts.map +1 -1
- package/build/getExpoPushTokenAsync.js +2 -5
- package/build/getExpoPushTokenAsync.js.map +1 -1
- package/build/setBadgeCountAsync.d.ts +1 -1
- package/build/setBadgeCountAsync.js +1 -1
- package/build/setBadgeCountAsync.js.map +1 -1
- package/build/setNotificationCategoryAsync.d.ts +2 -3
- package/build/setNotificationCategoryAsync.d.ts.map +1 -1
- package/build/setNotificationCategoryAsync.js +2 -3
- package/build/setNotificationCategoryAsync.js.map +1 -1
- package/ios/EXNotifications/Building/EXNotificationBuilder.m +4 -10
- package/ios/EXNotifications/Notifications/Categories/EXNotificationCategoriesModule.m +15 -43
- package/ios/EXNotifications/Notifications/EXNotificationCenterDelegate.m +4 -6
- package/ios/EXNotifications/Notifications/EXNotificationSerializer.m +11 -24
- package/ios/EXNotifications/Permissions/EXUserFacingNotificationsPermissionsRequester.m +10 -26
- package/ios/EXNotifications.podspec +3 -1
- package/package.json +12 -9
- package/src/NotificationPermissions.ts +0 -1
- package/src/NotificationPermissions.types.ts +0 -5
- package/src/Notifications.types.ts +10 -6
- package/src/NotificationsEmitter.ts +7 -7
- package/src/NotificationsHandler.ts +9 -4
- package/src/TokenEmitter.ts +5 -5
- package/src/Tokens.types.ts +10 -13
- package/src/getDevicePushTokenAsync.web.ts +2 -1
- package/src/getExpoPushTokenAsync.ts +2 -8
- package/src/setBadgeCountAsync.ts +1 -1
- package/src/setNotificationCategoryAsync.ts +2 -3
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,55 +4,55 @@
|
|
|
4
4
|
|
|
5
5
|
### 🛠 Breaking changes
|
|
6
6
|
|
|
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))
|
|
8
|
+
|
|
7
9
|
### 🎉 New features
|
|
8
10
|
|
|
9
11
|
### 🐛 Bug fixes
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## 0.28.15 — 2024-08-05
|
|
13
|
+
- 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))
|
|
14
|
+
- [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))
|
|
14
15
|
|
|
15
|
-
###
|
|
16
|
+
### 💡 Others
|
|
16
17
|
|
|
17
|
-
-
|
|
18
|
+
- 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))
|
|
18
19
|
|
|
19
|
-
## 0.28.14
|
|
20
|
+
## 0.28.14 - 2024-07-30
|
|
20
21
|
|
|
21
22
|
### 🐛 Bug fixes
|
|
22
23
|
|
|
23
24
|
- `useLastNotificationResponse` should have only one effect. ([#30653](https://github.com/expo/expo/pull/30653) by [@douglowder](https://github.com/douglowder))
|
|
24
25
|
|
|
25
|
-
## 0.28.13
|
|
26
|
+
## 0.28.13 - 2024-07-29
|
|
26
27
|
|
|
27
28
|
### 🐛 Bug fixes
|
|
28
29
|
|
|
29
30
|
- [Android] map Expo and Firebase notifications correctly. ([#30615](https://github.com/expo/expo/pull/30615) by [@douglowder](https://github.com/douglowder))
|
|
30
|
-
- [Android] Apply requested changes from #30615. ([#30658](https://github.com/expo/expo/pull/30615) by [@lukmccall](https://github.com/lukmccall))
|
|
31
31
|
|
|
32
|
-
## 0.28.12
|
|
32
|
+
## 0.28.12 - 2024-07-25
|
|
33
33
|
|
|
34
34
|
### 🐛 Bug fixes
|
|
35
35
|
|
|
36
36
|
- [Android] Android 11 crash when click foreground notifications. ([#30207](https://github.com/expo/expo/pull/30207) by [@GrinZero](https://github.com/GrinZero))
|
|
37
37
|
- 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))
|
|
38
38
|
|
|
39
|
-
## 0.28.11
|
|
39
|
+
## 0.28.11 - 2024-07-22
|
|
40
40
|
|
|
41
41
|
### 🐛 Bug fixes
|
|
42
42
|
|
|
43
43
|
- [Android] Fix serialization of vibration pattern. ([#30495](https://github.com/expo/expo/pull/30495) by [@douglowder](https://github.com/douglowder))
|
|
44
44
|
|
|
45
|
-
## 0.28.10
|
|
45
|
+
## 0.28.10 - 2024-07-15
|
|
46
46
|
|
|
47
47
|
### 🐛 Bug fixes
|
|
48
48
|
|
|
49
49
|
- [Android] fix getLastNotificationResponseAsync. ([#30301](https://github.com/expo/expo/pull/30301) by [@douglowder](https://github.com/douglowder))
|
|
50
50
|
|
|
51
|
-
## 0.28.9
|
|
51
|
+
## 0.28.9 - 2024-06-12
|
|
52
52
|
|
|
53
53
|
_This version does not introduce any user-facing changes._
|
|
54
54
|
|
|
55
|
-
## 0.28.8
|
|
55
|
+
## 0.28.8 - 2024-06-10
|
|
56
56
|
|
|
57
57
|
### 🐛 Bug fixes
|
|
58
58
|
|
|
@@ -82,6 +82,8 @@ _This version does not introduce any user-facing changes._
|
|
|
82
82
|
|
|
83
83
|
- [Android] Correctly map response in useLastNotificationResponse hook. ([#28938](https://github.com/expo/expo/pull/28938) by [@douglowder](https://github.com/douglowder))
|
|
84
84
|
|
|
85
|
+
## 0.28.3 — 2024-05-16
|
|
86
|
+
|
|
85
87
|
### 💡 Others
|
|
86
88
|
|
|
87
89
|
- [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/
|
|
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
|
}
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '0.28.
|
|
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,7 +14,7 @@ android {
|
|
|
14
14
|
namespace "expo.modules.notifications"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 21
|
|
17
|
-
versionName '0.28.
|
|
17
|
+
versionName '0.28.3'
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
buildFeatures {
|
|
@@ -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
|
|
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"}
|
|
@@ -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
|
|
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;
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPermissions.types.js","sourceRoot":"","sources":["../src/NotificationPermissions.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,mDAAS,CAAA;AACX,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,2DAAS,CAAA;IACT,6DAAU,CAAA;IACV,qFAAsB,CAAA;AACxB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,uFAAkB,CAAA;IAClB,uEAAU,CAAA;IACV,+EAAc,CAAA;IACd,iFAAe,CAAA;IACf,6EAAa,CAAA;AACf,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC","sourcesContent":["import { PermissionResponse, PermissionHookOptions } from 'expo-modules-core';\n\nexport enum IosAlertStyle {\n NONE = 0,\n BANNER = 1,\n ALERT = 2,\n}\n\nexport enum IosAllowsPreviews {\n NEVER = 0,\n ALWAYS = 1,\n WHEN_AUTHENTICATED = 2,\n}\n\nexport enum IosAuthorizationStatus {\n NOT_DETERMINED = 0,\n DENIED = 1,\n AUTHORIZED = 2,\n PROVISIONAL = 3,\n EPHEMERAL = 4,\n}\n\nexport { PermissionHookOptions };\n\n// @docsMissing\nexport interface NotificationPermissionsStatus extends PermissionResponse {\n android?: {\n importance: number;\n interruptionFilter?: number;\n };\n ios?: {\n status: IosAuthorizationStatus;\n allowsDisplayInNotificationCenter: boolean | null;\n allowsDisplayOnLockScreen: boolean | null;\n allowsDisplayInCarPlay: boolean | null;\n allowsAlert: boolean | null;\n allowsBadge: boolean | null;\n allowsSound: boolean | null;\n allowsCriticalAlerts?: boolean | null;\n alertStyle: IosAlertStyle;\n allowsPreviews?: IosAllowsPreviews;\n providesAppNotificationSettings?: boolean;\n allowsAnnouncements?: boolean | null;\n };\n}\n\n/**\n * Available configuration for permission request on iOS platform.\n * See Apple documentation for [`UNAuthorizationOptions`](https://developer.apple.com/documentation/usernotifications/unauthorizationoptions) to learn more.\n */\nexport interface IosNotificationPermissionsRequest {\n /**\n * The ability to display alerts.\n */\n allowAlert?: boolean;\n /**\n * The ability to update the app’s badge.\n */\n allowBadge?: boolean;\n /**\n * The ability to play sounds.\n */\n allowSound?: boolean;\n /**\n * The ability to display notifications in a CarPlay environment.\n */\n allowDisplayInCarPlay?: boolean;\n /**\n * The ability to play sounds for critical alerts.\n */\n allowCriticalAlerts?: boolean;\n /**\n * An option indicating the system should display a button for in-app notification settings.\n */\n provideAppNotificationSettings?: boolean;\n /**\n * The ability to post noninterrupting notifications provisionally to the Notification Center.\n */\n allowProvisional?: boolean;\n
|
|
1
|
+
{"version":3,"file":"NotificationPermissions.types.js","sourceRoot":"","sources":["../src/NotificationPermissions.types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,mDAAS,CAAA;AACX,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,2DAAS,CAAA;IACT,6DAAU,CAAA;IACV,qFAAsB,CAAA;AACxB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,uFAAkB,CAAA;IAClB,uEAAU,CAAA;IACV,+EAAc,CAAA;IACd,iFAAe,CAAA;IACf,6EAAa,CAAA;AACf,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC","sourcesContent":["import { PermissionResponse, PermissionHookOptions } from 'expo-modules-core';\n\nexport enum IosAlertStyle {\n NONE = 0,\n BANNER = 1,\n ALERT = 2,\n}\n\nexport enum IosAllowsPreviews {\n NEVER = 0,\n ALWAYS = 1,\n WHEN_AUTHENTICATED = 2,\n}\n\nexport enum IosAuthorizationStatus {\n NOT_DETERMINED = 0,\n DENIED = 1,\n AUTHORIZED = 2,\n PROVISIONAL = 3,\n EPHEMERAL = 4,\n}\n\nexport { PermissionHookOptions };\n\n// @docsMissing\nexport interface NotificationPermissionsStatus extends PermissionResponse {\n android?: {\n importance: number;\n interruptionFilter?: number;\n };\n ios?: {\n status: IosAuthorizationStatus;\n allowsDisplayInNotificationCenter: boolean | null;\n allowsDisplayOnLockScreen: boolean | null;\n allowsDisplayInCarPlay: boolean | null;\n allowsAlert: boolean | null;\n allowsBadge: boolean | null;\n allowsSound: boolean | null;\n allowsCriticalAlerts?: boolean | null;\n alertStyle: IosAlertStyle;\n allowsPreviews?: IosAllowsPreviews;\n providesAppNotificationSettings?: boolean;\n allowsAnnouncements?: boolean | null;\n };\n}\n\n/**\n * Available configuration for permission request on iOS platform.\n * See Apple documentation for [`UNAuthorizationOptions`](https://developer.apple.com/documentation/usernotifications/unauthorizationoptions) to learn more.\n */\nexport interface IosNotificationPermissionsRequest {\n /**\n * The ability to display alerts.\n */\n allowAlert?: boolean;\n /**\n * The ability to update the app’s badge.\n */\n allowBadge?: boolean;\n /**\n * The ability to play sounds.\n */\n allowSound?: boolean;\n /**\n * The ability to display notifications in a CarPlay environment.\n */\n allowDisplayInCarPlay?: boolean;\n /**\n * The ability to play sounds for critical alerts.\n */\n allowCriticalAlerts?: boolean;\n /**\n * An option indicating the system should display a button for in-app notification settings.\n */\n provideAppNotificationSettings?: boolean;\n /**\n * The ability to post noninterrupting notifications provisionally to the Notification Center.\n */\n allowProvisional?: boolean;\n}\n\nexport type NativeNotificationPermissionsRequest = IosNotificationPermissionsRequest | object;\n\n/**\n * An interface representing the permissions request scope configuration.\n * Each option corresponds to a different native platform authorization option.\n */\nexport interface NotificationPermissionsRequest {\n /**\n * Available configuration for permission request on iOS platform.\n */\n ios?: IosNotificationPermissionsRequest;\n /**\n * On Android, all available permissions are granted by default, and if a user declines any permission, an app cannot prompt the user to change.\n */\n android?: object;\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { PermissionExpiration, PermissionResponse, PermissionStatus,
|
|
1
|
+
import type { PermissionExpiration, PermissionResponse, PermissionStatus, EventSubscription } from 'expo-modules-core';
|
|
2
2
|
/**
|
|
3
3
|
* An object represents a notification delivered by a push notification system.
|
|
4
4
|
*
|
|
5
5
|
* On Android under `remoteMessage` field a JS version of the Firebase `RemoteMessage` may be accessed.
|
|
6
|
-
* On iOS under `payload` you may find full contents of [`UNNotificationContent`'s](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) [`userInfo`](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649869-userinfo?language=objc), for example [remote notification payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
|
|
7
|
-
* On web there is no extra data.
|
|
6
|
+
* On iOS under `payload` you may find full contents of [`UNNotificationContent`'s](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) [`userInfo`](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649869-userinfo?language=objc), for example [remote notification payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html).
|
|
8
7
|
*/
|
|
9
8
|
export type PushNotificationTrigger = {
|
|
10
9
|
type: 'push';
|
|
@@ -639,5 +638,5 @@ export type NotificationCategoryOptions = {
|
|
|
639
638
|
*/
|
|
640
639
|
allowAnnouncement?: boolean;
|
|
641
640
|
};
|
|
642
|
-
export type { Subscription, PermissionResponse, PermissionStatus, PermissionExpiration };
|
|
641
|
+
export type { EventSubscription as Subscription, PermissionResponse, PermissionStatus, PermissionExpiration, };
|
|
643
642
|
//# sourceMappingURL=Notifications.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.types.d.ts","sourceRoot":"","sources":["../src/Notifications.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"Notifications.types.d.ts","sourceRoot":"","sources":["../src/Notifications.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;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;;WAGG;QACH,iBAAiB,EAAE,MAAM,CAAC;QAC1B;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF;;OAEG;IACH,OAAO,CAAC,EAAE;QACR;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC;;;;;WAKG;QACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAGD,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,YAAY,EACV,iBAAiB,IAAI,YAAY,EACjC,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,GACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.types.js","sourceRoot":"","sources":["../src/Notifications.types.ts"],"names":[],"mappings":"AAgWA;;GAEG;AACH,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACrC,0CAAW,CAAA;IACX,0CAAW,CAAA;IACX,kDAAmB,CAAA;IACnB,4CAAa,CAAA;IACb,0CAAW,CAAA;AACb,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC","sourcesContent":["import type {\n PermissionExpiration,\n PermissionResponse,\n PermissionStatus,\n Subscription,\n} from 'expo-modules-core';\n\n/**\n * An object represents a notification delivered by a push notification system.\n *\n * On Android under `remoteMessage` field a JS version of the Firebase `RemoteMessage` may be accessed.\n * On iOS under `payload` you may find full contents of [`UNNotificationContent`'s](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) [`userInfo`](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649869-userinfo?language=objc), for example [remote notification payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)\n * On web there is no extra data.\n */\nexport type PushNotificationTrigger = {\n type: 'push';\n /**\n * @platform ios\n */\n payload?: Record<string, unknown>;\n /**\n * @platform android\n */\n remoteMessage?: FirebaseRemoteMessage;\n};\n\n/**\n * A trigger related to a [`UNCalendarNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/uncalendarnotificationtrigger?language=objc).\n * @platform ios\n */\nexport interface CalendarNotificationTrigger {\n type: 'calendar';\n repeats: boolean;\n dateComponents: {\n era?: number;\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n weekday?: number;\n weekdayOrdinal?: number;\n quarter?: number;\n weekOfMonth?: number;\n weekOfYear?: number;\n yearForWeekOfYear?: number;\n nanosecond?: number;\n isLeapMonth: boolean;\n timeZone?: string;\n calendar?: string;\n };\n}\n\n/**\n * The region used to determine when the system sends the notification.\n * @platform ios\n */\nexport interface Region {\n type: string;\n /**\n * The identifier for the region object.\n */\n identifier: string;\n /**\n * A Boolean indicating that notifications are generated upon entry into the region.\n */\n notifyOnEntry: boolean;\n /**\n * A Boolean indicating that notifications are generated upon exit from the region.\n */\n notifyOnExit: boolean;\n}\n\n/**\n * A circular geographic region, specified as a center point and radius. Based on Core Location [`CLCircularRegion`](https://developer.apple.com/documentation/corelocation/clcircularregion) class.\n * @platform ios\n */\nexport interface CircularRegion extends Region {\n type: 'circular';\n /**\n * The radius (measured in meters) that defines the geographic area’s outer boundary.\n */\n radius: number;\n /**\n * The center point of the geographic area.\n */\n center: {\n latitude: number;\n longitude: number;\n };\n}\n\n/**\n * A region used to detect the presence of iBeacon devices. Based on Core Location [`CLBeaconRegion`](https://developer.apple.com/documentation/corelocation/clbeaconregion) class.\n * @platform ios\n */\nexport interface BeaconRegion extends Region {\n type: 'beacon';\n /**\n * A Boolean value that indicates whether Core Location sends beacon notifications when the device’s display is on.\n */\n notifyEntryStateOnDisplay: boolean;\n /**\n * The major value from the beacon identity constraint that defines the beacon region.\n */\n major: number | null;\n /**\n * The minor value from the beacon identity constraint that defines the beacon region.\n */\n minor: number | null;\n /**\n * The UUID value from the beacon identity constraint that defines the beacon region.\n */\n uuid?: string;\n /**\n * The beacon identity constraint that defines the beacon region.\n */\n beaconIdentityConstraint?: {\n uuid: string;\n major: number | null;\n minor: number | null;\n };\n}\n\n/**\n * A trigger related to a [`UNLocationNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/unlocationnotificationtrigger?language=objc).\n * @platform ios\n */\nexport interface LocationNotificationTrigger {\n type: 'location';\n repeats: boolean;\n region: CircularRegion | BeaconRegion;\n}\n\n/**\n * A trigger related to an elapsed time interval. May be repeating (see `repeats` field).\n */\nexport interface TimeIntervalNotificationTrigger {\n type: 'timeInterval';\n repeats: boolean;\n seconds: number;\n}\n\n/**\n * A trigger related to a daily notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface DailyNotificationTrigger {\n type: 'daily';\n hour: number;\n minute: number;\n}\n\n/**\n * A trigger related to a weekly notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface WeeklyNotificationTrigger {\n type: 'weekly';\n weekday: number;\n hour: number;\n minute: number;\n}\n\n/**\n * A trigger related to a yearly notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface YearlyNotificationTrigger {\n type: 'yearly';\n day: number;\n month: number;\n hour: number;\n minute: number;\n}\n\n// @docsMissing\n/**\n * A Firebase `RemoteMessage` that caused the notification to be delivered to the app.\n */\nexport interface FirebaseRemoteMessage {\n collapseKey: string | null;\n data: Record<string, string>;\n from: string | null;\n messageId: string | null;\n messageType: string | null;\n originalPriority: number;\n priority: number;\n sentTime: number;\n to: string | null;\n ttl: number;\n notification: null | FirebaseRemoteMessageNotification;\n}\n\n// @docsMissing\nexport interface FirebaseRemoteMessageNotification {\n body: string | null;\n bodyLocalizationArgs: string[] | null;\n bodyLocalizationKey: string | null;\n channelId: string | null;\n clickAction: string | null;\n color: string | null;\n usesDefaultLightSettings: boolean;\n usesDefaultSound: boolean;\n usesDefaultVibrateSettings: boolean;\n eventTime: number | null;\n icon: string | null;\n imageUrl: string | null;\n lightSettings: number[] | null;\n link: string | null;\n localOnly: boolean;\n notificationCount: number | null;\n notificationPriority: number | null;\n sound: string | null;\n sticky: boolean;\n tag: string | null;\n ticker: string | null;\n title: string | null;\n titleLocalizationArgs: string[] | null;\n titleLocalizationKey: string | null;\n vibrateTimings: number[] | null;\n visibility: number | null;\n}\n\n/**\n * Represents a notification trigger that is unknown to `expo-notifications` and that it didn't know how to serialize for JS.\n */\nexport interface UnknownNotificationTrigger {\n type: 'unknown';\n}\n\n/**\n * A union type containing different triggers which may cause the notification to be delivered to the application.\n */\nexport type NotificationTrigger =\n | PushNotificationTrigger\n | CalendarNotificationTrigger\n | LocationNotificationTrigger\n | TimeIntervalNotificationTrigger\n | DailyNotificationTrigger\n | WeeklyNotificationTrigger\n | YearlyNotificationTrigger\n | UnknownNotificationTrigger;\n\n/**\n * A trigger that will cause the notification to be delivered immediately.\n */\nexport type ChannelAwareTriggerInput = {\n channelId: string;\n};\n\n// @docsMissing\nexport type CalendarTriggerInputValue = {\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\n/**\n * A trigger that will cause the notification to be delivered once or many times when the date components match the specified values.\n * Corresponds to native [`UNCalendarNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/uncalendarnotificationtrigger?language=objc).\n * @platform ios\n */\nexport type CalendarTriggerInput = CalendarTriggerInputValue & {\n channelId?: string;\n repeats?: boolean;\n};\n\n/**\n * A trigger that will cause the notification to be delivered once or many times (depends on the `repeats` field) after `seconds` time elapse.\n * > **On iOS**, when `repeats` is `true`, the time interval must be 60 seconds or greater. Otherwise, the notification won't be triggered.\n */\nexport interface TimeIntervalTriggerInput {\n channelId?: string;\n repeats?: boolean;\n seconds: number;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once per day.\n */\nexport interface DailyTriggerInput {\n channelId?: string;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once every week.\n * > **Note:** Weekdays are specified with a number from `1` through `7`, with `1` indicating Sunday.\n */\nexport interface WeeklyTriggerInput {\n channelId?: string;\n weekday: number;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once every year.\n * > **Note:** all properties are specified in JavaScript Date's ranges.\n */\nexport interface YearlyTriggerInput {\n channelId?: string;\n day: number;\n month: number;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once at the specified `Date`.\n * If you pass in a `number` it will be interpreted as a Unix timestamp.\n */\nexport type DateTriggerInput = Date | number | { channelId?: string; date: Date | number };\n\n/**\n * A type represents time-based, schedulable triggers. For these triggers you can check the next trigger date\n * with [`getNextTriggerDateAsync`](#notificationsgetnexttriggerdateasynctrigger).\n */\nexport type SchedulableNotificationTriggerInput =\n | DateTriggerInput\n | TimeIntervalTriggerInput\n | DailyTriggerInput\n | WeeklyTriggerInput\n | YearlyTriggerInput\n | CalendarTriggerInput;\n\n/**\n * A type represents possible triggers with which you can schedule notifications.\n * A `null` trigger means that the notification should be scheduled for delivery immediately.\n */\nexport type NotificationTriggerInput =\n | null\n | ChannelAwareTriggerInput\n | SchedulableNotificationTriggerInput;\n\n/**\n * An enum corresponding to values appropriate for Android's [`Notification#priority`](https://developer.android.com/reference/android/app/Notification#priority) field.\n */\nexport enum AndroidNotificationPriority {\n MIN = 'min',\n LOW = 'low',\n DEFAULT = 'default',\n HIGH = 'high',\n MAX = 'max',\n}\n\n/**\n * An object represents notification's content.\n */\nexport type NotificationContent = {\n /**\n * Notification title - the bold text displayed above the rest of the content.\n */\n title: string | null;\n /**\n * On Android: `subText` - the display depends on the device.\n *\n * On iOS: `subtitle` - the bold text displayed between title and the rest of the content.\n */\n subtitle: string | null;\n /**\n * Notification body - the main content of the notification.\n */\n body: string | null;\n /**\n * Data associated with the notification, not displayed\n */\n data: Record<string, any>;\n // @docsMissing\n sound: 'default' | 'defaultCritical' | 'custom' | null;\n} & (NotificationContentIos | NotificationContentAndroid);\n\n/**\n * See [Apple documentation](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) for more information on specific fields.\n */\nexport type NotificationContentIos = {\n /**\n * The name of the image or storyboard to use when your app launches because of the notification.\n */\n launchImageName: string | null;\n /**\n * The number that your app’s icon displays.\n */\n badge: number | null;\n /**\n * The visual and audio attachments to display alongside the notification’s main content.\n */\n attachments: NotificationContentAttachmentIos[];\n /**\n * The text the system adds to the notification summary to provide additional context.\n */\n summaryArgument?: string | null;\n /**\n * The number the system adds to the notification summary when the notification represents multiple items.\n */\n summaryArgumentCount?: number;\n /**\n * The identifier of the notification’s category.\n */\n categoryIdentifier: string | null;\n /**\n * The identifier that groups related notifications.\n */\n threadIdentifier: string | null;\n /**\n * The value your app uses to determine which scene to display to handle the notification.\n */\n targetContentIdentifier?: string;\n /*\n * The notification’s importance and required delivery timing.\n * Posible values:\n * - 'passive' - the system adds the notification to the notification list without lighting up the screen or playing a sound\n * - 'active' - the system presents the notification immediately, lights up the screen, and can play a sound\n * - 'timeSensitive' - The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls\n * - 'critical - the system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound\n * @platform ios 15+\n */\n interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical';\n};\n\n// @docsMissing\n/**\n * @platform ios\n */\nexport type NotificationContentAttachmentIos = {\n identifier: string | null;\n url: string | null;\n type: string | null;\n typeHint?: string;\n hideThumbnail?: boolean;\n thumbnailClipArea?: { x: number; y: number; width: number; height: number };\n thumbnailTime?: number;\n};\n\n/**\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification#fields) for more information on specific fields.\n */\nexport type NotificationContentAndroid = {\n /**\n * Application badge number associated with the notification.\n */\n badge?: number;\n /**\n * Accent color (in `#AARRGGBB` or `#RRGGBB` format) to be applied by the standard Style templates when presenting this notification.\n */\n color?: string;\n /**\n * Relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification.\n * Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification.\n * The system will make a determination about how to interpret this priority when presenting the notification.\n */\n priority?: AndroidNotificationPriority;\n /**\n * The pattern with which to vibrate.\n */\n vibrationPattern?: number[];\n};\n\n/**\n * An object represents a request to present a notification. It has content — how it's being represented, and a trigger — what triggers the notification.\n * Many notifications ([`Notification`](#notification)) may be triggered with the same request (for example, a repeating notification).\n */\nexport interface NotificationRequest {\n identifier: string;\n content: NotificationContent;\n trigger: NotificationTrigger;\n}\n\n// TODO(simek): asses if we can base this type on `NotificationContent`, since most of the fields looks like repetition\n/**\n * An object represents notification content that you pass in to `presentNotificationAsync` or as a part of `NotificationRequestInput`.\n */\nexport type NotificationContentInput = {\n /**\n * Notification title - the bold text displayed above the rest of the content.\n */\n title?: string | null;\n /**\n * On Android: `subText` - the display depends on the device.\n *\n * On iOS: `subtitle` - the bold text displayed between title and the rest of the content.\n */\n subtitle?: string | null;\n /**\n * The main content of the notification.\n */\n body?: string | null;\n /**\n * Data associated with the notification, not displayed.\n */\n data?: Record<string, any>;\n /**\n * Application badge number associated with the notification.\n */\n badge?: number;\n sound?: boolean | string;\n /**\n * The name of the image or storyboard to use when your app launches because of the notification.\n */\n launchImageName?: string;\n /**\n * The pattern with which to vibrate.\n * @platform android\n */\n vibrate?: number[];\n /**\n * Relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification.\n * Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification.\n * The system will make a determination about how to interpret this priority when presenting the notification.\n * @platform android\n */\n priority?: string;\n /**\n * Accent color (in `#AARRGGBB` or `#RRGGBB` format) to be applied by the standard Style templates when presenting this notification.\n * @platform android\n */\n color?: string;\n /**\n * If set to `false`, the notification will not be automatically dismissed when clicked.\n * The setting will be used when the value is not provided or is invalid is set to `true`, and the notification\n * will be dismissed automatically anyway. Corresponds directly to Android's `setAutoCancel` behavior.\n *\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification.Builder#setAutoCancel(boolean))\n * for more details.\n * @platform android\n */\n autoDismiss?: boolean;\n /**\n * The identifier of the notification’s category.\n * @platform ios\n */\n categoryIdentifier?: string;\n /**\n * If set to `true`, the notification cannot be dismissed by swipe. This setting defaults\n * to `false` if not provided or is invalid. Corresponds directly do Android's `isOngoing` behavior.\n * In Firebase terms this property of a notification is called `sticky`.\n *\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification.Builder#setOngoing(boolean))\n * and [Firebase documentation](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidNotification.FIELDS.sticky)\n * for more details.\n * @platform android\n */\n sticky?: boolean;\n /**\n * The visual and audio attachments to display alongside the notification’s main content.\n * @platform ios\n */\n attachments?: NotificationContentAttachmentIos[];\n /*\n * The notification’s importance and required delivery timing.\n * Posible values:\n * - 'passive' - the system adds the notification to the notification list without lighting up the screen or playing a sound\n * - 'active' - the system presents the notification immediately, lights up the screen, and can play a sound\n * - 'timeSensitive' - The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls\n * - 'critical - the system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound\n * @platform ios 15+\n */\n interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical';\n};\n\n/**\n * An object represents a notification request you can pass into `scheduleNotificationAsync`.\n */\nexport interface NotificationRequestInput {\n identifier?: string;\n content: NotificationContentInput;\n trigger: NotificationTriggerInput;\n}\n\n/**\n * An object represents a single notification that has been triggered by some request ([`NotificationRequest`](#notificationrequest)) at some point in time.\n */\nexport interface Notification {\n date: number;\n request: NotificationRequest;\n}\n\n/**\n * An object represents user's interaction with the notification.\n * > **Note:** If the user taps on a notification `actionIdentifier` will be equal to [`Notifications.DEFAULT_ACTION_IDENTIFIER`](#notificationsdefault_action_identifier).\n */\nexport interface NotificationResponse {\n notification: Notification;\n actionIdentifier: string;\n userText?: string;\n}\n\n/**\n * An object represents behavior that should be applied to the incoming notification.\n * > On Android, setting `shouldPlaySound: false` will result in the drop-down notification alert **not** showing, no matter what the priority is.\n * > This setting will also override any channel-specific sounds you may have configured.\n */\nexport interface NotificationBehavior {\n shouldShowAlert: boolean;\n shouldPlaySound: boolean;\n shouldSetBadge: boolean;\n priority?: AndroidNotificationPriority;\n}\n\nexport interface NotificationAction {\n /**\n * A unique string that identifies this action. If a user takes this action (for example, selects this button in the system's Notification UI),\n * your app will receive this `actionIdentifier` via the [`NotificationResponseReceivedListener`](#addnotificationresponsereceivedlistenerlistener).\n */\n identifier: string;\n /**\n * The title of the button triggering this action.\n */\n buttonTitle: string;\n /**\n * Object which, if provided, will result in a button that prompts the user for a text response.\n */\n textInput?: {\n /**\n * A string which will be used as the title for the button used for submitting the text response.\n * @platform ios\n */\n submitButtonTitle: string;\n /**\n * A string that serves as a placeholder until the user begins typing. Defaults to no placeholder string.\n */\n placeholder: string;\n };\n /**\n * Object representing the additional configuration options.\n */\n options?: {\n /**\n * Boolean indicating whether the button title will be highlighted a different color (usually red).\n * This usually signifies a destructive action such as deleting data.\n * @platform ios\n */\n isDestructive?: boolean;\n /**\n * Boolean indicating whether triggering the action will require authentication from the user.\n * @platform ios\n */\n isAuthenticationRequired?: boolean;\n /**\n * Boolean indicating whether triggering this action foregrounds the app.\n * If `false` and your app is killed (not just backgrounded), [`NotificationResponseReceived` listeners](#addnotificationresponsereceivedlistenerlistener)\n * will not be triggered when a user selects this action.\n * @default true\n */\n opensAppToForeground?: boolean;\n };\n}\n\n// @docsMissing\nexport interface NotificationCategory {\n identifier: string;\n actions: NotificationAction[];\n options?: NotificationCategoryOptions;\n}\n\n/**\n * @platform ios\n */\nexport type NotificationCategoryOptions = {\n /**\n * Customizable placeholder for the notification preview text. This is shown if the user has disabled notification previews for the app.\n * Defaults to the localized iOS system default placeholder (`Notification`).\n */\n previewPlaceholder?: string;\n /**\n * Array of [Intent Class Identifiers](https://developer.apple.com/documentation/sirikit/intent_class_identifiers). When a notification is delivered,\n * the presence of an intent identifier lets the system know that the notification is potentially related to the handling of a request made through Siri.\n * @default []\n */\n intentIdentifiers?: string[];\n /**\n * A format string for the summary description used when the system groups the category’s notifications.\n */\n categorySummaryFormat?: string;\n /**\n * A boolean indicating whether to send actions for handling when the notification is dismissed (the user must explicitly dismiss\n * the notification interface - ignoring a notification or flicking away a notification banner does not trigger this action).\n * @default false\n */\n customDismissAction?: boolean;\n /**\n * A boolean indicating whether to allow CarPlay to display notifications of this type. **Apps must be approved for CarPlay to make use of this feature.**\n * @default false\n */\n allowInCarPlay?: boolean;\n /**\n * A boolean indicating whether to show the notification's title, even if the user has disabled notification previews for the app.\n * @default false\n */\n showTitle?: boolean;\n /**\n * A boolean indicating whether to show the notification's subtitle, even if the user has disabled notification previews for the app.\n * @default false\n */\n showSubtitle?: boolean;\n /**\n * A boolean indicating whether to allow notifications to be automatically read by Siri when the user is using AirPods.\n * @default false\n */\n allowAnnouncement?: boolean;\n};\n\nexport type { Subscription, PermissionResponse, PermissionStatus, PermissionExpiration };\n"]}
|
|
1
|
+
{"version":3,"file":"Notifications.types.js","sourceRoot":"","sources":["../src/Notifications.types.ts"],"names":[],"mappings":"AA+VA;;GAEG;AACH,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACrC,0CAAW,CAAA;IACX,0CAAW,CAAA;IACX,kDAAmB,CAAA;IACnB,4CAAa,CAAA;IACb,0CAAW,CAAA;AACb,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC","sourcesContent":["import type {\n PermissionExpiration,\n PermissionResponse,\n PermissionStatus,\n EventSubscription,\n} from 'expo-modules-core';\n\n/**\n * An object represents a notification delivered by a push notification system.\n *\n * On Android under `remoteMessage` field a JS version of the Firebase `RemoteMessage` may be accessed.\n * On iOS under `payload` you may find full contents of [`UNNotificationContent`'s](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) [`userInfo`](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649869-userinfo?language=objc), for example [remote notification payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html).\n */\nexport type PushNotificationTrigger = {\n type: 'push';\n /**\n * @platform ios\n */\n payload?: Record<string, unknown>;\n /**\n * @platform android\n */\n remoteMessage?: FirebaseRemoteMessage;\n};\n\n/**\n * A trigger related to a [`UNCalendarNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/uncalendarnotificationtrigger?language=objc).\n * @platform ios\n */\nexport interface CalendarNotificationTrigger {\n type: 'calendar';\n repeats: boolean;\n dateComponents: {\n era?: number;\n year?: number;\n month?: number;\n day?: number;\n hour?: number;\n minute?: number;\n second?: number;\n weekday?: number;\n weekdayOrdinal?: number;\n quarter?: number;\n weekOfMonth?: number;\n weekOfYear?: number;\n yearForWeekOfYear?: number;\n nanosecond?: number;\n isLeapMonth: boolean;\n timeZone?: string;\n calendar?: string;\n };\n}\n\n/**\n * The region used to determine when the system sends the notification.\n * @platform ios\n */\nexport interface Region {\n type: string;\n /**\n * The identifier for the region object.\n */\n identifier: string;\n /**\n * A Boolean indicating that notifications are generated upon entry into the region.\n */\n notifyOnEntry: boolean;\n /**\n * A Boolean indicating that notifications are generated upon exit from the region.\n */\n notifyOnExit: boolean;\n}\n\n/**\n * A circular geographic region, specified as a center point and radius. Based on Core Location [`CLCircularRegion`](https://developer.apple.com/documentation/corelocation/clcircularregion) class.\n * @platform ios\n */\nexport interface CircularRegion extends Region {\n type: 'circular';\n /**\n * The radius (measured in meters) that defines the geographic area’s outer boundary.\n */\n radius: number;\n /**\n * The center point of the geographic area.\n */\n center: {\n latitude: number;\n longitude: number;\n };\n}\n\n/**\n * A region used to detect the presence of iBeacon devices. Based on Core Location [`CLBeaconRegion`](https://developer.apple.com/documentation/corelocation/clbeaconregion) class.\n * @platform ios\n */\nexport interface BeaconRegion extends Region {\n type: 'beacon';\n /**\n * A Boolean value that indicates whether Core Location sends beacon notifications when the device’s display is on.\n */\n notifyEntryStateOnDisplay: boolean;\n /**\n * The major value from the beacon identity constraint that defines the beacon region.\n */\n major: number | null;\n /**\n * The minor value from the beacon identity constraint that defines the beacon region.\n */\n minor: number | null;\n /**\n * The UUID value from the beacon identity constraint that defines the beacon region.\n */\n uuid?: string;\n /**\n * The beacon identity constraint that defines the beacon region.\n */\n beaconIdentityConstraint?: {\n uuid: string;\n major: number | null;\n minor: number | null;\n };\n}\n\n/**\n * A trigger related to a [`UNLocationNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/unlocationnotificationtrigger?language=objc).\n * @platform ios\n */\nexport interface LocationNotificationTrigger {\n type: 'location';\n repeats: boolean;\n region: CircularRegion | BeaconRegion;\n}\n\n/**\n * A trigger related to an elapsed time interval. May be repeating (see `repeats` field).\n */\nexport interface TimeIntervalNotificationTrigger {\n type: 'timeInterval';\n repeats: boolean;\n seconds: number;\n}\n\n/**\n * A trigger related to a daily notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface DailyNotificationTrigger {\n type: 'daily';\n hour: number;\n minute: number;\n}\n\n/**\n * A trigger related to a weekly notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface WeeklyNotificationTrigger {\n type: 'weekly';\n weekday: number;\n hour: number;\n minute: number;\n}\n\n/**\n * A trigger related to a yearly notification.\n * > The same functionality will be achieved on iOS with a `CalendarNotificationTrigger`.\n * @platform android\n */\nexport interface YearlyNotificationTrigger {\n type: 'yearly';\n day: number;\n month: number;\n hour: number;\n minute: number;\n}\n\n// @docsMissing\n/**\n * A Firebase `RemoteMessage` that caused the notification to be delivered to the app.\n */\nexport interface FirebaseRemoteMessage {\n collapseKey: string | null;\n data: Record<string, string>;\n from: string | null;\n messageId: string | null;\n messageType: string | null;\n originalPriority: number;\n priority: number;\n sentTime: number;\n to: string | null;\n ttl: number;\n notification: null | FirebaseRemoteMessageNotification;\n}\n\n// @docsMissing\nexport interface FirebaseRemoteMessageNotification {\n body: string | null;\n bodyLocalizationArgs: string[] | null;\n bodyLocalizationKey: string | null;\n channelId: string | null;\n clickAction: string | null;\n color: string | null;\n usesDefaultLightSettings: boolean;\n usesDefaultSound: boolean;\n usesDefaultVibrateSettings: boolean;\n eventTime: number | null;\n icon: string | null;\n imageUrl: string | null;\n lightSettings: number[] | null;\n link: string | null;\n localOnly: boolean;\n notificationCount: number | null;\n notificationPriority: number | null;\n sound: string | null;\n sticky: boolean;\n tag: string | null;\n ticker: string | null;\n title: string | null;\n titleLocalizationArgs: string[] | null;\n titleLocalizationKey: string | null;\n vibrateTimings: number[] | null;\n visibility: number | null;\n}\n\n/**\n * Represents a notification trigger that is unknown to `expo-notifications` and that it didn't know how to serialize for JS.\n */\nexport interface UnknownNotificationTrigger {\n type: 'unknown';\n}\n\n/**\n * A union type containing different triggers which may cause the notification to be delivered to the application.\n */\nexport type NotificationTrigger =\n | PushNotificationTrigger\n | CalendarNotificationTrigger\n | LocationNotificationTrigger\n | TimeIntervalNotificationTrigger\n | DailyNotificationTrigger\n | WeeklyNotificationTrigger\n | YearlyNotificationTrigger\n | UnknownNotificationTrigger;\n\n/**\n * A trigger that will cause the notification to be delivered immediately.\n */\nexport type ChannelAwareTriggerInput = {\n channelId: string;\n};\n\n// @docsMissing\nexport type CalendarTriggerInputValue = {\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\n/**\n * A trigger that will cause the notification to be delivered once or many times when the date components match the specified values.\n * Corresponds to native [`UNCalendarNotificationTrigger`](https://developer.apple.com/documentation/usernotifications/uncalendarnotificationtrigger?language=objc).\n * @platform ios\n */\nexport type CalendarTriggerInput = CalendarTriggerInputValue & {\n channelId?: string;\n repeats?: boolean;\n};\n\n/**\n * A trigger that will cause the notification to be delivered once or many times (depends on the `repeats` field) after `seconds` time elapse.\n * > **On iOS**, when `repeats` is `true`, the time interval must be 60 seconds or greater. Otherwise, the notification won't be triggered.\n */\nexport interface TimeIntervalTriggerInput {\n channelId?: string;\n repeats?: boolean;\n seconds: number;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once per day.\n */\nexport interface DailyTriggerInput {\n channelId?: string;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once every week.\n * > **Note:** Weekdays are specified with a number from `1` through `7`, with `1` indicating Sunday.\n */\nexport interface WeeklyTriggerInput {\n channelId?: string;\n weekday: number;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once every year.\n * > **Note:** all properties are specified in JavaScript Date's ranges.\n */\nexport interface YearlyTriggerInput {\n channelId?: string;\n day: number;\n month: number;\n hour: number;\n minute: number;\n repeats: true;\n}\n\n/**\n * A trigger that will cause the notification to be delivered once at the specified `Date`.\n * If you pass in a `number` it will be interpreted as a Unix timestamp.\n */\nexport type DateTriggerInput = Date | number | { channelId?: string; date: Date | number };\n\n/**\n * A type represents time-based, schedulable triggers. For these triggers you can check the next trigger date\n * with [`getNextTriggerDateAsync`](#notificationsgetnexttriggerdateasynctrigger).\n */\nexport type SchedulableNotificationTriggerInput =\n | DateTriggerInput\n | TimeIntervalTriggerInput\n | DailyTriggerInput\n | WeeklyTriggerInput\n | YearlyTriggerInput\n | CalendarTriggerInput;\n\n/**\n * A type represents possible triggers with which you can schedule notifications.\n * A `null` trigger means that the notification should be scheduled for delivery immediately.\n */\nexport type NotificationTriggerInput =\n | null\n | ChannelAwareTriggerInput\n | SchedulableNotificationTriggerInput;\n\n/**\n * An enum corresponding to values appropriate for Android's [`Notification#priority`](https://developer.android.com/reference/android/app/Notification#priority) field.\n */\nexport enum AndroidNotificationPriority {\n MIN = 'min',\n LOW = 'low',\n DEFAULT = 'default',\n HIGH = 'high',\n MAX = 'max',\n}\n\n/**\n * An object represents notification's content.\n */\nexport type NotificationContent = {\n /**\n * Notification title - the bold text displayed above the rest of the content.\n */\n title: string | null;\n /**\n * On Android: `subText` - the display depends on the device.\n *\n * On iOS: `subtitle` - the bold text displayed between title and the rest of the content.\n */\n subtitle: string | null;\n /**\n * Notification body - the main content of the notification.\n */\n body: string | null;\n /**\n * Data associated with the notification, not displayed\n */\n data: Record<string, any>;\n // @docsMissing\n sound: 'default' | 'defaultCritical' | 'custom' | null;\n} & (NotificationContentIos | NotificationContentAndroid);\n\n/**\n * See [Apple documentation](https://developer.apple.com/documentation/usernotifications/unnotificationcontent?language=objc) for more information on specific fields.\n */\nexport type NotificationContentIos = {\n /**\n * The name of the image or storyboard to use when your app launches because of the notification.\n */\n launchImageName: string | null;\n /**\n * The number that your app’s icon displays.\n */\n badge: number | null;\n /**\n * The visual and audio attachments to display alongside the notification’s main content.\n */\n attachments: NotificationContentAttachmentIos[];\n /**\n * The text the system adds to the notification summary to provide additional context.\n */\n summaryArgument?: string | null;\n /**\n * The number the system adds to the notification summary when the notification represents multiple items.\n */\n summaryArgumentCount?: number;\n /**\n * The identifier of the notification’s category.\n */\n categoryIdentifier: string | null;\n /**\n * The identifier that groups related notifications.\n */\n threadIdentifier: string | null;\n /**\n * The value your app uses to determine which scene to display to handle the notification.\n */\n targetContentIdentifier?: string;\n /*\n * The notification’s importance and required delivery timing.\n * Posible values:\n * - 'passive' - the system adds the notification to the notification list without lighting up the screen or playing a sound\n * - 'active' - the system presents the notification immediately, lights up the screen, and can play a sound\n * - 'timeSensitive' - The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls\n * - 'critical - the system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound\n * @platform ios\n */\n interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical';\n};\n\n// @docsMissing\n/**\n * @platform ios\n */\nexport type NotificationContentAttachmentIos = {\n identifier: string | null;\n url: string | null;\n type: string | null;\n typeHint?: string;\n hideThumbnail?: boolean;\n thumbnailClipArea?: { x: number; y: number; width: number; height: number };\n thumbnailTime?: number;\n};\n\n/**\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification#fields) for more information on specific fields.\n */\nexport type NotificationContentAndroid = {\n /**\n * Application badge number associated with the notification.\n */\n badge?: number;\n /**\n * Accent color (in `#AARRGGBB` or `#RRGGBB` format) to be applied by the standard Style templates when presenting this notification.\n */\n color?: string;\n /**\n * Relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification.\n * Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification.\n * The system will make a determination about how to interpret this priority when presenting the notification.\n */\n priority?: AndroidNotificationPriority;\n /**\n * The pattern with which to vibrate.\n */\n vibrationPattern?: number[];\n};\n\n/**\n * An object represents a request to present a notification. It has content — how it's being represented, and a trigger — what triggers the notification.\n * Many notifications ([`Notification`](#notification)) may be triggered with the same request (for example, a repeating notification).\n */\nexport interface NotificationRequest {\n identifier: string;\n content: NotificationContent;\n trigger: NotificationTrigger;\n}\n\n// TODO(simek): asses if we can base this type on `NotificationContent`, since most of the fields looks like repetition\n/**\n * An object represents notification content that you pass in to `presentNotificationAsync` or as a part of `NotificationRequestInput`.\n */\nexport type NotificationContentInput = {\n /**\n * Notification title - the bold text displayed above the rest of the content.\n */\n title?: string | null;\n /**\n * On Android: `subText` - the display depends on the device.\n *\n * On iOS: `subtitle` - the bold text displayed between title and the rest of the content.\n */\n subtitle?: string | null;\n /**\n * The main content of the notification.\n */\n body?: string | null;\n /**\n * Data associated with the notification, not displayed.\n */\n data?: Record<string, any>;\n /**\n * Application badge number associated with the notification.\n */\n badge?: number;\n sound?: boolean | string;\n /**\n * The name of the image or storyboard to use when your app launches because of the notification.\n */\n launchImageName?: string;\n /**\n * The pattern with which to vibrate.\n * @platform android\n */\n vibrate?: number[];\n /**\n * Relative priority for this notification. Priority is an indication of how much of the user's valuable attention should be consumed by this notification.\n * Low-priority notifications may be hidden from the user in certain situations, while the user might be interrupted for a higher-priority notification.\n * The system will make a determination about how to interpret this priority when presenting the notification.\n * @platform android\n */\n priority?: string;\n /**\n * Accent color (in `#AARRGGBB` or `#RRGGBB` format) to be applied by the standard Style templates when presenting this notification.\n * @platform android\n */\n color?: string;\n /**\n * If set to `false`, the notification will not be automatically dismissed when clicked.\n * The setting will be used when the value is not provided or is invalid is set to `true`, and the notification\n * will be dismissed automatically anyway. Corresponds directly to Android's `setAutoCancel` behavior.\n *\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification.Builder#setAutoCancel(boolean))\n * for more details.\n * @platform android\n */\n autoDismiss?: boolean;\n /**\n * The identifier of the notification’s category.\n * @platform ios\n */\n categoryIdentifier?: string;\n /**\n * If set to `true`, the notification cannot be dismissed by swipe. This setting defaults\n * to `false` if not provided or is invalid. Corresponds directly do Android's `isOngoing` behavior.\n * In Firebase terms this property of a notification is called `sticky`.\n *\n * See [Android developer documentation](https://developer.android.com/reference/android/app/Notification.Builder#setOngoing(boolean))\n * and [Firebase documentation](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidNotification.FIELDS.sticky)\n * for more details.\n * @platform android\n */\n sticky?: boolean;\n /**\n * The visual and audio attachments to display alongside the notification’s main content.\n * @platform ios\n */\n attachments?: NotificationContentAttachmentIos[];\n /*\n * The notification’s importance and required delivery timing.\n * Posible values:\n * - 'passive' - the system adds the notification to the notification list without lighting up the screen or playing a sound\n * - 'active' - the system presents the notification immediately, lights up the screen, and can play a sound\n * - 'timeSensitive' - The system presents the notification immediately, lights up the screen, can play a sound, and breaks through system notification controls\n * - 'critical - the system presents the notification immediately, lights up the screen, and bypasses the mute switch to play a sound\n * @platform ios\n */\n interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical';\n};\n\n/**\n * An object represents a notification request you can pass into `scheduleNotificationAsync`.\n */\nexport interface NotificationRequestInput {\n identifier?: string;\n content: NotificationContentInput;\n trigger: NotificationTriggerInput;\n}\n\n/**\n * An object represents a single notification that has been triggered by some request ([`NotificationRequest`](#notificationrequest)) at some point in time.\n */\nexport interface Notification {\n date: number;\n request: NotificationRequest;\n}\n\n/**\n * An object represents user's interaction with the notification.\n * > **Note:** If the user taps on a notification `actionIdentifier` will be equal to [`Notifications.DEFAULT_ACTION_IDENTIFIER`](#notificationsdefault_action_identifier).\n */\nexport interface NotificationResponse {\n notification: Notification;\n actionIdentifier: string;\n userText?: string;\n}\n\n/**\n * An object represents behavior that should be applied to the incoming notification.\n * > On Android, setting `shouldPlaySound: false` will result in the drop-down notification alert **not** showing, no matter what the priority is.\n * > This setting will also override any channel-specific sounds you may have configured.\n */\nexport interface NotificationBehavior {\n shouldShowAlert: boolean;\n shouldPlaySound: boolean;\n shouldSetBadge: boolean;\n priority?: AndroidNotificationPriority;\n}\n\nexport interface NotificationAction {\n /**\n * A unique string that identifies this action. If a user takes this action (for example, selects this button in the system's Notification UI),\n * your app will receive this `actionIdentifier` via the [`NotificationResponseReceivedListener`](#addnotificationresponsereceivedlistenerlistener).\n */\n identifier: string;\n /**\n * The title of the button triggering this action.\n */\n buttonTitle: string;\n /**\n * Object which, if provided, will result in a button that prompts the user for a text response.\n */\n textInput?: {\n /**\n * A string which will be used as the title for the button used for submitting the text response.\n * @platform ios\n */\n submitButtonTitle: string;\n /**\n * A string that serves as a placeholder until the user begins typing. Defaults to no placeholder string.\n */\n placeholder: string;\n };\n /**\n * Object representing the additional configuration options.\n */\n options?: {\n /**\n * Boolean indicating whether the button title will be highlighted a different color (usually red).\n * This usually signifies a destructive action such as deleting data.\n * @platform ios\n */\n isDestructive?: boolean;\n /**\n * Boolean indicating whether triggering the action will require authentication from the user.\n * @platform ios\n */\n isAuthenticationRequired?: boolean;\n /**\n * Boolean indicating whether triggering this action foregrounds the app.\n * If `false` and your app is killed (not just backgrounded), [`NotificationResponseReceived` listeners](#addnotificationresponsereceivedlistenerlistener)\n * will not be triggered when a user selects this action.\n * @default true\n */\n opensAppToForeground?: boolean;\n };\n}\n\n// @docsMissing\nexport interface NotificationCategory {\n identifier: string;\n actions: NotificationAction[];\n options?: NotificationCategoryOptions;\n}\n\n/**\n * @platform ios\n */\nexport type NotificationCategoryOptions = {\n /**\n * Customizable placeholder for the notification preview text. This is shown if the user has disabled notification previews for the app.\n * Defaults to the localized iOS system default placeholder (`Notification`).\n */\n previewPlaceholder?: string;\n /**\n * Array of [Intent Class Identifiers](https://developer.apple.com/documentation/sirikit/intent_class_identifiers). When a notification is delivered,\n * the presence of an intent identifier lets the system know that the notification is potentially related to the handling of a request made through Siri.\n * @default []\n */\n intentIdentifiers?: string[];\n /**\n * A format string for the summary description used when the system groups the category’s notifications.\n */\n categorySummaryFormat?: string;\n /**\n * A boolean indicating whether to send actions for handling when the notification is dismissed (the user must explicitly dismiss\n * the notification interface - ignoring a notification or flicking away a notification banner does not trigger this action).\n * @default false\n */\n customDismissAction?: boolean;\n /**\n * A boolean indicating whether to allow CarPlay to display notifications of this type. **Apps must be approved for CarPlay to make use of this feature.**\n * @default false\n */\n allowInCarPlay?: boolean;\n /**\n * A boolean indicating whether to show the notification's title, even if the user has disabled notification previews for the app.\n * @default false\n */\n showTitle?: boolean;\n /**\n * A boolean indicating whether to show the notification's subtitle, even if the user has disabled notification previews for the app.\n * @default false\n */\n showSubtitle?: boolean;\n /**\n * A boolean indicating whether to allow notifications to be automatically read by Siri when the user is using AirPods.\n * @default false\n */\n allowAnnouncement?: boolean;\n};\n\nexport type {\n EventSubscription as Subscription,\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type EventSubscription } from 'expo-modules-core';
|
|
2
2
|
import { Notification, NotificationResponse } from './Notifications.types';
|
|
3
3
|
export declare const DEFAULT_ACTION_IDENTIFIER = "expo.modules.notifications.actions.DEFAULT";
|
|
4
4
|
/**
|
|
@@ -25,7 +25,7 @@ export declare const DEFAULT_ACTION_IDENTIFIER = "expo.modules.notifications.act
|
|
|
25
25
|
* ```
|
|
26
26
|
* @header listen
|
|
27
27
|
*/
|
|
28
|
-
export declare function addNotificationReceivedListener(listener: (event: Notification) => void):
|
|
28
|
+
export declare function addNotificationReceivedListener(listener: (event: Notification) => void): EventSubscription;
|
|
29
29
|
/**
|
|
30
30
|
* Listeners registered by this method will be called whenever some notifications have been dropped by the server.
|
|
31
31
|
* Applicable only to Firebase Cloud Messaging which we use as a notifications service on Android. It corresponds to `onDeletedMessages()` callback.
|
|
@@ -34,7 +34,7 @@ export declare function addNotificationReceivedListener(listener: (event: Notifi
|
|
|
34
34
|
* @return A [`Subscription`](#subscription) object represents the subscription of the provided listener.
|
|
35
35
|
* @header listen
|
|
36
36
|
*/
|
|
37
|
-
export declare function addNotificationsDroppedListener(listener: () => void):
|
|
37
|
+
export declare function addNotificationsDroppedListener(listener: () => void): EventSubscription;
|
|
38
38
|
/**
|
|
39
39
|
* Listeners registered by this method will be called whenever a user interacts with a notification (for example, taps on it).
|
|
40
40
|
* @param listener A function accepting notification response ([`NotificationResponse`](#notificationresponse)) as an argument.
|
|
@@ -61,13 +61,13 @@ export declare function addNotificationsDroppedListener(listener: () => void): S
|
|
|
61
61
|
* ```
|
|
62
62
|
* @header listen
|
|
63
63
|
*/
|
|
64
|
-
export declare function addNotificationResponseReceivedListener(listener: (event: NotificationResponse) => void):
|
|
64
|
+
export declare function addNotificationResponseReceivedListener(listener: (event: NotificationResponse) => void): EventSubscription;
|
|
65
65
|
/**
|
|
66
66
|
* Removes a notification subscription returned by an `addNotificationListener` call.
|
|
67
67
|
* @param subscription A subscription returned by `addNotificationListener` method.
|
|
68
68
|
* @header listen
|
|
69
69
|
*/
|
|
70
|
-
export declare function removeNotificationSubscription(subscription:
|
|
70
|
+
export declare function removeNotificationSubscription(subscription: EventSubscription): void;
|
|
71
71
|
/**
|
|
72
72
|
* @header listen
|
|
73
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsEmitter.d.ts","sourceRoot":"","sources":["../src/NotificationsEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NotificationsEmitter.d.ts","sourceRoot":"","sources":["../src/NotificationsEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,iBAAiB,EAAuB,MAAM,mBAAmB,CAAC;AAEpG,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAY3E,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GACtC,iBAAiB,CAQnB;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,iBAAiB,CAEvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,uCAAuC,CACrD,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAC9C,iBAAiB,CAQnB;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,iBAAiB,QAE7E;AAGD;;GAEG;AACH,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAO7F"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LegacyEventEmitter, UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
import NotificationsEmitterModule from './NotificationsEmitterModule';
|
|
3
3
|
import { mapNotification, mapNotificationResponse } from './utils/mapNotificationResponse';
|
|
4
4
|
// Web uses SyntheticEventEmitter
|
|
5
|
-
const emitter = new
|
|
5
|
+
const emitter = new LegacyEventEmitter(NotificationsEmitterModule);
|
|
6
6
|
const didReceiveNotificationEventName = 'onDidReceiveNotification';
|
|
7
7
|
const didDropNotificationsEventName = 'onNotificationsDeleted';
|
|
8
8
|
const didReceiveNotificationResponseEventName = 'onDidReceiveNotificationResponse';
|
|
@@ -87,7 +87,7 @@ export function addNotificationResponseReceivedListener(listener) {
|
|
|
87
87
|
* @header listen
|
|
88
88
|
*/
|
|
89
89
|
export function removeNotificationSubscription(subscription) {
|
|
90
|
-
|
|
90
|
+
subscription.remove();
|
|
91
91
|
}
|
|
92
92
|
// @docsMissing
|
|
93
93
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsEmitter.js","sourceRoot":"","sources":["../src/NotificationsEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NotificationsEmitter.js","sourceRoot":"","sources":["../src/NotificationsEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA0B,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,OAAO,0BAA0B,MAAM,8BAA8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IAAI,CAAC,0BAA0B,CAAC,gCAAgC,EAAE;QAChE,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,EAAE,kCAAkC,CAAC,CAAC;KACxF;IACD,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC,gCAAgC,EAAE,CAAC;IACrF,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC/E,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { LegacyEventEmitter, type EventSubscription, UnavailabilityError } from 'expo-modules-core';\n\nimport { Notification, NotificationResponse } from './Notifications.types';\nimport NotificationsEmitterModule from './NotificationsEmitterModule';\nimport { mapNotification, mapNotificationResponse } from './utils/mapNotificationResponse';\n\n// Web uses SyntheticEventEmitter\nconst emitter = new LegacyEventEmitter(NotificationsEmitterModule);\n\nconst didReceiveNotificationEventName = 'onDidReceiveNotification';\nconst didDropNotificationsEventName = 'onNotificationsDeleted';\nconst didReceiveNotificationResponseEventName = 'onDidReceiveNotificationResponse';\n\n// @docsMissing\nexport const DEFAULT_ACTION_IDENTIFIER = 'expo.modules.notifications.actions.DEFAULT';\n\n/**\n * Listeners registered by this method will be called whenever a notification is received while the app is running.\n * @param listener A function accepting a notification ([`Notification`](#notification)) as an argument.\n * @return A [`Subscription`](#subscription) object represents the subscription of the provided listener.\n * @example Registering a notification listener using a React hook:\n * ```jsx\n * import React from 'react';\n * import * as Notifications from 'expo-notifications';\n *\n * export default function App() {\n * React.useEffect(() => {\n * const subscription = Notifications.addNotificationReceivedListener(notification => {\n * console.log(notification);\n * });\n * return () => subscription.remove();\n * }, []);\n *\n * return (\n * // Your app content\n * );\n * }\n * ```\n * @header listen\n */\nexport function addNotificationReceivedListener(\n listener: (event: Notification) => void\n): EventSubscription {\n return emitter.addListener<Notification>(\n didReceiveNotificationEventName,\n (notification: Notification) => {\n const mappedNotification = mapNotification(notification);\n listener(mappedNotification);\n }\n );\n}\n\n/**\n * Listeners registered by this method will be called whenever some notifications have been dropped by the server.\n * Applicable only to Firebase Cloud Messaging which we use as a notifications service on Android. It corresponds to `onDeletedMessages()` callback.\n * More information can be found in [Firebase docs](https://firebase.google.com/docs/cloud-messaging/android/receive#override-ondeletedmessages).\n * @param listener A callback function.\n * @return A [`Subscription`](#subscription) object represents the subscription of the provided listener.\n * @header listen\n */\nexport function addNotificationsDroppedListener(listener: () => void): EventSubscription {\n return emitter.addListener<void>(didDropNotificationsEventName, listener);\n}\n\n/**\n * Listeners registered by this method will be called whenever a user interacts with a notification (for example, taps on it).\n * @param listener A function accepting notification response ([`NotificationResponse`](#notificationresponse)) as an argument.\n * @return A [`Subscription`](#subscription) object represents the subscription of the provided listener.\n * @example Register a notification responder listener:\n * ```jsx\n * import React from 'react';\n * import { Linking } from 'react-native';\n * import * as Notifications from 'expo-notifications';\n *\n * export default function Container() {\n * React.useEffect(() => {\n * const subscription = Notifications.addNotificationResponseReceivedListener(response => {\n * const url = response.notification.request.content.data.url;\n * Linking.openURL(url);\n * });\n * return () => subscription.remove();\n * }, []);\n *\n * return (\n * // Your app content\n * );\n * }\n * ```\n * @header listen\n */\nexport function addNotificationResponseReceivedListener(\n listener: (event: NotificationResponse) => void\n): EventSubscription {\n return emitter.addListener<NotificationResponse>(\n didReceiveNotificationResponseEventName,\n (response: NotificationResponse) => {\n const mappedResponse = mapNotificationResponse(response);\n listener(mappedResponse);\n }\n );\n}\n\n/**\n * Removes a notification subscription returned by an `addNotificationListener` call.\n * @param subscription A subscription returned by `addNotificationListener` method.\n * @header listen\n */\nexport function removeNotificationSubscription(subscription: EventSubscription) {\n subscription.remove();\n}\n\n// @docsMissing\n/**\n * @header listen\n */\nexport async function getLastNotificationResponseAsync(): Promise<NotificationResponse | null> {\n if (!NotificationsEmitterModule.getLastNotificationResponseAsync) {\n throw new UnavailabilityError('ExpoNotifications', 'getLastNotificationResponseAsync');\n }\n const response = await NotificationsEmitterModule.getLastNotificationResponseAsync();\n const mappedResponse = response ? mapNotificationResponse(response) : response;\n return mappedResponse;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsHandler.d.ts","sourceRoot":"","sources":["../src/NotificationsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NotificationsHandler.d.ts","sourceRoot":"","sources":["../src/NotificationsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG3E;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,UAAU;IACtD,IAAI,EAAE;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;gBACrC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY;CAI/D;AAGD,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG,KAAK,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClF;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;CAClF;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAsChF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LegacyEventEmitter, CodedError, UnavailabilityError, } from 'expo-modules-core';
|
|
2
2
|
import NotificationsHandlerModule from './NotificationsHandlerModule';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
@@ -11,7 +11,7 @@ export class NotificationTimeoutError extends CodedError {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
// Web uses SyntheticEventEmitter
|
|
14
|
-
const notificationEmitter = new
|
|
14
|
+
const notificationEmitter = new LegacyEventEmitter(NotificationsHandlerModule);
|
|
15
15
|
const handleNotificationEventName = 'onHandleNotification';
|
|
16
16
|
const handleNotificationTimeoutEventName = 'onHandleNotificationTimeout';
|
|
17
17
|
let handleSubscription = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsHandler.js","sourceRoot":"","sources":["../src/NotificationsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NotificationsHandler.js","sourceRoot":"","sources":["../src/NotificationsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,UAAU,EACV,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IACtD,IAAI,CAA6C;IACjD,YAAY,cAAsB,EAAE,YAA0B;QAC5D,KAAK,CAAC,0BAA0B,EAAE,0CAA0C,cAAc,GAAG,CAAC,CAAC;QAC/F,IAAI,CAAC,IAAI,GAAG,EAAE,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;IACnD,CAAC;CACF;AAgCD,iCAAiC;AACjC,MAAM,mBAAmB,GAAG,IAAI,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;AAE/E,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AAC3D,MAAM,kCAAkC,GAAG,6BAA6B,CAAC;AAEzE,IAAI,kBAAkB,GAA6B,IAAI,CAAC;AACxD,IAAI,yBAAyB,GAA6B,IAAI,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAmC;IACxE,IAAI,kBAAkB,EAAE;QACtB,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC5B,kBAAkB,GAAG,IAAI,CAAC;KAC3B;IACD,IAAI,yBAAyB,EAAE;QAC7B,yBAAyB,CAAC,MAAM,EAAE,CAAC;QACnC,yBAAyB,GAAG,IAAI,CAAC;KAClC;IAED,IAAI,OAAO,EAAE;QACX,kBAAkB,GAAG,mBAAmB,CAAC,WAAW,CAClD,2BAA2B,EAC3B,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;YAC7B,IAAI,CAAC,0BAA0B,CAAC,uBAAuB,EAAE;gBACvD,OAAO,CAAC,WAAW,EAAE,CACnB,EAAE,EACF,IAAI,mBAAmB,CAAC,eAAe,EAAE,yBAAyB,CAAC,CACpE,CAAC;gBACF,OAAO;aACR;YAED,IAAI;gBACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;gBAChE,MAAM,0BAA0B,CAAC,uBAAuB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;gBACvE,OAAO,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;aAC7B;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;aAClC;QACH,CAAC,CACF,CAAC;QAEF,yBAAyB,GAAG,mBAAmB,CAAC,WAAW,CACzD,kCAAkC,EAClC,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CACvB,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,IAAI,wBAAwB,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAC5E,CAAC;KACH;AACH,CAAC","sourcesContent":["import {\n LegacyEventEmitter,\n type EventSubscription,\n CodedError,\n UnavailabilityError,\n} from 'expo-modules-core';\n\nimport { Notification, NotificationBehavior } from './Notifications.types';\nimport NotificationsHandlerModule from './NotificationsHandlerModule';\n\n/**\n * @hidden\n */\nexport class NotificationTimeoutError extends CodedError {\n info: { notification: Notification; id: string };\n constructor(notificationId: string, notification: Notification) {\n super('ERR_NOTIFICATION_TIMEOUT', `Notification handling timed out for ID ${notificationId}.`);\n this.info = { id: notificationId, notification };\n }\n}\n\n// @docsMissing\nexport type NotificationHandlingError = NotificationTimeoutError | Error;\n\nexport interface NotificationHandler {\n /**\n * A function accepting an incoming notification returning a `Promise` resolving to a behavior ([`NotificationBehavior`](#notificationbehavior))\n * applicable to the notification\n * @param notification An object representing the notification.\n */\n handleNotification: (notification: Notification) => Promise<NotificationBehavior>;\n /**\n * A function called whenever an incoming notification is handled successfully.\n * @param notificationId Identifier of the notification.\n */\n handleSuccess?: (notificationId: string) => void;\n /**\n * A function called whenever handling of an incoming notification fails.\n * @param notificationId Identifier of the notification.\n * @param error An error which occurred in form of `NotificationHandlingError` object.\n */\n handleError?: (notificationId: string, error: NotificationHandlingError) => void;\n}\n\ntype HandleNotificationEvent = {\n id: string;\n notification: Notification;\n};\n\ntype HandleNotificationTimeoutEvent = HandleNotificationEvent;\n\n// Web uses SyntheticEventEmitter\nconst notificationEmitter = new LegacyEventEmitter(NotificationsHandlerModule);\n\nconst handleNotificationEventName = 'onHandleNotification';\nconst handleNotificationTimeoutEventName = 'onHandleNotificationTimeout';\n\nlet handleSubscription: EventSubscription | null = null;\nlet handleTimeoutSubscription: EventSubscription | null = null;\n\n/**\n * When a notification is received while the app is running, using this function you can set a callback that will decide\n * whether the notification should be shown to the user or not.\n *\n * When a notification is received, `handleNotification` is called with the incoming notification as an argument.\n * The function should respond with a behavior object within 3 seconds, otherwise, the notification will be discarded.\n * If the notification is handled successfully, `handleSuccess` is called with the identifier of the notification,\n * otherwise (or on timeout) `handleError` will be called.\n *\n * The default behavior when the handler is not set or does not respond in time is not to show the notification.\n * @param handler A single parameter which should be either `null` (if you want to clear the handler) or a [`NotificationHandler`](#notificationhandler) object.\n *\n * @example Implementing a notification handler that always shows the notification when it is received.\n * ```jsx\n * import * as Notifications from 'expo-notifications';\n *\n * Notifications.setNotificationHandler({\n * handleNotification: async () => ({\n * shouldShowAlert: true,\n * shouldPlaySound: false,\n * shouldSetBadge: false,\n * }),\n * });\n * ```\n * @header inForeground\n */\nexport function setNotificationHandler(handler: NotificationHandler | null): void {\n if (handleSubscription) {\n handleSubscription.remove();\n handleSubscription = null;\n }\n if (handleTimeoutSubscription) {\n handleTimeoutSubscription.remove();\n handleTimeoutSubscription = null;\n }\n\n if (handler) {\n handleSubscription = notificationEmitter.addListener<HandleNotificationEvent>(\n handleNotificationEventName,\n async ({ id, notification }) => {\n if (!NotificationsHandlerModule.handleNotificationAsync) {\n handler.handleError?.(\n id,\n new UnavailabilityError('Notifications', 'handleNotificationAsync')\n );\n return;\n }\n\n try {\n const behavior = await handler.handleNotification(notification);\n await NotificationsHandlerModule.handleNotificationAsync(id, behavior);\n handler.handleSuccess?.(id);\n } catch (error) {\n handler.handleError?.(id, error);\n }\n }\n );\n\n handleTimeoutSubscription = notificationEmitter.addListener<HandleNotificationTimeoutEvent>(\n handleNotificationTimeoutEventName,\n ({ id, notification }) =>\n handler.handleError?.(id, new NotificationTimeoutError(id, notification))\n );\n }\n}\n"]}
|
package/build/TokenEmitter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type EventSubscription } from 'expo-modules-core';
|
|
2
2
|
import { DevicePushToken } from './Tokens.types';
|
|
3
3
|
/**
|
|
4
4
|
* A function accepting a device push token ([`DevicePushToken`](#devicepushtoken)) as an argument.
|
|
@@ -32,11 +32,11 @@ export type PushTokenListener = (token: DevicePushToken) => void;
|
|
|
32
32
|
* }
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare function addPushTokenListener(listener: PushTokenListener):
|
|
35
|
+
export declare function addPushTokenListener(listener: PushTokenListener): EventSubscription;
|
|
36
36
|
/**
|
|
37
37
|
* Removes a push token subscription returned by an `addPushTokenListener` call.
|
|
38
38
|
* @param subscription A subscription returned by `addPushTokenListener` method.
|
|
39
39
|
* @header fetch
|
|
40
40
|
*/
|
|
41
|
-
export declare function removePushTokenSubscription(subscription:
|
|
41
|
+
export declare function removePushTokenSubscription(subscription: EventSubscription): void;
|
|
42
42
|
//# sourceMappingURL=TokenEmitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenEmitter.d.ts","sourceRoot":"","sources":["../src/TokenEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TokenEmitter.d.ts","sourceRoot":"","sources":["../src/TokenEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,iBAAiB,EAAY,MAAM,mBAAmB,CAAC;AAGzF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,iBAAiB,CAInF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,iBAAiB,QAE1E"}
|