You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-19Lines changed: 20 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
# react-native-local-notifications
1
+
# @callstack/react-native-local-notifications
2
2
3
3
Recover the local-notification action that launched your React Native app from a terminated state.
4
4
5
-
`react-native-local-notifications` bridges the cold-start notification response to JavaScript on iOS and Android. It gives your navigation or analytics code one consistent, typed action without taking ownership of notification scheduling or live notification events.
5
+
`@callstack/react-native-local-notifications` bridges the cold-start notification response to JavaScript on iOS and Android. It gives your navigation or analytics code one consistent, typed action without taking ownership of notification scheduling or live notification events.
6
+
7
+
Third-party services such as Braze or Firebase often already handle actions from remote notifications. This library is intended for applications where local and remote notifications use different mechanisms: keep using your existing provider for remote notifications, and use this package to recover the initial action from a local notification when it launches the app.
6
8
7
9
## Why use it?
8
10
@@ -15,15 +17,15 @@ Recover the local-notification action that launched your React Native app from a
`subscribeToLiveNotificationActions` is a placeholder for the listener supplied by your notification solution; it is not exported by this package.
156
+
`subscribeToRemoteNotificationActions` is a placeholder for the listener supplied by your notification solution; it is not exported by this package.
154
157
155
158
## API
156
159
157
160
### `getInitialNotificationAction()`
158
161
159
162
```ts
160
-
function getInitialNotificationAction():Promise<
161
-
InitialNotificationAction|null
162
-
>;
163
+
function getInitialNotificationAction():Promise<InitialNotificationAction|null>;
163
164
```
164
165
165
166
Returns the notification action that launched the current application process, or `null` when the app was opened normally or the action has already been consumed.
@@ -176,12 +177,12 @@ type InitialNotificationAction = {
176
177
};
177
178
```
178
179
179
-
| Field | Description |
180
-
| --- | --- |
181
-
|`notificationId`| Identifier of the notification that triggered the action |
182
-
|`categoryId`| Notification category, when supplied |
183
-
|`channelId`| Android notification channel; always `null` on iOS |
184
-
|`action`| Normalized tap, clear, or custom action |
|`notificationId`| Identifier of the notification that triggered the action|
183
+
|`categoryId`| Notification category, when supplied|
184
+
|`channelId`| Android notification channel; always `null` on iOS|
185
+
|`action`| Normalized tap, clear, or custom action|
185
186
|`actionIdentifier`| Platform action identifier for a custom action, when supplied |
186
187
187
188
The value is held in memory and atomically consumed. The first call receives it; later or concurrent calls return `null`. It is not persisted between application processes.
@@ -204,8 +205,8 @@ A Jest mock is available as a package export:
0 commit comments