Skip to content

Commit c097f04

Browse files
committed
update oss docs
1 parent 2c1ca2f commit c097f04

17 files changed

Lines changed: 279 additions & 196 deletions

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Feature Request 💡
4-
url: https://oss.callstack.com/discussions/new?category=ideas
5-
about: If you have a feature request, please create a new discussion on GitHub.
63
- name: Discussions on GitHub 💬
7-
url: https://oss.callstack.com/discussions
4+
url: https://github.com/callstack/react-native-local-notifications/discussions
85
about: If this library works as promised but you need help, please ask questions there.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Feature request
2+
description: Suggest an improvement to the library.
3+
labels: [enhancement]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thanks for helping improve the project. Please describe the use case before proposing an API.
8+
- type: textarea
9+
id: problem
10+
attributes:
11+
label: Problem
12+
description: What problem or limitation are you trying to solve?
13+
validations:
14+
required: true
15+
- type: textarea
16+
id: proposal
17+
attributes:
18+
label: Proposed solution
19+
description: Describe the behavior or API you would like to see.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: alternatives
24+
attributes:
25+
label: Alternatives considered
26+
description: Describe any workarounds or alternative designs you considered.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Summary
2+
3+
Describe what changed and why.
4+
5+
## Testing
6+
7+
List the checks you ran and the platforms you tested.
8+
9+
## Checklist
10+
11+
- [ ] I ran `yarn lint` and `yarn typecheck`.
12+
- [ ] I added or updated documentation where needed.
13+
- [ ] I tested native changes on each affected platform.
14+
- [ ] This pull request is focused on one change.

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
development-dependencies:
9+
dependency-type: development
10+
- package-ecosystem: bundler
11+
directory: /example
12+
schedule:
13+
interval: weekly
14+
- package-ecosystem: github-actions
15+
directory: /
16+
schedule:
17+
interval: weekly

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.4

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ representative at an online or offline event.
6060
## Enforcement
6161

6262
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63-
reported to the community leaders responsible for enforcement at
64-
[INSERT CONTACT METHOD].
63+
reported privately to the community leaders responsible for enforcement at
64+
[hello@callstack.com](mailto:hello@callstack.com).
6565
All complaints will be reviewed and investigated promptly and fairly.
6666

6767
All community leaders are obligated to respect the privacy and security of the

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ To publish new versions, run the following:
8585
yarn release
8686
```
8787

88+
Publishing requires maintainer access to the `@callstack` npm organization and
89+
the GitHub repository. The release command selects the version, creates a
90+
`v<version>` tag, publishes to npm, and creates a GitHub release. Before
91+
releasing, run `yarn lint`, `yarn typecheck`, and `yarn prepare`, then inspect
92+
the package with `yarn npm publish --dry-run`.
8893

8994
### Scripts
9095

LocalNotifications.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.authors = package["author"]
1212

1313
s.platforms = { :ios => min_ios_version_supported }
14-
s.source = { :git => "https://oss.callstack.com.git", :tag => "#{s.version}" }
14+
s.source = { :git => "https://github.com/callstack/react-native-local-notifications.git", :tag => "v#{s.version}" }
1515

1616
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
1717
s.public_header_files = "ios/InitialNotificationActionStore.h"

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# react-native-local-notifications
1+
# @callstack/react-native-local-notifications
22

33
Recover the local-notification action that launched your React Native app from a terminated state.
44

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.
68

79
## Why use it?
810

@@ -15,15 +17,15 @@ Recover the local-notification action that launched your React Native app from a
1517
## Installation
1618

1719
```sh
18-
yarn add react-native-local-notifications
20+
yarn add @callstack/react-native-local-notifications
1921
```
2022

2123
Or use your preferred package manager:
2224

2325
```sh
24-
npm install react-native-local-notifications
26+
npm install @callstack/react-native-local-notifications
2527
# or
26-
pnpm add react-native-local-notifications
28+
pnpm add @callstack/react-native-local-notifications
2729
```
2830

2931
Install iOS pods after adding the package:
@@ -40,7 +42,7 @@ Read the initial action once during application startup:
4042

4143
```tsx
4244
import { useEffect } from 'react';
43-
import { getInitialNotificationAction } from 'react-native-local-notifications';
45+
import { getInitialNotificationAction } from '@callstack/react-native-local-notifications';
4446

4547
function App() {
4648
useEffect(() => {
@@ -133,7 +135,8 @@ useEffect(() => {
133135
// Use one navigation path for cold-start and live actions.
134136
};
135137

136-
const subscription = subscribeToLiveNotificationActions(handleAction);
138+
// additional subscription to notifications
139+
const subscription = subscribeToRemoteNotificationActions(handleAction);
137140

138141
getInitialNotificationAction()
139142
.then((action) => {
@@ -150,16 +153,14 @@ useEffect(() => {
150153
}, []);
151154
```
152155

153-
`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.
154157

155158
## API
156159

157160
### `getInitialNotificationAction()`
158161

159162
```ts
160-
function getInitialNotificationAction(): Promise<
161-
InitialNotificationAction | null
162-
>;
163+
function getInitialNotificationAction(): Promise<InitialNotificationAction | null>;
163164
```
164165

165166
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 = {
176177
};
177178
```
178179

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 |
180+
| Field | Description |
181+
| ------------------ | ------------------------------------------------------------- |
182+
| `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 |
185186
| `actionIdentifier` | Platform action identifier for a custom action, when supplied |
186187

187188
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:
204205

205206
```js
206207
moduleNameMapper: {
207-
'^react-native-local-notifications$':
208-
'react-native-local-notifications/jest/mock',
208+
'^@callstack/react-native-local-notifications$':
209+
'@callstack/react-native-local-notifications/jest/mock',
209210
}
210211
```
211212

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
## Supported versions
4+
5+
Security fixes are provided for the latest published version of
6+
`@callstack/react-native-local-notifications`.
7+
8+
## Reporting a vulnerability
9+
10+
Please do not disclose security vulnerabilities in a public issue. Report them
11+
privately through [GitHub's private vulnerability reporting](https://github.com/callstack/react-native-local-notifications/security/advisories/new)
12+
or email [hello@callstack.com](mailto:hello@callstack.com).
13+
14+
Include the affected version, platform, impact, reproduction steps, and any
15+
known mitigations. We will acknowledge the report as soon as practical and keep
16+
you informed while we investigate and prepare a fix.

0 commit comments

Comments
 (0)