expo-notifications 0.27.2 → 0.27.4
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 +13 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/notifications/notifications/background/ExpoBackgroundNotificationTasksModule.kt +4 -5
- package/build/{BackgroundNotificationTasksModule.web.d.ts → BackgroundNotificationTasksModule.d.ts} +1 -1
- package/build/BackgroundNotificationTasksModule.d.ts.map +1 -0
- package/build/{BackgroundNotificationTasksModule.web.js → BackgroundNotificationTasksModule.js} +1 -1
- package/build/BackgroundNotificationTasksModule.js.map +1 -0
- package/build/NotificationCategoriesModule.d.ts +4 -0
- package/build/NotificationCategoriesModule.d.ts.map +1 -0
- package/build/NotificationCategoriesModule.js +16 -0
- package/build/NotificationCategoriesModule.js.map +1 -0
- package/build/deleteNotificationCategoryAsync.js +1 -1
- package/build/deleteNotificationCategoryAsync.js.map +1 -1
- package/build/getNotificationCategoriesAsync.js +1 -1
- package/build/getNotificationCategoriesAsync.js.map +1 -1
- package/build/registerTaskAsync.js +1 -1
- package/build/registerTaskAsync.js.map +1 -1
- package/build/setNotificationCategoryAsync.d.ts +2 -1
- package/build/setNotificationCategoryAsync.d.ts.map +1 -1
- package/build/setNotificationCategoryAsync.js +3 -2
- package/build/setNotificationCategoryAsync.js.map +1 -1
- package/build/unregisterTaskAsync.js +1 -1
- package/build/unregisterTaskAsync.js.map +1 -1
- package/package.json +2 -2
- package/src/NotificationCategoriesModule.ts +19 -0
- package/src/deleteNotificationCategoryAsync.ts +1 -1
- package/src/getNotificationCategoriesAsync.ts +1 -1
- package/src/registerTaskAsync.ts +1 -1
- package/src/setNotificationCategoryAsync.ts +3 -2
- package/src/unregisterTaskAsync.ts +1 -1
- package/build/BackgroundNotificationTasksModule.web.d.ts.map +0 -1
- package/build/BackgroundNotificationTasksModule.web.js.map +0 -1
- package/build/NotificationCategoriesModule.web.d.ts +0 -8
- package/build/NotificationCategoriesModule.web.d.ts.map +0 -1
- package/build/NotificationCategoriesModule.web.js +0 -12
- package/build/NotificationCategoriesModule.web.js.map +0 -1
- package/src/NotificationCategoriesModule.web.ts +0 -17
- /package/src/{BackgroundNotificationTasksModule.web.ts → BackgroundNotificationTasksModule.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.27.4 — 2024-01-20
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Throw `UnavailabilityError` when trying to use `setNotificationCategoryAsync` on web. ([#26511](https://github.com/expo/expo/pull/26511) by [@marklawlor](https://github.com/marklawlor))
|
|
18
|
+
- Remove `.native` hardcoded platform imports ([#26511](https://github.com/expo/expo/pull/26511) by [@marklawlor](https://github.com/marklawlor))
|
|
19
|
+
|
|
20
|
+
## 0.27.3 — 2024-01-10
|
|
21
|
+
|
|
22
|
+
### 🐛 Bug fixes
|
|
23
|
+
|
|
24
|
+
- [Android] Fix `expo-notifications` requiring the `expo-task-manager` module to start. ([#26227](https://github.com/expo/expo/pull/26227) by [@behenate](https://github.com/behenate))
|
|
25
|
+
|
|
13
26
|
## 0.27.2 — 2023-12-19
|
|
14
27
|
|
|
15
28
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.27.
|
|
6
|
+
version = '0.27.4'
|
|
7
7
|
|
|
8
8
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
9
|
if (expoModulesCorePlugin.exists()) {
|
|
@@ -94,7 +94,7 @@ android {
|
|
|
94
94
|
namespace "expo.modules.notifications"
|
|
95
95
|
defaultConfig {
|
|
96
96
|
versionCode 21
|
|
97
|
-
versionName '0.27.
|
|
97
|
+
versionName '0.27.4'
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
buildFeatures {
|
|
@@ -6,14 +6,13 @@ import expo.modules.kotlin.modules.ModuleDefinition
|
|
|
6
6
|
import expo.modules.notifications.ModuleNotFoundException
|
|
7
7
|
|
|
8
8
|
class ExpoBackgroundNotificationTasksModule : Module() {
|
|
9
|
-
private
|
|
9
|
+
private val taskManager: TaskManagerInterface by lazy {
|
|
10
|
+
return@lazy appContext.legacyModule()
|
|
11
|
+
?: throw ModuleNotFoundException(TaskManagerInterface::class)
|
|
12
|
+
}
|
|
10
13
|
|
|
11
14
|
override fun definition() = ModuleDefinition {
|
|
12
15
|
Name("ExpoBackgroundNotificationTasksModule")
|
|
13
|
-
OnCreate {
|
|
14
|
-
taskManager = appContext.legacyModule()
|
|
15
|
-
?: throw ModuleNotFoundException(TaskManagerInterface::class)
|
|
16
|
-
}
|
|
17
16
|
|
|
18
17
|
AsyncFunction("registerTaskAsync") { taskName: String ->
|
|
19
18
|
taskManager.registerTask(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackgroundNotificationTasksModule.d.ts","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.ts"],"names":[],"mappings":";gCACoC,MAAM,GAAG,QAAQ,IAAI,CAAC;kCAGpB,MAAM,GAAG,QAAQ,IAAI,CAAC;;AAJ5D,wBAOE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackgroundNotificationTasksModule.js","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,CAAC,iBAAiB,CAAC,QAAgB;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,QAAgB;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["export default {\n async registerTaskAsync(taskName: string): Promise<null> {\n return null;\n },\n async unregisterTaskAsync(taskName: string): Promise<null> {\n return null;\n },\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationCategoriesModule.d.ts","sourceRoot":"","sources":["../src/NotificationCategoriesModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF,QAAA,MAAM,4BAA4B,EAAE,4BAYnC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
+
const notificationCategoriesModule = {
|
|
3
|
+
async getNotificationCategoriesAsync() {
|
|
4
|
+
return [];
|
|
5
|
+
},
|
|
6
|
+
async setNotificationCategoryAsync() {
|
|
7
|
+
throw new UnavailabilityError('Notifications', 'setNotificationCategoryAsync');
|
|
8
|
+
},
|
|
9
|
+
async deleteNotificationCategoryAsync() {
|
|
10
|
+
return false;
|
|
11
|
+
},
|
|
12
|
+
addListener() { },
|
|
13
|
+
removeListeners() { },
|
|
14
|
+
};
|
|
15
|
+
export default notificationCategoriesModule;
|
|
16
|
+
//# sourceMappingURL=NotificationCategoriesModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationCategoriesModule.js","sourceRoot":"","sources":["../src/NotificationCategoriesModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,4BAA4B,GAAiC;IACjE,KAAK,CAAC,8BAA8B;QAClC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK,CAAC,4BAA4B;QAChC,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,8BAA8B,CAAC,CAAC;IACjF,CAAC;IACD,KAAK,CAAC,+BAA+B;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,WAAW,KAAI,CAAC;IAChB,eAAe,KAAI,CAAC;CACrB,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport { NotificationCategoriesModule } from './NotificationCategoriesModule.types';\n\nconst notificationCategoriesModule: NotificationCategoriesModule = {\n async getNotificationCategoriesAsync() {\n return [];\n },\n async setNotificationCategoryAsync() {\n throw new UnavailabilityError('Notifications', 'setNotificationCategoryAsync');\n },\n async deleteNotificationCategoryAsync() {\n return false;\n },\n addListener() {},\n removeListeners() {},\n};\n\nexport default notificationCategoriesModule;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
2
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
3
3
|
/**
|
|
4
4
|
* Deletes the category associated with the provided identifier.
|
|
5
5
|
* @param identifier Identifier initially provided to `setNotificationCategoryAsync` when creating the category.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteNotificationCategoryAsync.js","sourceRoot":"","sources":["../src/deleteNotificationCategoryAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,
|
|
1
|
+
{"version":3,"file":"deleteNotificationCategoryAsync.js","sourceRoot":"","sources":["../src/deleteNotificationCategoryAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,+BAA+B,CAC3D,UAAkB;IAElB,IAAI,CAAC,4BAA4B,CAAC,+BAA+B,EAAE;QACjE,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,iCAAiC,CAAC,CAAC;KACnF;IAED,OAAO,MAAM,4BAA4B,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport NotificationCategoriesModule from './NotificationCategoriesModule';\n\n/**\n * Deletes the category associated with the provided identifier.\n * @param identifier Identifier initially provided to `setNotificationCategoryAsync` when creating the category.\n * @return A Promise which resolves to `true` if the category was successfully deleted, or `false` if it was not.\n * An example of when this method would return `false` is if you try to delete a category that doesn't exist.\n * @platform android\n * @platform ios\n * @header categories\n */\nexport default async function deleteNotificationCategoryAsync(\n identifier: string\n): Promise<boolean> {\n if (!NotificationCategoriesModule.deleteNotificationCategoryAsync) {\n throw new UnavailabilityError('Notifications', 'deleteNotificationCategoryAsync');\n }\n\n return await NotificationCategoriesModule.deleteNotificationCategoryAsync(identifier);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
2
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches information about all known notification categories.
|
|
5
5
|
* @return A Promise which resolves to an array of `NotificationCategory`s. On platforms that do not support notification channels,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNotificationCategoriesAsync.js","sourceRoot":"","sources":["../src/getNotificationCategoriesAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,
|
|
1
|
+
{"version":3,"file":"getNotificationCategoriesAsync.js","sourceRoot":"","sources":["../src/getNotificationCategoriesAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAG1E;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,8BAA8B;IAC1D,IAAI,CAAC,4BAA4B,CAAC,8BAA8B,EAAE;QAChE,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,gCAAgC,CAAC,CAAC;KAClF;IAED,OAAO,MAAM,4BAA4B,CAAC,8BAA8B,EAAE,CAAC;AAC7E,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport NotificationCategoriesModule from './NotificationCategoriesModule';\nimport { NotificationCategory } from './Notifications.types';\n\n/**\n * Fetches information about all known notification categories.\n * @return A Promise which resolves to an array of `NotificationCategory`s. On platforms that do not support notification channels,\n * it will always resolve to an empty array.\n * @platform android\n * @platform ios\n * @header categories\n */\nexport default async function getNotificationCategoriesAsync(): Promise<NotificationCategory[]> {\n if (!NotificationCategoriesModule.getNotificationCategoriesAsync) {\n throw new UnavailabilityError('Notifications', 'getNotificationCategoriesAsync');\n }\n\n return await NotificationCategoriesModule.getNotificationCategoriesAsync();\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule
|
|
2
|
+
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';
|
|
3
3
|
/**
|
|
4
4
|
* When a notification is received while the app is backgrounded, using this function you can set a callback that will be run in response to that notification.
|
|
5
5
|
* Under the hood, this function is run using `expo-task-manager`. You **must** define the task first, with [`TaskManager.defineTask`](./task-manager#taskmanagerdefinetasktaskname-taskexecutor).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerTaskAsync.js","sourceRoot":"","sources":["../src/registerTaskAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,iCAAiC,MAAM,
|
|
1
|
+
{"version":3,"file":"registerTaskAsync.js","sourceRoot":"","sources":["../src/registerTaskAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IAC9D,IAAI,CAAC,iCAAiC,CAAC,iBAAiB,EAAE;QACxD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;KACrE;IAED,OAAO,MAAM,iCAAiC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';\n\n/**\n * When a notification is received while the app is backgrounded, using this function you can set a callback that will be run in response to that notification.\n * Under the hood, this function is run using `expo-task-manager`. You **must** define the task first, with [`TaskManager.defineTask`](./task-manager#taskmanagerdefinetasktaskname-taskexecutor).\n * Make sure you define it in the global scope.\n *\n * The callback function you define with `TaskManager.defineTask` will receive an object with the following fields:\n * - `data`: The remote payload delivered by either FCM (Android) or APNs (iOS). See [`PushNotificationTrigger`](#pushnotificationtrigger) for details.\n * - `error`: The error (if any) that occurred during execution of the task.\n * - `executionInfo`: JSON object of additional info related to the task, including the `taskName`.\n * @param taskName The string you passed to `TaskManager.defineTask` as the `taskName` parameter.\n *\n * @example\n * ```ts\n * import * as TaskManager from 'expo-task-manager';\n * import * as Notifications from 'expo-notifications';\n *\n * const BACKGROUND_NOTIFICATION_TASK = 'BACKGROUND-NOTIFICATION-TASK';\n *\n * TaskManager.defineTask(BACKGROUND_NOTIFICATION_TASK, ({ data, error, executionInfo }) => {\n * console.log('Received a notification in the background!');\n * // Do something with the notification data\n * });\n *\n * Notifications.registerTaskAsync(BACKGROUND_NOTIFICATION_TASK);\n * ```\n * @header inBackground\n */\nexport default async function registerTaskAsync(taskName: string): Promise<null> {\n if (!BackgroundNotificationTasksModule.registerTaskAsync) {\n throw new UnavailabilityError('Notifications', 'registerTaskAsync');\n }\n\n return await BackgroundNotificationTasksModule.registerTaskAsync(taskName);\n}\n"]}
|
|
@@ -6,9 +6,10 @@ import { NotificationCategory, NotificationAction, NotificationCategoryOptions }
|
|
|
6
6
|
* > Don't use the characters `:` or `-` in your category identifier. If you do, categories might not work as expected.
|
|
7
7
|
* @param actions An array of [`NotificationAction`s](#notificationaction), which describe the actions associated with this category.
|
|
8
8
|
* @param options An optional object of additional configuration options for your category.
|
|
9
|
-
* @return A Promise which resolves to the category you just have created
|
|
9
|
+
* @return A Promise which resolves to the category you just have created, or null on web
|
|
10
10
|
* @platform android
|
|
11
11
|
* @platform ios
|
|
12
|
+
* @platform web
|
|
12
13
|
* @header categories
|
|
13
14
|
*/
|
|
14
15
|
export default function setNotificationCategoryAsync(identifier: string, actions: NotificationAction[], options?: NotificationCategoryOptions): Promise<NotificationCategory>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setNotificationCategoryAsync.d.ts","sourceRoot":"","sources":["../src/setNotificationCategoryAsync.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"setNotificationCategoryAsync.d.ts","sourceRoot":"","sources":["../src/setNotificationCategoryAsync.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;GAYG;AACH,wBAA8B,4BAA4B,CACxD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,EAAE,EAC7B,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,oBAAoB,CAAC,CAU/B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
2
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
3
3
|
/**
|
|
4
4
|
* Sets the new notification category.
|
|
5
5
|
* @param identifier A string to associate as the ID of this category. You will pass this string in as the `categoryIdentifier`
|
|
@@ -7,9 +7,10 @@ import NotificationCategoriesModule from './NotificationCategoriesModule.native'
|
|
|
7
7
|
* > Don't use the characters `:` or `-` in your category identifier. If you do, categories might not work as expected.
|
|
8
8
|
* @param actions An array of [`NotificationAction`s](#notificationaction), which describe the actions associated with this category.
|
|
9
9
|
* @param options An optional object of additional configuration options for your category.
|
|
10
|
-
* @return A Promise which resolves to the category you just have created
|
|
10
|
+
* @return A Promise which resolves to the category you just have created, or null on web
|
|
11
11
|
* @platform android
|
|
12
12
|
* @platform ios
|
|
13
|
+
* @platform web
|
|
13
14
|
* @header categories
|
|
14
15
|
*/
|
|
15
16
|
export default async function setNotificationCategoryAsync(identifier, actions, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setNotificationCategoryAsync.js","sourceRoot":"","sources":["../src/setNotificationCategoryAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,
|
|
1
|
+
{"version":3,"file":"setNotificationCategoryAsync.js","sourceRoot":"","sources":["../src/setNotificationCategoryAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAO1E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,4BAA4B,CACxD,UAAkB,EAClB,OAA6B,EAC7B,OAAqC;IAErC,IAAI,CAAC,4BAA4B,CAAC,4BAA4B,EAAE;QAC9D,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,8BAA8B,CAAC,CAAC;KAChF;IAED,OAAO,MAAM,4BAA4B,CAAC,4BAA4B,CACpE,UAAU,EACV,OAAO,EACP,OAAO,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport NotificationCategoriesModule from './NotificationCategoriesModule';\nimport {\n NotificationCategory,\n NotificationAction,\n NotificationCategoryOptions,\n} from './Notifications.types';\n\n/**\n * Sets the new notification category.\n * @param identifier A string to associate as the ID of this category. You will pass this string in as the `categoryIdentifier`\n * in your [`NotificationContent`](#notificationcontent) to associate a notification with this category.\n * > Don't use the characters `:` or `-` in your category identifier. If you do, categories might not work as expected.\n * @param actions An array of [`NotificationAction`s](#notificationaction), which describe the actions associated with this category.\n * @param options An optional object of additional configuration options for your category.\n * @return A Promise which resolves to the category you just have created, or null on web\n * @platform android\n * @platform ios\n * @platform web\n * @header categories\n */\nexport default async function setNotificationCategoryAsync(\n identifier: string,\n actions: NotificationAction[],\n options?: NotificationCategoryOptions\n): Promise<NotificationCategory> {\n if (!NotificationCategoriesModule.setNotificationCategoryAsync) {\n throw new UnavailabilityError('Notifications', 'setNotificationCategoryAsync');\n }\n\n return await NotificationCategoriesModule.setNotificationCategoryAsync(\n identifier,\n actions,\n options\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule
|
|
2
|
+
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';
|
|
3
3
|
/**
|
|
4
4
|
* Used to unregister tasks registered with `registerTaskAsync` method.
|
|
5
5
|
* @param taskName The string you passed to `registerTaskAsync` as the `taskName` parameter.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unregisterTaskAsync.js","sourceRoot":"","sources":["../src/unregisterTaskAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,iCAAiC,MAAM,
|
|
1
|
+
{"version":3,"file":"unregisterTaskAsync.js","sourceRoot":"","sources":["../src/unregisterTaskAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AAEpF;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IAChE,IAAI,CAAC,iCAAiC,CAAC,mBAAmB,EAAE;QAC1D,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,qBAAqB,CAAC,CAAC;KACvE;IAED,OAAO,MAAM,iCAAiC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';\n\n/**\n * Used to unregister tasks registered with `registerTaskAsync` method.\n * @param taskName The string you passed to `registerTaskAsync` as the `taskName` parameter.\n * @header inBackground\n */\nexport default async function unregisterTaskAsync(taskName: string): Promise<null> {\n if (!BackgroundNotificationTasksModule.unregisterTaskAsync) {\n throw new UnavailabilityError('Notifications', 'unregisterTaskAsync');\n }\n\n return await BackgroundNotificationTasksModule.unregisterTaskAsync(taskName);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.4",
|
|
4
4
|
"description": "Notifications module",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"expo": "*"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "7a41c3775e0f148087690a0e91f439ef270c2a5b"
|
|
59
59
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
+
|
|
3
|
+
import { NotificationCategoriesModule } from './NotificationCategoriesModule.types';
|
|
4
|
+
|
|
5
|
+
const notificationCategoriesModule: NotificationCategoriesModule = {
|
|
6
|
+
async getNotificationCategoriesAsync() {
|
|
7
|
+
return [];
|
|
8
|
+
},
|
|
9
|
+
async setNotificationCategoryAsync() {
|
|
10
|
+
throw new UnavailabilityError('Notifications', 'setNotificationCategoryAsync');
|
|
11
|
+
},
|
|
12
|
+
async deleteNotificationCategoryAsync() {
|
|
13
|
+
return false;
|
|
14
|
+
},
|
|
15
|
+
addListener() {},
|
|
16
|
+
removeListeners() {},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default notificationCategoriesModule;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
3
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Deletes the category associated with the provided identifier.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
3
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
4
4
|
import { NotificationCategory } from './Notifications.types';
|
|
5
5
|
|
|
6
6
|
/**
|
package/src/registerTaskAsync.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule
|
|
3
|
+
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* When a notification is received while the app is backgrounded, using this function you can set a callback that will be run in response to that notification.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
import NotificationCategoriesModule from './NotificationCategoriesModule
|
|
3
|
+
import NotificationCategoriesModule from './NotificationCategoriesModule';
|
|
4
4
|
import {
|
|
5
5
|
NotificationCategory,
|
|
6
6
|
NotificationAction,
|
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
* > Don't use the characters `:` or `-` in your category identifier. If you do, categories might not work as expected.
|
|
15
15
|
* @param actions An array of [`NotificationAction`s](#notificationaction), which describe the actions associated with this category.
|
|
16
16
|
* @param options An optional object of additional configuration options for your category.
|
|
17
|
-
* @return A Promise which resolves to the category you just have created
|
|
17
|
+
* @return A Promise which resolves to the category you just have created, or null on web
|
|
18
18
|
* @platform android
|
|
19
19
|
* @platform ios
|
|
20
|
+
* @platform web
|
|
20
21
|
* @header categories
|
|
21
22
|
*/
|
|
22
23
|
export default async function setNotificationCategoryAsync(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule
|
|
3
|
+
import BackgroundNotificationTasksModule from './BackgroundNotificationTasksModule';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Used to unregister tasks registered with `registerTaskAsync` method.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundNotificationTasksModule.web.d.ts","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.web.ts"],"names":[],"mappings":";gCACoC,MAAM,GAAG,QAAQ,IAAI,CAAC;kCAGpB,MAAM,GAAG,QAAQ,IAAI,CAAC;;AAJ5D,wBAOE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundNotificationTasksModule.web.js","sourceRoot":"","sources":["../src/BackgroundNotificationTasksModule.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,CAAC,iBAAiB,CAAC,QAAgB;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,QAAgB;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["export default {\n async registerTaskAsync(taskName: string): Promise<null> {\n return null;\n },\n async unregisterTaskAsync(taskName: string): Promise<null> {\n return null;\n },\n};\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { NotificationAction } from './Notifications.types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
getNotificationCategoriesAsync(): Promise<null>;
|
|
4
|
-
setNotificationCategoryAsync(identifier: string, actions: NotificationAction[], options?: object): Promise<null>;
|
|
5
|
-
deleteNotificationCategoryAsync(identifier: string): Promise<null>;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
8
|
-
//# sourceMappingURL=NotificationCategoriesModule.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCategoriesModule.web.d.ts","sourceRoot":"","sources":["../src/NotificationCategoriesModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;sCAGjB,QAAQ,IAAI,CAAC;6CAIvC,MAAM,WACT,kBAAkB,EAAE,YACnB,MAAM,GACf,QAAQ,IAAI,CAAC;gDAGkC,MAAM,GAAG,QAAQ,IAAI,CAAC;;AAX1E,wBAcE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
async getNotificationCategoriesAsync() {
|
|
3
|
-
return null;
|
|
4
|
-
},
|
|
5
|
-
async setNotificationCategoryAsync(identifier, actions, options) {
|
|
6
|
-
return null;
|
|
7
|
-
},
|
|
8
|
-
async deleteNotificationCategoryAsync(identifier) {
|
|
9
|
-
return null;
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=NotificationCategoriesModule.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCategoriesModule.web.js","sourceRoot":"","sources":["../src/NotificationCategoriesModule.web.ts"],"names":[],"mappings":"AAEA,eAAe;IACb,KAAK,CAAC,8BAA8B;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,4BAA4B,CAChC,UAAkB,EAClB,OAA6B,EAC7B,OAAgB;QAEhB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,+BAA+B,CAAC,UAAkB;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["import { NotificationAction } from './Notifications.types';\n\nexport default {\n async getNotificationCategoriesAsync(): Promise<null> {\n return null;\n },\n async setNotificationCategoryAsync(\n identifier: string,\n actions: NotificationAction[],\n options?: object\n ): Promise<null> {\n return null;\n },\n async deleteNotificationCategoryAsync(identifier: string): Promise<null> {\n return null;\n },\n};\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NotificationAction } from './Notifications.types';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
async getNotificationCategoriesAsync(): Promise<null> {
|
|
5
|
-
return null;
|
|
6
|
-
},
|
|
7
|
-
async setNotificationCategoryAsync(
|
|
8
|
-
identifier: string,
|
|
9
|
-
actions: NotificationAction[],
|
|
10
|
-
options?: object
|
|
11
|
-
): Promise<null> {
|
|
12
|
-
return null;
|
|
13
|
-
},
|
|
14
|
-
async deleteNotificationCategoryAsync(identifier: string): Promise<null> {
|
|
15
|
-
return null;
|
|
16
|
-
},
|
|
17
|
-
};
|
/package/src/{BackgroundNotificationTasksModule.web.ts → BackgroundNotificationTasksModule.ts}
RENAMED
|
File without changes
|