@ammarahmed/notifee-react-native 7.3.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/.gitattributes +3 -0
- package/LICENSE +44 -0
- package/README.md +131 -0
- package/RNNotifee.podspec +39 -0
- package/RNNotifeeCore.podspec +33 -0
- package/android/build.gradle +116 -0
- package/android/gradle.properties +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.aar +0 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.md5 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha1 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha256 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.aar.sha512 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.pom +9 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.md5 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha1 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha256 +1 -0
- package/android/libs/app/notifee/core/202108261756/core-202108261756.pom.sha512 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml +13 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.md5 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha1 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha256 +1 -0
- package/android/libs/app/notifee/core/maven-metadata.xml.sha512 +1 -0
- package/android/lint.xml +5 -0
- package/android/proguard-rules.pro +74 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +12 -0
- package/android/src/main/java/io/invertase/notifee/NotifeeApiModule.java +349 -0
- package/android/src/main/java/io/invertase/notifee/NotifeeEventSubscriber.java +118 -0
- package/android/src/main/java/io/invertase/notifee/NotifeeInitProvider.java +55 -0
- package/android/src/main/java/io/invertase/notifee/NotifeePackage.java +30 -0
- package/android/src/main/java/io/invertase/notifee/NotifeeReactUtils.java +244 -0
- package/app.plugin.js +1 -0
- package/dist/NotifeeApiModule.d.ts +53 -0
- package/dist/NotifeeApiModule.js +607 -0
- package/dist/NotifeeApiModule.js.map +1 -0
- package/dist/NotifeeJSEventEmitter.d.ts +3 -0
- package/dist/NotifeeJSEventEmitter.js +14 -0
- package/dist/NotifeeJSEventEmitter.js.map +1 -0
- package/dist/NotifeeNativeError.d.ts +15 -0
- package/dist/NotifeeNativeError.js +61 -0
- package/dist/NotifeeNativeError.js.map +1 -0
- package/dist/NotifeeNativeModule.d.ts +14 -0
- package/dist/NotifeeNativeModule.js +43 -0
- package/dist/NotifeeNativeModule.js.map +1 -0
- package/dist/NotifeeNativeModule.web.d.ts +12 -0
- package/dist/NotifeeNativeModule.web.js +19 -0
- package/dist/NotifeeNativeModule.web.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/types/Library.d.ts +21 -0
- package/dist/types/Library.js +6 -0
- package/dist/types/Library.js.map +1 -0
- package/dist/types/Module.d.ts +572 -0
- package/dist/types/Module.js +6 -0
- package/dist/types/Module.js.map +1 -0
- package/dist/types/Notification.d.ts +450 -0
- package/dist/types/Notification.js +105 -0
- package/dist/types/Notification.js.map +1 -0
- package/dist/types/NotificationAndroid.d.ts +1276 -0
- package/dist/types/NotificationAndroid.js +380 -0
- package/dist/types/NotificationAndroid.js.map +1 -0
- package/dist/types/NotificationIOS.d.ts +537 -0
- package/dist/types/NotificationIOS.js +92 -0
- package/dist/types/NotificationIOS.js.map +1 -0
- package/dist/types/NotificationWeb.d.ts +5 -0
- package/dist/types/NotificationWeb.js +3 -0
- package/dist/types/NotificationWeb.js.map +1 -0
- package/dist/types/PowerManagerInfo.d.ts +36 -0
- package/dist/types/PowerManagerInfo.js +6 -0
- package/dist/types/PowerManagerInfo.js.map +1 -0
- package/dist/types/Trigger.d.ts +108 -0
- package/dist/types/Trigger.js +39 -0
- package/dist/types/Trigger.js.map +1 -0
- package/dist/utils/id.d.ts +1 -0
- package/dist/utils/id.js +16 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +52 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/validate.d.ts +15 -0
- package/dist/utils/validate.js +93 -0
- package/dist/utils/validate.js.map +1 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.d.ts +2 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js +39 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfo.js.map +1 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.d.ts +2 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js +27 -0
- package/dist/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.js.map +1 -0
- package/dist/validators/validate.d.ts +25 -0
- package/dist/validators/validate.js +75 -0
- package/dist/validators/validate.js.map +1 -0
- package/dist/validators/validateAndroidAction.d.ts +2 -0
- package/dist/validators/validateAndroidAction.js +52 -0
- package/dist/validators/validateAndroidAction.js.map +1 -0
- package/dist/validators/validateAndroidChannel.d.ts +2 -0
- package/dist/validators/validateAndroidChannel.js +155 -0
- package/dist/validators/validateAndroidChannel.js.map +1 -0
- package/dist/validators/validateAndroidChannelGroup.d.ts +2 -0
- package/dist/validators/validateAndroidChannelGroup.js +42 -0
- package/dist/validators/validateAndroidChannelGroup.js.map +1 -0
- package/dist/validators/validateAndroidFullScreenAction.d.ts +2 -0
- package/dist/validators/validateAndroidFullScreenAction.js +50 -0
- package/dist/validators/validateAndroidFullScreenAction.js.map +1 -0
- package/dist/validators/validateAndroidInput.d.ts +2 -0
- package/dist/validators/validateAndroidInput.js +54 -0
- package/dist/validators/validateAndroidInput.js.map +1 -0
- package/dist/validators/validateAndroidNotification.d.ts +2 -0
- package/dist/validators/validateAndroidNotification.js +529 -0
- package/dist/validators/validateAndroidNotification.js.map +1 -0
- package/dist/validators/validateAndroidPressAction.d.ts +2 -0
- package/dist/validators/validateAndroidPressAction.js +50 -0
- package/dist/validators/validateAndroidPressAction.js.map +1 -0
- package/dist/validators/validateAndroidStyle.d.ts +22 -0
- package/dist/validators/validateAndroidStyle.js +231 -0
- package/dist/validators/validateAndroidStyle.js.map +1 -0
- package/dist/validators/validateIOSAttachment.d.ts +6 -0
- package/dist/validators/validateIOSAttachment.js +102 -0
- package/dist/validators/validateIOSAttachment.js.map +1 -0
- package/dist/validators/validateIOSCategory.d.ts +2 -0
- package/dist/validators/validateIOSCategory.js +124 -0
- package/dist/validators/validateIOSCategory.js.map +1 -0
- package/dist/validators/validateIOSCategoryAction.d.ts +2 -0
- package/dist/validators/validateIOSCategoryAction.js +59 -0
- package/dist/validators/validateIOSCategoryAction.js.map +1 -0
- package/dist/validators/validateIOSInput.d.ts +2 -0
- package/dist/validators/validateIOSInput.js +32 -0
- package/dist/validators/validateIOSInput.js.map +1 -0
- package/dist/validators/validateIOSNotification.d.ts +2 -0
- package/dist/validators/validateIOSNotification.js +211 -0
- package/dist/validators/validateIOSNotification.js.map +1 -0
- package/dist/validators/validateIOSPermissions.d.ts +2 -0
- package/dist/validators/validateIOSPermissions.js +62 -0
- package/dist/validators/validateIOSPermissions.js.map +1 -0
- package/dist/validators/validateNotification.d.ts +11 -0
- package/dist/validators/validateNotification.js +129 -0
- package/dist/validators/validateNotification.js.map +1 -0
- package/dist/validators/validateTrigger.d.ts +2 -0
- package/dist/validators/validateTrigger.js +104 -0
- package/dist/validators/validateTrigger.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js.map +1 -0
- package/ios/NotifeeCore/Info.plist +22 -0
- package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.h +28 -0
- package/ios/NotifeeCore/NotifeeCore+NSNotificationCenter.m +72 -0
- package/ios/NotifeeCore/NotifeeCore+NSURLSession.h +25 -0
- package/ios/NotifeeCore/NotifeeCore+NSURLSession.m +55 -0
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.h +37 -0
- package/ios/NotifeeCore/NotifeeCore+UNUserNotificationCenter.m +242 -0
- package/ios/NotifeeCore/NotifeeCore.h +118 -0
- package/ios/NotifeeCore/NotifeeCore.m +784 -0
- package/ios/NotifeeCore/NotifeeCoreDelegateHolder.h +34 -0
- package/ios/NotifeeCore/NotifeeCoreDelegateHolder.m +70 -0
- package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.h +39 -0
- package/ios/NotifeeCore/NotifeeCoreDownloadDelegate.m +68 -0
- package/ios/NotifeeCore/NotifeeCoreExtensionHelper.h +38 -0
- package/ios/NotifeeCore/NotifeeCoreExtensionHelper.m +224 -0
- package/ios/NotifeeCore/NotifeeCoreUtil.h +82 -0
- package/ios/NotifeeCore/NotifeeCoreUtil.m +793 -0
- package/ios/RNNotifee/NotifeeApiModule.h +25 -0
- package/ios/RNNotifee/NotifeeApiModule.m +371 -0
- package/ios/RNNotifee/NotifeeExtensionHelper.h +37 -0
- package/ios/RNNotifee/NotifeeExtensionHelper.m +37 -0
- package/ios/RNNotifee.xcodeproj/project.pbxproj +318 -0
- package/jest-mock.js +158 -0
- package/package.json +59 -0
- package/plugin/build/index.d.ts +3 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/index.js.map +1 -0
- package/plugin/build/withNotifeeProjectGradlePlugin.d.ts +5 -0
- package/plugin/build/withNotifeeProjectGradlePlugin.js +24 -0
- package/plugin/build/withNotifeeProjectGradlePlugin.js.map +1 -0
- package/plugin/src/index.ts +9 -0
- package/plugin/src/withNotifeeProjectGradlePlugin.ts +27 -0
- package/plugin/tsconfig.json +9 -0
- package/react-native.config.js +11 -0
- package/refresh-example.sh +71 -0
- package/src/NotifeeApiModule.ts +825 -0
- package/src/NotifeeJSEventEmitter.ts +11 -0
- package/src/NotifeeNativeError.ts +70 -0
- package/src/NotifeeNativeModule.ts +55 -0
- package/src/NotifeeNativeModule.web.ts +25 -0
- package/src/index.ts +33 -0
- package/src/types/Library.ts +28 -0
- package/src/types/Module.ts +625 -0
- package/src/types/Notification.ts +505 -0
- package/src/types/NotificationAndroid.ts +1443 -0
- package/src/types/NotificationIOS.ts +681 -0
- package/src/types/NotificationWeb.ts +5 -0
- package/src/types/PowerManagerInfo.ts +43 -0
- package/src/types/Trigger.ts +118 -0
- package/src/utils/id.ts +13 -0
- package/src/utils/index.ts +47 -0
- package/src/utils/validate.ts +92 -0
- package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfo.ts +45 -0
- package/src/validators/iosCommunicationInfo/validateIOSCommunicationInfoPerson.ts +33 -0
- package/src/validators/validate.ts +85 -0
- package/src/validators/validateAndroidAction.ts +54 -0
- package/src/validators/validateAndroidChannel.ts +188 -0
- package/src/validators/validateAndroidChannelGroup.ts +49 -0
- package/src/validators/validateAndroidFullScreenAction.ts +65 -0
- package/src/validators/validateAndroidInput.ts +67 -0
- package/src/validators/validateAndroidNotification.ts +704 -0
- package/src/validators/validateAndroidPressAction.ts +65 -0
- package/src/validators/validateAndroidStyle.ts +315 -0
- package/src/validators/validateIOSAttachment.ts +136 -0
- package/src/validators/validateIOSCategory.ts +150 -0
- package/src/validators/validateIOSCategoryAction.ts +65 -0
- package/src/validators/validateIOSInput.ts +38 -0
- package/src/validators/validateIOSNotification.ts +296 -0
- package/src/validators/validateIOSPermissions.ts +78 -0
- package/src/validators/validateNotification.ts +156 -0
- package/src/validators/validateTrigger.ts +134 -0
- package/src/version.ts +2 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016-present Invertase Limited
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { IOSNotificationSettings, NotificationIOS } from './NotificationIOS';
|
|
6
|
+
import {
|
|
7
|
+
NativeAndroidChannel,
|
|
8
|
+
NativeAndroidChannelGroup,
|
|
9
|
+
NotificationAndroid,
|
|
10
|
+
AndroidLaunchActivityFlag,
|
|
11
|
+
} from './NotificationAndroid';
|
|
12
|
+
import { AndroidNotificationSettings, Trigger } from '..';
|
|
13
|
+
import { WebNotificationSettings } from './NotificationWeb';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Interface for building a local notification for both Android & iOS devices.
|
|
17
|
+
*
|
|
18
|
+
* To learn more about displaying a notification, view the [Displaying a Notification](/react-native/docs/displaying-a-notification)
|
|
19
|
+
* documentation.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export interface Notification {
|
|
23
|
+
/**
|
|
24
|
+
* A unique identifier for your notification.
|
|
25
|
+
*
|
|
26
|
+
* Notifications with the same ID will be created as the same instance, allowing you to update
|
|
27
|
+
* a notification which already exists on the device.
|
|
28
|
+
*
|
|
29
|
+
* Defaults to a random string if not provided.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The notification title which appears above the body text.
|
|
35
|
+
*/
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The notification subtitle, which appears on a new line below/next the title.
|
|
40
|
+
*/
|
|
41
|
+
subtitle?: string | undefined;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The main body content of a notification.
|
|
45
|
+
*/
|
|
46
|
+
body?: string | undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Additional data to store on the notification. Only `string` values can be stored.
|
|
50
|
+
*
|
|
51
|
+
* Data can be used to provide additional context to your notification which can be retrieved
|
|
52
|
+
* at a later point in time (e.g. via an event).
|
|
53
|
+
*/
|
|
54
|
+
data?: { [key: string]: string | object | number };
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Android specific notification options. See the [`NotificationAndroid`](/react-native/reference/notificationandroid)
|
|
58
|
+
* interface for more information and default options which are applied to a notification.
|
|
59
|
+
*
|
|
60
|
+
* @platform android
|
|
61
|
+
*/
|
|
62
|
+
android?: NotificationAndroid;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* iOS specific notification options. See the [`NotificationIOS`](/react-native/reference/notificationios)
|
|
66
|
+
* interface for more information and default options which are applied to a notification.
|
|
67
|
+
*
|
|
68
|
+
* @platform ios
|
|
69
|
+
*/
|
|
70
|
+
ios?: NotificationIOS;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Will be populated if it's a remote notification
|
|
74
|
+
*
|
|
75
|
+
* @platform ios
|
|
76
|
+
*/
|
|
77
|
+
readonly remote?: {
|
|
78
|
+
messageId: string;
|
|
79
|
+
senderId: string;
|
|
80
|
+
mutableContent?: number;
|
|
81
|
+
contentAvailable?: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* An interface representing a notification & action that launched the current app / or Android activity.
|
|
87
|
+
*
|
|
88
|
+
* View the [App open events](/react-native/docs/events#app-open-events) documentation to learn more.
|
|
89
|
+
*
|
|
90
|
+
* This interface is returned from [`getInitialNotification`](/react-native/reference/getinitialnotification) when
|
|
91
|
+
* an initial notification is available.
|
|
92
|
+
*
|
|
93
|
+
* Deprecated for iOS in favour of `onForegroundEvent`
|
|
94
|
+
*
|
|
95
|
+
* @platform android
|
|
96
|
+
*/
|
|
97
|
+
export interface InitialNotification {
|
|
98
|
+
/**
|
|
99
|
+
* The notification which the user interacted with, which caused the application to open.
|
|
100
|
+
*/
|
|
101
|
+
notification: Notification;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The press action which the user interacted with, on the notification, which caused the application to open.
|
|
105
|
+
*/
|
|
106
|
+
pressAction: NotificationPressAction;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The input from a notification action.
|
|
110
|
+
*
|
|
111
|
+
* The input detail is available when the [`EventType`](/react-native/reference/eventtype) is:
|
|
112
|
+
*
|
|
113
|
+
* - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
|
|
114
|
+
* - The notification quick action has input enabled. View [`AndroidInput`](/react-native/reference/androidinput) for more details.
|
|
115
|
+
*
|
|
116
|
+
* @platform android API Level >= 20
|
|
117
|
+
*/
|
|
118
|
+
input?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* An interface representing a notification that is currently displayed in the notification tray.
|
|
123
|
+
*/
|
|
124
|
+
export interface DisplayedNotification {
|
|
125
|
+
/**
|
|
126
|
+
* ID of the notification
|
|
127
|
+
*/
|
|
128
|
+
id?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Date the notification was shown to the user
|
|
132
|
+
*/
|
|
133
|
+
date?: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The payload that was used to create the notification (if available)
|
|
137
|
+
*/
|
|
138
|
+
notification: Notification;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The trigger that was used to schedule the notification (if available)
|
|
142
|
+
*
|
|
143
|
+
* @platform iOS
|
|
144
|
+
*/
|
|
145
|
+
trigger: Trigger;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* An interface representing a notification that is pending.
|
|
150
|
+
*/
|
|
151
|
+
export interface TriggerNotification {
|
|
152
|
+
/**
|
|
153
|
+
* The notification
|
|
154
|
+
*/
|
|
155
|
+
notification: Notification;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The trigger that is used to schedule the notification
|
|
159
|
+
*/
|
|
160
|
+
trigger: Trigger;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* An interface representing a Notifee event.
|
|
165
|
+
*
|
|
166
|
+
* View the [Events](/react-native/docs/events) documentation to learn more about foreground and
|
|
167
|
+
* background events.
|
|
168
|
+
*/
|
|
169
|
+
export interface Event {
|
|
170
|
+
/**
|
|
171
|
+
* The type of notification event.
|
|
172
|
+
*/
|
|
173
|
+
type: EventType;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* An object containing event detail.
|
|
177
|
+
*/
|
|
178
|
+
detail: EventDetail;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* A representation of a Foreground Service task registered via [`registerForegroundService`](/react-native/reference/registerforegroundservice).
|
|
183
|
+
*
|
|
184
|
+
* The task must resolve a promise once complete, and in turn removes the notification.
|
|
185
|
+
*
|
|
186
|
+
* View the [Foreground Service](/react-native/docs/android/foreground-service) documentation to
|
|
187
|
+
* learn more.
|
|
188
|
+
*
|
|
189
|
+
* @platform android
|
|
190
|
+
*/
|
|
191
|
+
export type ForegroundServiceTask = (notification: Notification) => Promise<void>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The interface used to describe a press action for a notification.
|
|
195
|
+
*
|
|
196
|
+
* There are various ways a user can interact with a notification, the most common being pressing
|
|
197
|
+
* the notification, pressing an action or providing text input. This interface defines what happens
|
|
198
|
+
* when a user performs such interaction.
|
|
199
|
+
*
|
|
200
|
+
* On Android; when provided to a notification action, the action will only open you application if
|
|
201
|
+
* a `launchActivity` and/or a `mainComponent` is provided.
|
|
202
|
+
*/
|
|
203
|
+
export interface NotificationPressAction {
|
|
204
|
+
/**
|
|
205
|
+
* The unique ID for the action.
|
|
206
|
+
*
|
|
207
|
+
* The `id` property is used to differentiate between user press actions. When listening to notification
|
|
208
|
+
* events, the ID can be read from the `event.detail.pressAction` object.
|
|
209
|
+
*/
|
|
210
|
+
id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The custom Android Activity to launch on a press action.
|
|
214
|
+
*
|
|
215
|
+
* This property can be used in advanced scenarios to launch a custom Android Activity when the user
|
|
216
|
+
* performs a press action.
|
|
217
|
+
*
|
|
218
|
+
* View the [Android Interaction](/react-native/docs/android/interaction) docs to learn more.
|
|
219
|
+
*
|
|
220
|
+
* @platform android
|
|
221
|
+
*/
|
|
222
|
+
launchActivity?: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Custom flags that are added to the Android [Intent](https://developer.android.com/reference/android/content/Intent.html) that launches your Activity.
|
|
226
|
+
*
|
|
227
|
+
* These are only required if you need to customise the behaviour of how your activities are launched; by default these are not required.
|
|
228
|
+
*
|
|
229
|
+
* @platform android
|
|
230
|
+
*/
|
|
231
|
+
launchActivityFlags?: AndroidLaunchActivityFlag[];
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* A custom registered React component to launch on press action.
|
|
235
|
+
*
|
|
236
|
+
* This property can be used to open a custom React component when the user performs a press action.
|
|
237
|
+
* For this to correctly function on Android, a minor native code change is required.
|
|
238
|
+
*
|
|
239
|
+
* View the [Press Action](/react-native/docs/android/interaction#press-action) document to learn more.
|
|
240
|
+
*
|
|
241
|
+
* @platform android
|
|
242
|
+
*/
|
|
243
|
+
mainComponent?: string;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The interface used to describe a full-screen action for a notification.
|
|
248
|
+
*
|
|
249
|
+
* By setting a `fullScreenAction`, when the notification is displayed, it will launch a full-screen intent.
|
|
250
|
+
*
|
|
251
|
+
* On Android; when provided to a notification action, the action will only open you application if
|
|
252
|
+
* a `launchActivity` and/or a `mainComponent` is provided.
|
|
253
|
+
*
|
|
254
|
+
* Please see the [FullScreen Action](/react-native/docs/android/behaviour#full-screen-action) document to learn more.
|
|
255
|
+
*/
|
|
256
|
+
export interface NotificationFullScreenAction {
|
|
257
|
+
/**
|
|
258
|
+
* The unique ID for the action.
|
|
259
|
+
*
|
|
260
|
+
* The `id` property is used to differentiate between full-screen actions. When listening to notification
|
|
261
|
+
* events, the ID can be read from the `event.detail.notification.android.fullScreenAction` object.
|
|
262
|
+
*/
|
|
263
|
+
id: string;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The custom Android Activity to launch on a full-screen action.
|
|
267
|
+
*
|
|
268
|
+
* This property can be used in advanced scenarios to launch a custom Android Activity when the user
|
|
269
|
+
* performs a full-screen action.
|
|
270
|
+
*
|
|
271
|
+
* View the [Android Full Screen](/react-native/docs/android/behviour#full-screen-action) docs to learn more.
|
|
272
|
+
*
|
|
273
|
+
* @platform android
|
|
274
|
+
*/
|
|
275
|
+
launchActivity?: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Custom flags that are added to the Android [Intent](https://developer.android.com/reference/android/content/Intent.html) that launches your Activity.
|
|
279
|
+
*
|
|
280
|
+
* These are only required if you need to customise the behaviour of how your activities are launched; by default these are not required.
|
|
281
|
+
*
|
|
282
|
+
* @platform android
|
|
283
|
+
*/
|
|
284
|
+
launchActivityFlags?: AndroidLaunchActivityFlag[];
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* A custom registered React component to launch on press action.
|
|
288
|
+
*
|
|
289
|
+
* This property can be used to open a custom React component when the notification is displayed.
|
|
290
|
+
* For this to correctly function on Android, a minor native code change is required.
|
|
291
|
+
*
|
|
292
|
+
* View the [Full-screen Action](/react-native/docs/android/behviour#full-screen-action) document to learn more.
|
|
293
|
+
*
|
|
294
|
+
* @platform android
|
|
295
|
+
*/
|
|
296
|
+
mainComponent?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* An enum representing an event type, defined on [`Event`](/react-native/reference/event).
|
|
301
|
+
*
|
|
302
|
+
* View the [Events](/react-native/docs/events) documentation to learn more about foreground and
|
|
303
|
+
* background events.
|
|
304
|
+
*/
|
|
305
|
+
export enum EventType {
|
|
306
|
+
/**
|
|
307
|
+
* An unknown event was received.
|
|
308
|
+
*
|
|
309
|
+
* This event type is a failsafe to catch any unknown events from the device. Please
|
|
310
|
+
* report an issue with a reproduction so it can be correctly handled.
|
|
311
|
+
*/
|
|
312
|
+
UNKNOWN = -1,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Event type is sent when the user dismisses a notification. This is triggered via the user swiping
|
|
316
|
+
* the notification from the notification shade.
|
|
317
|
+
*
|
|
318
|
+
* On Android, the event is also sent when performing "Clear all" notifications unlike on iOS.
|
|
319
|
+
*
|
|
320
|
+
* This event is **not** sent when a notification is cancelled or times out.
|
|
321
|
+
*/
|
|
322
|
+
DISMISSED = 0,
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Event type is sent when a notification has been pressed by the user.
|
|
326
|
+
*
|
|
327
|
+
* On Android, notifications must include an `android.pressAction` property for this event to trigger.
|
|
328
|
+
*
|
|
329
|
+
* On iOS, this event is always sent when the user presses a notification.
|
|
330
|
+
*/
|
|
331
|
+
PRESS = 1,
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Event type is sent when a user presses a notification action.
|
|
335
|
+
*/
|
|
336
|
+
ACTION_PRESS = 2,
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Event type sent when a notification has been delivered to the device. For trigger notifications,
|
|
340
|
+
* this event is sent at the point when the trigger executes, not when a the trigger notification is created.
|
|
341
|
+
*
|
|
342
|
+
* It's important to note even though a notification has been delivered, it may not be shown to the
|
|
343
|
+
* user. For example, they may have notifications disabled on the device/channel/app.
|
|
344
|
+
*/
|
|
345
|
+
DELIVERED = 3,
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Event is sent when the user changes the notification blocked state for the entire application or
|
|
349
|
+
* when the user opens the application settings.
|
|
350
|
+
*
|
|
351
|
+
* @platform android API Level >= 28
|
|
352
|
+
*/
|
|
353
|
+
APP_BLOCKED = 4,
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Event type is sent when the user changes the notification blocked state for a channel in the application.
|
|
357
|
+
*
|
|
358
|
+
* @platform android API Level >= 28
|
|
359
|
+
*/
|
|
360
|
+
CHANNEL_BLOCKED = 5,
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Event type is sent when the user changes the notification blocked state for a channel group in the application.
|
|
364
|
+
*
|
|
365
|
+
* @platform android API Level >= 28
|
|
366
|
+
*/
|
|
367
|
+
CHANNEL_GROUP_BLOCKED = 6,
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Event type is sent when a notification trigger is created.
|
|
371
|
+
*/
|
|
372
|
+
TRIGGER_NOTIFICATION_CREATED = 7,
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* An interface representing the different detail values which can be provided with a notification event.
|
|
377
|
+
*
|
|
378
|
+
* View the [Events](/react-native/docs/events) documentation to learn more.
|
|
379
|
+
*/
|
|
380
|
+
export interface EventDetail {
|
|
381
|
+
/**
|
|
382
|
+
* The notification this event relates to.
|
|
383
|
+
*
|
|
384
|
+
* The notification details is available when the [`EventType`](/react-native/reference/eventtype) is one of:
|
|
385
|
+
*
|
|
386
|
+
* - [`EventType.DISMISSED`](/react-native/reference/eventtype#dismissed)
|
|
387
|
+
* - [`EventType.PRESS`](/react-native/reference/eventtype#press)
|
|
388
|
+
* - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
|
|
389
|
+
* - [`EventType.DELIVERED`](/react-native/reference/eventtype#delivered)
|
|
390
|
+
* - [`EventType.TRIGGER_NOTIFICATION_CREATED`](/react-native/reference/eventtype#trigger_notification_created)
|
|
391
|
+
*/
|
|
392
|
+
notification?: Notification;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* The press action which triggered the event.
|
|
396
|
+
*
|
|
397
|
+
* If a press action caused the event, this property will be available allowing you to retrieve the
|
|
398
|
+
* action ID and perform logic.
|
|
399
|
+
*
|
|
400
|
+
* The press action details is available when the [`EventType`](/react-native/reference/eventtype) is one of:
|
|
401
|
+
*
|
|
402
|
+
* - [`EventType.PRESS`](/react-native/reference/eventtype#press)
|
|
403
|
+
* - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
|
|
404
|
+
*/
|
|
405
|
+
pressAction?: NotificationPressAction;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The input from a notification action.
|
|
409
|
+
*
|
|
410
|
+
* The input detail is available when the [`EventType`](/react-native/reference/eventtype) is:
|
|
411
|
+
*
|
|
412
|
+
* - [`EventType.ACTION_PRESS`](/react-native/reference/eventtype#action_press)
|
|
413
|
+
* - The notification quick action has input enabled. View [`AndroidInput`](/react-native/reference/androidinput) for more details.
|
|
414
|
+
*
|
|
415
|
+
* @platform android API Level >= 20
|
|
416
|
+
*/
|
|
417
|
+
input?: string;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The channel that had its block state changed.
|
|
421
|
+
*
|
|
422
|
+
* Note that if the channel no longer exists during the time the event was sent the channel property will be undefined.
|
|
423
|
+
*
|
|
424
|
+
* The channel detail is available when the event type is [`EventType.CHANNEL_BLOCKED`](/react-native/reference/eventtype#channel_blocked).
|
|
425
|
+
*
|
|
426
|
+
* @platform android API Level >= 28
|
|
427
|
+
*/
|
|
428
|
+
channel?: NativeAndroidChannel;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* The channel group that had its block state changed.
|
|
432
|
+
*
|
|
433
|
+
* Note that if the channel no longer exists during the time the event was sent the channel group property will be undefined.
|
|
434
|
+
*
|
|
435
|
+
* The channel group detail is available when the event type is [`EventType.CHANNEL_GROUP_BLOCKED`](/react-native/reference/eventtype#channel_group_blocked).
|
|
436
|
+
*
|
|
437
|
+
* @platform android API Level >= 28
|
|
438
|
+
*/
|
|
439
|
+
channelGroup?: NativeAndroidChannelGroup;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* The notification blocked status of your entire application.
|
|
443
|
+
*
|
|
444
|
+
* The blocked detail is available when the event type is [`EventType.APP_BLOCKED`](/react-native/reference/eventtype#app_blocked).
|
|
445
|
+
*
|
|
446
|
+
* @platform android API Level >= 28
|
|
447
|
+
*/
|
|
448
|
+
blocked?: boolean;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* An enum representing the notification authorization status for this app on the device.
|
|
453
|
+
*
|
|
454
|
+
* Value is greater than 0 if authorized, compare against an exact status (e.g. PROVISIONAL) for a more
|
|
455
|
+
* granular status.
|
|
456
|
+
*
|
|
457
|
+
*/
|
|
458
|
+
export enum AuthorizationStatus {
|
|
459
|
+
/**
|
|
460
|
+
* The app user has not yet chosen whether to allow the application to create notifications. Usually
|
|
461
|
+
* this status is returned prior to the first call of `requestPermission`.
|
|
462
|
+
*
|
|
463
|
+
* @platform ios
|
|
464
|
+
*/
|
|
465
|
+
NOT_DETERMINED = -1,
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The app is not authorized to create notifications.
|
|
469
|
+
*/
|
|
470
|
+
DENIED = 0,
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* The app is authorized to create notifications.
|
|
474
|
+
*/
|
|
475
|
+
AUTHORIZED = 1,
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* The app is currently authorized to post non-interrupting user notifications
|
|
479
|
+
* @platform ios iOS >= 12
|
|
480
|
+
*/
|
|
481
|
+
PROVISIONAL = 2,
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export interface NotificationSettings {
|
|
485
|
+
/**
|
|
486
|
+
* Overall notification authorization status for the application.
|
|
487
|
+
* On Android, `authorizationStatus` will return only either `AuthorizationStatus.DENIED` or `AuthorizationStatus.AUTHORIZED`.
|
|
488
|
+
*/
|
|
489
|
+
authorizationStatus: AuthorizationStatus;
|
|
490
|
+
/**
|
|
491
|
+
* Overall notification settings for the application in iOS.
|
|
492
|
+
* On non-iOS platforms, this will be populated with default values
|
|
493
|
+
*/
|
|
494
|
+
ios: IOSNotificationSettings;
|
|
495
|
+
/**
|
|
496
|
+
* Overall notification settings for the application in android.
|
|
497
|
+
* On non-Android platforms, this will be populated with default values
|
|
498
|
+
*/
|
|
499
|
+
android: AndroidNotificationSettings;
|
|
500
|
+
/**
|
|
501
|
+
* Overall notification settings for the application in web.
|
|
502
|
+
* On non-Web platforms, this will be populated with default values
|
|
503
|
+
*/
|
|
504
|
+
web: WebNotificationSettings;
|
|
505
|
+
}
|