@symbiote-native/notifications 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +258 -0
- package/build/angular/index.d.ts +1 -0
- package/build/angular/index.js +1 -0
- package/build/core/background-task.d.ts +9 -0
- package/build/core/background-task.js +28 -0
- package/build/core/badge.d.ts +7 -0
- package/build/core/badge.js +23 -0
- package/build/core/categories.d.ts +10 -0
- package/build/core/categories.js +28 -0
- package/build/core/channels.d.ts +20 -0
- package/build/core/channels.js +106 -0
- package/build/core/emitter.d.ts +24 -0
- package/build/core/emitter.js +58 -0
- package/build/core/handler.d.ts +15 -0
- package/build/core/handler.js +50 -0
- package/build/core/index.d.ts +12 -0
- package/build/core/index.js +11 -0
- package/build/core/native-modules.d.ts +82 -0
- package/build/core/native-modules.js +33 -0
- package/build/core/permissions.d.ts +8 -0
- package/build/core/permissions.js +30 -0
- package/build/core/presenter.d.ts +7 -0
- package/build/core/presenter.js +27 -0
- package/build/core/scheduler.d.ts +13 -0
- package/build/core/scheduler.js +193 -0
- package/build/core/tokens.d.ts +30 -0
- package/build/core/tokens.js +192 -0
- package/build/core/types.d.ts +633 -0
- package/build/core/types.js +116 -0
- package/build/core/utils.d.ts +6 -0
- package/build/core/utils.js +53 -0
- package/build-ngc/angular/index.d.ts +1 -0
- package/build-ngc/angular/index.js +2 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/core/background-task.d.ts +9 -0
- package/build-ngc/core/background-task.js +29 -0
- package/build-ngc/core/background-task.js.map +1 -0
- package/build-ngc/core/badge.d.ts +7 -0
- package/build-ngc/core/badge.js +24 -0
- package/build-ngc/core/badge.js.map +1 -0
- package/build-ngc/core/categories.d.ts +10 -0
- package/build-ngc/core/categories.js +29 -0
- package/build-ngc/core/categories.js.map +1 -0
- package/build-ngc/core/channels.d.ts +20 -0
- package/build-ngc/core/channels.js +107 -0
- package/build-ngc/core/channels.js.map +1 -0
- package/build-ngc/core/emitter.d.ts +24 -0
- package/build-ngc/core/emitter.js +59 -0
- package/build-ngc/core/emitter.js.map +1 -0
- package/build-ngc/core/handler.d.ts +15 -0
- package/build-ngc/core/handler.js +51 -0
- package/build-ngc/core/handler.js.map +1 -0
- package/build-ngc/core/index.d.ts +12 -0
- package/build-ngc/core/index.js +12 -0
- package/build-ngc/core/index.js.map +1 -0
- package/build-ngc/core/native-modules.d.ts +82 -0
- package/build-ngc/core/native-modules.js +34 -0
- package/build-ngc/core/native-modules.js.map +1 -0
- package/build-ngc/core/permissions.d.ts +8 -0
- package/build-ngc/core/permissions.js +31 -0
- package/build-ngc/core/permissions.js.map +1 -0
- package/build-ngc/core/presenter.d.ts +7 -0
- package/build-ngc/core/presenter.js +28 -0
- package/build-ngc/core/presenter.js.map +1 -0
- package/build-ngc/core/scheduler.d.ts +13 -0
- package/build-ngc/core/scheduler.js +194 -0
- package/build-ngc/core/scheduler.js.map +1 -0
- package/build-ngc/core/tokens.d.ts +30 -0
- package/build-ngc/core/tokens.js +193 -0
- package/build-ngc/core/tokens.js.map +1 -0
- package/build-ngc/core/types.d.ts +633 -0
- package/build-ngc/core/types.js +117 -0
- package/build-ngc/core/types.js.map +1 -0
- package/build-ngc/core/utils.d.ts +6 -0
- package/build-ngc/core/utils.js +54 -0
- package/build-ngc/core/utils.js.map +1 -0
- package/native-link.json +88 -0
- package/package.json +150 -0
- package/src/angular/index.ts +1 -0
- package/src/core/background-task.ts +32 -0
- package/src/core/badge.ts +26 -0
- package/src/core/categories.ts +60 -0
- package/src/core/channels.ts +183 -0
- package/src/core/emitter.ts +95 -0
- package/src/core/handler.ts +95 -0
- package/src/core/index.ts +144 -0
- package/src/core/native-modules.ts +209 -0
- package/src/core/permissions.ts +46 -0
- package/src/core/presenter.ts +45 -0
- package/src/core/scheduler.ts +265 -0
- package/src/core/tokens.ts +272 -0
- package/src/core/types.ts +767 -0
- package/src/core/utils.ts +82 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// Ported from expo-notifications @ sdk-57's get/set/deleteNotificationChannel(Group)Async.ts —
|
|
2
|
+
// upstream splits each of these into a `.ts` (iOS no-op) and a `.android.ts` (real) file picked
|
|
3
|
+
// by Metro's platform extension resolution; this port collapses each pair into one function with
|
|
4
|
+
// a runtime `Platform.OS === 'android'` branch, since this package has no separate build step
|
|
5
|
+
// per platform to exploit the file-split for.
|
|
6
|
+
import { Platform, UnavailabilityError } from 'expo-modules-core';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
notificationChannelGroupManager,
|
|
10
|
+
notificationChannelManager,
|
|
11
|
+
} from './native-modules';
|
|
12
|
+
import {
|
|
13
|
+
AndroidImportance,
|
|
14
|
+
type INotificationChannel,
|
|
15
|
+
type INotificationChannelGroup,
|
|
16
|
+
type INotificationChannelGroupInput,
|
|
17
|
+
type INotificationChannelInput,
|
|
18
|
+
} from './types';
|
|
19
|
+
|
|
20
|
+
const ANDROID_ONLY_NOTICE =
|
|
21
|
+
'Notification channels are only supported on Android.';
|
|
22
|
+
|
|
23
|
+
function isAndroid(): boolean {
|
|
24
|
+
return Platform.OS === 'android';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @platform android — empty array on every other platform. */
|
|
28
|
+
export async function getNotificationChannelsAsync(): Promise<
|
|
29
|
+
INotificationChannel[]
|
|
30
|
+
> {
|
|
31
|
+
if (!isAndroid()) {
|
|
32
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
if (!notificationChannelManager.getNotificationChannelsAsync) {
|
|
36
|
+
throw new UnavailabilityError(
|
|
37
|
+
'Notifications',
|
|
38
|
+
'getNotificationChannelsAsync',
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
(await notificationChannelManager.getNotificationChannelsAsync()) ?? []
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @platform android — `null` on every other platform. */
|
|
47
|
+
export async function getNotificationChannelAsync(
|
|
48
|
+
channelId: string,
|
|
49
|
+
): Promise<INotificationChannel | null> {
|
|
50
|
+
if (!isAndroid()) {
|
|
51
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
if (!notificationChannelManager.getNotificationChannelAsync) {
|
|
55
|
+
throw new UnavailabilityError(
|
|
56
|
+
'Notifications',
|
|
57
|
+
'getNotificationChannelAsync',
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return notificationChannelManager.getNotificationChannelAsync(channelId);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Creates or updates a channel. Only the name and description may change once a channel
|
|
65
|
+
* exists — an Android OS limitation. @platform android — `null` on every other platform.
|
|
66
|
+
*/
|
|
67
|
+
export async function setNotificationChannelAsync(
|
|
68
|
+
channelId: string,
|
|
69
|
+
channel: INotificationChannelInput,
|
|
70
|
+
): Promise<INotificationChannel | null> {
|
|
71
|
+
if (!isAndroid()) {
|
|
72
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
if (!notificationChannelManager.setNotificationChannelAsync) {
|
|
76
|
+
throw new UnavailabilityError(
|
|
77
|
+
'Notifications',
|
|
78
|
+
'setNotificationChannelAsync',
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (channel.importance === AndroidImportance.UNSPECIFIED) {
|
|
82
|
+
console.warn(
|
|
83
|
+
`[notifications] Channel "${channelId}" importance is UNSPECIFIED, which can error on some Android versions — use AndroidImportance.DEFAULT instead.`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return notificationChannelManager.setNotificationChannelAsync(
|
|
87
|
+
channelId,
|
|
88
|
+
channel,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @platform android — no-op on every other platform. */
|
|
93
|
+
export async function deleteNotificationChannelAsync(
|
|
94
|
+
channelId: string,
|
|
95
|
+
): Promise<void> {
|
|
96
|
+
if (!isAndroid()) {
|
|
97
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!notificationChannelManager.deleteNotificationChannelAsync) {
|
|
101
|
+
throw new UnavailabilityError(
|
|
102
|
+
'Notifications',
|
|
103
|
+
'deleteNotificationChannelAsync',
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return notificationChannelManager.deleteNotificationChannelAsync(channelId);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @platform android — empty array on every other platform. */
|
|
110
|
+
export async function getNotificationChannelGroupsAsync(): Promise<
|
|
111
|
+
INotificationChannelGroup[]
|
|
112
|
+
> {
|
|
113
|
+
if (!isAndroid()) {
|
|
114
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
if (!notificationChannelGroupManager.getNotificationChannelGroupsAsync) {
|
|
118
|
+
throw new UnavailabilityError(
|
|
119
|
+
'Notifications',
|
|
120
|
+
'getNotificationChannelGroupsAsync',
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
return notificationChannelGroupManager.getNotificationChannelGroupsAsync();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @platform android — `null` on every other platform. */
|
|
127
|
+
export async function getNotificationChannelGroupAsync(
|
|
128
|
+
groupId: string,
|
|
129
|
+
): Promise<INotificationChannelGroup | null> {
|
|
130
|
+
if (!isAndroid()) {
|
|
131
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
if (!notificationChannelGroupManager.getNotificationChannelGroupAsync) {
|
|
135
|
+
throw new UnavailabilityError(
|
|
136
|
+
'Notifications',
|
|
137
|
+
'getNotificationChannelGroupAsync',
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
return notificationChannelGroupManager.getNotificationChannelGroupAsync(
|
|
141
|
+
groupId,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** @platform android — `null` on every other platform. */
|
|
146
|
+
export async function setNotificationChannelGroupAsync(
|
|
147
|
+
groupId: string,
|
|
148
|
+
group: INotificationChannelGroupInput,
|
|
149
|
+
): Promise<INotificationChannelGroup | null> {
|
|
150
|
+
if (!isAndroid()) {
|
|
151
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
if (!notificationChannelGroupManager.setNotificationChannelGroupAsync) {
|
|
155
|
+
throw new UnavailabilityError(
|
|
156
|
+
'Notifications',
|
|
157
|
+
'setNotificationChannelGroupAsync',
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return notificationChannelGroupManager.setNotificationChannelGroupAsync(
|
|
161
|
+
groupId,
|
|
162
|
+
group,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** @platform android — no-op on every other platform. */
|
|
167
|
+
export async function deleteNotificationChannelGroupAsync(
|
|
168
|
+
groupId: string,
|
|
169
|
+
): Promise<void> {
|
|
170
|
+
if (!isAndroid()) {
|
|
171
|
+
console.debug(ANDROID_ONLY_NOTICE);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (!notificationChannelGroupManager.deleteNotificationChannelGroupAsync) {
|
|
175
|
+
throw new UnavailabilityError(
|
|
176
|
+
'Notifications',
|
|
177
|
+
'deleteNotificationChannelGroupAsync',
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return notificationChannelGroupManager.deleteNotificationChannelGroupAsync(
|
|
181
|
+
groupId,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Ported from expo-notifications @ sdk-57's NotificationsEmitter.ts.
|
|
2
|
+
import {
|
|
3
|
+
LegacyEventEmitter,
|
|
4
|
+
UnavailabilityError,
|
|
5
|
+
type EventSubscription,
|
|
6
|
+
} from 'expo-modules-core';
|
|
7
|
+
|
|
8
|
+
import { dlog } from '@symbiote-native/engine';
|
|
9
|
+
|
|
10
|
+
import { notificationsEmitterModule } from './native-modules';
|
|
11
|
+
import type { INotification, INotificationResponse } from './types';
|
|
12
|
+
import { mapNotification, mapNotificationResponse } from './utils';
|
|
13
|
+
|
|
14
|
+
const emitter = new LegacyEventEmitter(notificationsEmitterModule);
|
|
15
|
+
|
|
16
|
+
const RECEIVED_EVENT = 'onDidReceiveNotification';
|
|
17
|
+
const DROPPED_EVENT = 'onNotificationsDeleted';
|
|
18
|
+
const RESPONSE_RECEIVED_EVENT = 'onDidReceiveNotificationResponse';
|
|
19
|
+
const RESPONSE_CLEARED_EVENT = 'onDidClearNotificationResponse';
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_ACTION_IDENTIFIER =
|
|
22
|
+
'expo.modules.notifications.actions.DEFAULT';
|
|
23
|
+
|
|
24
|
+
/** Fires whenever a notification is received while the app is running. */
|
|
25
|
+
export function addNotificationReceivedListener(
|
|
26
|
+
listener: (event: INotification) => void,
|
|
27
|
+
): EventSubscription {
|
|
28
|
+
return emitter.addListener<INotification>(RECEIVED_EVENT, notification => {
|
|
29
|
+
dlog(() => `[notifications] received ${notification.request.identifier}`);
|
|
30
|
+
listener(mapNotification(notification));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Fires whenever the server (Firebase Cloud Messaging) dropped queued notifications.
|
|
36
|
+
* @platform android
|
|
37
|
+
*/
|
|
38
|
+
export function addNotificationsDroppedListener(
|
|
39
|
+
listener: () => void,
|
|
40
|
+
): EventSubscription {
|
|
41
|
+
return emitter.addListener<void>(DROPPED_EVENT, listener);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Fires whenever the user interacts with a notification (e.g. taps it). */
|
|
45
|
+
export function addNotificationResponseReceivedListener(
|
|
46
|
+
listener: (event: INotificationResponse) => void,
|
|
47
|
+
): EventSubscription {
|
|
48
|
+
return emitter.addListener<INotificationResponse>(
|
|
49
|
+
RESPONSE_RECEIVED_EVENT,
|
|
50
|
+
response => {
|
|
51
|
+
dlog(
|
|
52
|
+
() =>
|
|
53
|
+
`[notifications] response ${response.actionIdentifier} for ${response.notification.request.identifier}`,
|
|
54
|
+
);
|
|
55
|
+
listener(mapNotificationResponse(response));
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The most recently received notification response, or `null` if the app was not opened by
|
|
62
|
+
* one.
|
|
63
|
+
*/
|
|
64
|
+
export function getLastNotificationResponse(): INotificationResponse | null {
|
|
65
|
+
if (!notificationsEmitterModule.getLastNotificationResponse) {
|
|
66
|
+
throw new UnavailabilityError(
|
|
67
|
+
'Notifications',
|
|
68
|
+
'getLastNotificationResponse',
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
const response = notificationsEmitterModule.getLastNotificationResponse();
|
|
72
|
+
return response ? mapNotificationResponse(response) : response;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Clears the last notification response, e.g. once its route has been handled and should not
|
|
77
|
+
* be re-applied on the next read.
|
|
78
|
+
*/
|
|
79
|
+
export function clearLastNotificationResponse(): void {
|
|
80
|
+
if (!notificationsEmitterModule.clearLastNotificationResponse) {
|
|
81
|
+
throw new UnavailabilityError(
|
|
82
|
+
'Notifications',
|
|
83
|
+
'clearLastNotificationResponse',
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
notificationsEmitterModule.clearLastNotificationResponse();
|
|
87
|
+
emitter.emit(RESPONSE_CLEARED_EVENT, []);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Fires whenever `clearLastNotificationResponse` runs. */
|
|
91
|
+
export function addNotificationResponseClearedListener(
|
|
92
|
+
listener: () => void,
|
|
93
|
+
): EventSubscription {
|
|
94
|
+
return emitter.addListener<void>(RESPONSE_CLEARED_EVENT, listener);
|
|
95
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Ported from expo-notifications @ sdk-57's NotificationsHandler.ts.
|
|
2
|
+
import {
|
|
3
|
+
CodedError,
|
|
4
|
+
LegacyEventEmitter,
|
|
5
|
+
type EventSubscription,
|
|
6
|
+
} from 'expo-modules-core';
|
|
7
|
+
|
|
8
|
+
import { dlog } from '@symbiote-native/engine';
|
|
9
|
+
|
|
10
|
+
import { notificationsHandlerModule } from './native-modules';
|
|
11
|
+
import type {
|
|
12
|
+
INotification,
|
|
13
|
+
INotificationBehavior,
|
|
14
|
+
INotificationHandler,
|
|
15
|
+
} from './types';
|
|
16
|
+
import { mapNotification } from './utils';
|
|
17
|
+
|
|
18
|
+
export class NotificationTimeoutError extends CodedError {
|
|
19
|
+
override info: { notification: INotification; id: string };
|
|
20
|
+
constructor(notificationId: string, notification: INotification) {
|
|
21
|
+
super(
|
|
22
|
+
'ERR_NOTIFICATION_TIMEOUT',
|
|
23
|
+
`Notification handling timed out for ID ${notificationId}.`,
|
|
24
|
+
);
|
|
25
|
+
this.info = { id: notificationId, notification };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type IHandleNotificationEvent = { id: string; notification: INotification };
|
|
30
|
+
|
|
31
|
+
const emitter = new LegacyEventEmitter(notificationsHandlerModule);
|
|
32
|
+
const HANDLE_EVENT = 'onHandleNotification';
|
|
33
|
+
const HANDLE_TIMEOUT_EVENT = 'onHandleNotificationTimeout';
|
|
34
|
+
|
|
35
|
+
let handleSubscription: EventSubscription | null = null;
|
|
36
|
+
let handleTimeoutSubscription: EventSubscription | null = null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the callback deciding whether/how a notification received while the app is running
|
|
40
|
+
* should be shown. Must respond within 3 seconds or the notification is discarded. Passing
|
|
41
|
+
* `null` clears the handler — the default (no handler) is to not show anything.
|
|
42
|
+
*/
|
|
43
|
+
export function setNotificationHandler(
|
|
44
|
+
handler: INotificationHandler | null,
|
|
45
|
+
): void {
|
|
46
|
+
handleSubscription?.remove();
|
|
47
|
+
handleSubscription = null;
|
|
48
|
+
handleTimeoutSubscription?.remove();
|
|
49
|
+
handleTimeoutSubscription = null;
|
|
50
|
+
|
|
51
|
+
if (!handler) return;
|
|
52
|
+
|
|
53
|
+
dlog('[notifications] setNotificationHandler');
|
|
54
|
+
|
|
55
|
+
handleSubscription = emitter.addListener<IHandleNotificationEvent>(
|
|
56
|
+
HANDLE_EVENT,
|
|
57
|
+
async ({ id, notification }) => {
|
|
58
|
+
if (!notificationsHandlerModule.handleNotificationAsync) {
|
|
59
|
+
handler.handleError?.(
|
|
60
|
+
id,
|
|
61
|
+
new Error(
|
|
62
|
+
'handleNotificationAsync is not available on this platform',
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const behavior: INotificationBehavior =
|
|
69
|
+
await handler.handleNotification(mapNotification(notification));
|
|
70
|
+
if (behavior.shouldShowAlert) {
|
|
71
|
+
console.warn(
|
|
72
|
+
'[notifications] `shouldShowAlert` is deprecated — specify `shouldShowBanner` and/or `shouldShowList` instead.',
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
await notificationsHandlerModule.handleNotificationAsync(id, behavior);
|
|
76
|
+
dlog(() => `[notifications] handled ${id}`);
|
|
77
|
+
handler.handleSuccess?.(id);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
handler.handleError?.(
|
|
80
|
+
id,
|
|
81
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
handleTimeoutSubscription = emitter.addListener<IHandleNotificationEvent>(
|
|
88
|
+
HANDLE_TIMEOUT_EVENT,
|
|
89
|
+
({ id, notification }) =>
|
|
90
|
+
handler.handleError?.(
|
|
91
|
+
id,
|
|
92
|
+
new NotificationTimeoutError(id, mapNotification(notification)),
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export { getPermissionsAsync, requestPermissionsAsync } from './permissions';
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
addPushTokenListener,
|
|
5
|
+
getDevicePushTokenAsync,
|
|
6
|
+
getExpoPushTokenAsync,
|
|
7
|
+
setAutoServerRegistrationEnabledAsync,
|
|
8
|
+
subscribeToTopicAsync,
|
|
9
|
+
unregisterForNotificationsAsync,
|
|
10
|
+
unsubscribeFromTopicAsync,
|
|
11
|
+
type IPushTokenListener,
|
|
12
|
+
} from './tokens';
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
dismissAllNotificationsAsync,
|
|
16
|
+
dismissNotificationAsync,
|
|
17
|
+
getPresentedNotificationsAsync,
|
|
18
|
+
} from './presenter';
|
|
19
|
+
|
|
20
|
+
export { getBadgeCountAsync, setBadgeCountAsync } from './badge';
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
cancelAllScheduledNotificationsAsync,
|
|
24
|
+
cancelScheduledNotificationAsync,
|
|
25
|
+
getAllScheduledNotificationsAsync,
|
|
26
|
+
getNextTriggerDateAsync,
|
|
27
|
+
scheduleNotificationAsync,
|
|
28
|
+
} from './scheduler';
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
deleteNotificationCategoryAsync,
|
|
32
|
+
getNotificationCategoriesAsync,
|
|
33
|
+
setNotificationCategoryAsync,
|
|
34
|
+
} from './categories';
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
deleteNotificationChannelAsync,
|
|
38
|
+
deleteNotificationChannelGroupAsync,
|
|
39
|
+
getNotificationChannelAsync,
|
|
40
|
+
getNotificationChannelGroupAsync,
|
|
41
|
+
getNotificationChannelGroupsAsync,
|
|
42
|
+
getNotificationChannelsAsync,
|
|
43
|
+
setNotificationChannelAsync,
|
|
44
|
+
setNotificationChannelGroupAsync,
|
|
45
|
+
} from './channels';
|
|
46
|
+
|
|
47
|
+
export { NotificationTimeoutError, setNotificationHandler } from './handler';
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
DEFAULT_ACTION_IDENTIFIER,
|
|
51
|
+
addNotificationReceivedListener,
|
|
52
|
+
addNotificationResponseClearedListener,
|
|
53
|
+
addNotificationResponseReceivedListener,
|
|
54
|
+
addNotificationsDroppedListener,
|
|
55
|
+
clearLastNotificationResponse,
|
|
56
|
+
getLastNotificationResponse,
|
|
57
|
+
} from './emitter';
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
BackgroundNotificationTaskResult,
|
|
61
|
+
registerTaskAsync,
|
|
62
|
+
unregisterTaskAsync,
|
|
63
|
+
} from './background-task';
|
|
64
|
+
|
|
65
|
+
export type {
|
|
66
|
+
IAudioAttributes,
|
|
67
|
+
IAudioAttributesInput,
|
|
68
|
+
IBeaconRegion,
|
|
69
|
+
ICalendarNotificationTrigger,
|
|
70
|
+
ICalendarTriggerInput,
|
|
71
|
+
IChannelAwareTriggerInput,
|
|
72
|
+
ICircularRegion,
|
|
73
|
+
IDailyNotificationTrigger,
|
|
74
|
+
IDailyTriggerInput,
|
|
75
|
+
IDateTriggerInput,
|
|
76
|
+
IDevicePushToken,
|
|
77
|
+
IExpoPushToken,
|
|
78
|
+
IExpoPushTokenOptions,
|
|
79
|
+
IFirebaseRemoteMessage,
|
|
80
|
+
IFirebaseRemoteMessageNotification,
|
|
81
|
+
IInterruptionLevel,
|
|
82
|
+
IIosNotificationPermissionsRequest,
|
|
83
|
+
ILocationNotificationTrigger,
|
|
84
|
+
IMaybeNotificationResponse,
|
|
85
|
+
IMonthlyNotificationTrigger,
|
|
86
|
+
IMonthlyTriggerInput,
|
|
87
|
+
INativeCalendarTriggerInput,
|
|
88
|
+
INativeChannelAwareTriggerInput,
|
|
89
|
+
INativeDailyTriggerInput,
|
|
90
|
+
INativeDateTriggerInput,
|
|
91
|
+
INativeDevicePushToken,
|
|
92
|
+
INativeMonthlyTriggerInput,
|
|
93
|
+
INativeNotificationTriggerInput,
|
|
94
|
+
INativeTimeIntervalTriggerInput,
|
|
95
|
+
INativeWeeklyTriggerInput,
|
|
96
|
+
INativeYearlyTriggerInput,
|
|
97
|
+
INotification,
|
|
98
|
+
INotificationAction,
|
|
99
|
+
INotificationBehavior,
|
|
100
|
+
INotificationCategory,
|
|
101
|
+
INotificationCategoryOptions,
|
|
102
|
+
INotificationChannel,
|
|
103
|
+
INotificationChannelGroup,
|
|
104
|
+
INotificationChannelGroupInput,
|
|
105
|
+
INotificationChannelInput,
|
|
106
|
+
INotificationContent,
|
|
107
|
+
INotificationContentAndroid,
|
|
108
|
+
INotificationContentAttachmentIos,
|
|
109
|
+
INotificationContentInput,
|
|
110
|
+
INotificationContentIos,
|
|
111
|
+
INotificationHandler,
|
|
112
|
+
INotificationPermissionsRequest,
|
|
113
|
+
INotificationPermissionsStatus,
|
|
114
|
+
INotificationRequest,
|
|
115
|
+
INotificationRequestInput,
|
|
116
|
+
INotificationResponse,
|
|
117
|
+
INotificationTaskPayload,
|
|
118
|
+
INotificationTrigger,
|
|
119
|
+
INotificationTriggerInput,
|
|
120
|
+
IPushNotificationTrigger,
|
|
121
|
+
IRegion,
|
|
122
|
+
ISchedulableNotificationTriggerInput,
|
|
123
|
+
ITimeIntervalNotificationTrigger,
|
|
124
|
+
ITimeIntervalTriggerInput,
|
|
125
|
+
IUnknownNotificationTrigger,
|
|
126
|
+
IWeeklyNotificationTrigger,
|
|
127
|
+
IWeeklyTriggerInput,
|
|
128
|
+
IYearlyNotificationTrigger,
|
|
129
|
+
IYearlyTriggerInput,
|
|
130
|
+
PermissionExpiration,
|
|
131
|
+
PermissionResponse,
|
|
132
|
+
} from './types';
|
|
133
|
+
export {
|
|
134
|
+
AndroidAudioContentType,
|
|
135
|
+
AndroidAudioUsage,
|
|
136
|
+
AndroidImportance,
|
|
137
|
+
AndroidNotificationPriority,
|
|
138
|
+
AndroidNotificationVisibility,
|
|
139
|
+
IosAlertStyle,
|
|
140
|
+
IosAllowsPreviews,
|
|
141
|
+
IosAuthorizationStatus,
|
|
142
|
+
PermissionStatus,
|
|
143
|
+
SchedulableTriggerInputTypes,
|
|
144
|
+
} from './types';
|