Skip to content

Commit 92d45ed

Browse files
committed
chore: add README.md docs
1 parent 48be8fc commit 92d45ed

File tree

2 files changed

+57
-5
lines changed

2 files changed

+57
-5
lines changed

.github/images/icon.png

223 KB
Loading

README.md

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,81 @@
11
# react-native-notifications-utils
2-
notifications utils
2+
3+
A simple package for notifications utils.
4+
5+
![Bell Illustration](.github/images/icon.png)
6+
7+
## Features
8+
- [X] Opening App Notifications Settings for Android and iOS
9+
- [X] Typescript
10+
11+
312
## Installation
13+
---
14+
```sh
15+
yarn add react-native-notifications-utils
16+
```
17+
18+
### iOS
419

520
```sh
6-
npm install react-native-notifications-utils
21+
cd ios && pod install
722
```
823

24+
925
## Usage
26+
---
1027

11-
```js
12-
import { multiply } from "react-native-notifications-utils";
28+
```typescript
29+
import NotificationsUtils from "react-native-notifications-utils";
1330

1431
// ...
1532

16-
const result = await multiply(3, 7);
33+
NotificationsUtils.openSettings();
1734
```
1835

36+
## API
37+
---
38+
39+
### `openSettings(channelId?: string)`
40+
API used to open the Platform specific System settings for the application.
41+
42+
| Parameter | Type | Description | Android | iOS |
43+
| --------- | -------- | ------------------------------------------------------------------------------------------- | ------- | --- |
44+
| channelId | `string` | The channel id to open the settings for. If not provided, the default channel will be used. |||
45+
46+
- On Android:
47+
- API version is >= 26 with `channelId` will open the channel settings. if `channelI` is not provided, the app's notification settings will be opened.
48+
- API version is < 26, the application settings screen is opened
49+
50+
- On iOS:
51+
- If the version of iOS is >= 15.4, the app's notification settings screen is displayed.
52+
- If the version of iOS is < 15.4, the app's settings screen is displayed.
53+
- for further details, see:
54+
- [Apple's iOS 16 documentation for `openNotificationSettingsURLString`]( https://developer.apple.com/documentation/uikit/uiapplication/4013180-opennotificationsettingsurlstrin)
55+
- [Apple's iOS 15.4 documentation for `UIApplicationOpenNotificationSettingsURLString`](https://developer.apple.com/documentation/uikit/uiapplicationopennotificationsettingsurlstring)
56+
- [Apple's documentation for `openSettingsURLString`](https://developer.apple.com/documentation/uikit/uiapplication/1623042-opensettingsurlstring).
1957
## Contributing
2058

2159
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
2260

61+
## Author
62+
___
63+
- [**@stringsaeed**](https://www.github.com/stringsaeed)
64+
65+
2366
## License
67+
---
2468

2569
MIT
2670

71+
72+
73+
### TODO:
74+
---
75+
- [ ] Add tests
76+
- [ ] Add support for request permissions
77+
- [ ] Keeps updated with new native features
78+
2779
---
2880

2981
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

0 commit comments

Comments
 (0)