-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: use typedoc+markdown plugin for docs.page compatible reference
completely stock right now except using mdx file extension for docs.page compatibility
- Loading branch information
Showing
69 changed files
with
6,863 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
**@notifee/react-native** | ||
|
||
*** | ||
|
||
<p align="center"> | ||
<a href="https://notifee.app"> | ||
<img width="160px" src="https://notifee.app/logo-icon.png"><br/> | ||
</a> | ||
<h2 align="center">Notifee - React Native</h2> | ||
</p> | ||
|
||
--- | ||
|
||
A feature rich Android & iOS notifications library for React Native. | ||
|
||
[> Learn More](https://notifee.app/) | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @notifee/react-native | ||
``` | ||
|
||
## Documentation | ||
|
||
- [Overview](https://notifee.app/react-native/docs/overview) | ||
- [Licensing](https://notifee.app/react-native/docs/license-keys) | ||
- [Reference](https://notifee.app/react-native/reference) | ||
|
||
### Android | ||
|
||
The APIs for Android allow for creating rich, styled and highly interactive notifications. Below you'll find guides that cover the supported Android features. | ||
|
||
| Topic | | | ||
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | | ||
| [Appearance](https://notifee.app/react-native/docs/android/appearance) | Change the appearance of a notification; icons, colors, visibility etc. | | ||
| [Behaviour](https://notifee.app/react-native/docs/android/behaviour) | Customize how a notification behaves when it is delivered to a device; sound, vibration, lights etc. | | ||
| [Channels & Groups](https://notifee.app/react-native/docs/android/channels) | Organize your notifications into channels & groups to allow users to control how notifications are handled on their device | | ||
| [Foreground Service](https://notifee.app/react-native/docs/android/foreground-service) | Long running background tasks can take advantage of a Android Foreground Services to display an on-going, prominent notification. | | ||
| [Grouping & Sorting](https://notifee.app/react-native/docs/android/grouping-and-sorting) | Group and sort related notifications in a single notification pane. | | ||
| [Interaction](https://notifee.app/react-native/docs/android/interaction) | Allow users to interact with your application directly from the notification with actions. | | ||
| [Progress Indicators](https://notifee.app/react-native/docs/android/progress-indicators) | Show users a progress indicator of an on-going background task, and learn how to keep it updated. | | ||
| [Styles](https://notifee.app/react-native/docs/android/styles) | Style notifications to show richer content, such as expandable images/text, or message conversations. | | ||
| [Timers](https://notifee.app/react-native/docs/android/timers) | Display counting timers on your notification, useful for on-going tasks such as a phone call, or event time remaining. | | ||
|
||
### iOS | ||
|
||
Below you'll find guides that cover the supported iOS features. | ||
|
||
| Topic | | | ||
| ----------------------------------------------------------------- | ------------------------------------------------------------------------ | | ||
| [Appearance](https://notifee.app/react-native/docs/ios/appearance) | Change now the notification is displayed to your users. | | ||
| [Behaviour](https://notifee.app/react-native/docs/ios/behaviour) | Control how notifications behave when they are displayed to a device; sound, crtitial alerts etc. | | ||
| [Categories](https://notifee.app/react-native/docs/ios/categories) | Create & assign categories to notifications. | | ||
| [Interaction](https://notifee.app/react-native/docs/ios/interaction) | Handle user interaction with your notifications. | | | ||
| [Permissions](https://notifee.app/react-native/docs/ios/permissions) | Request permission from your application users to display notifications. | | | ||
|
||
### Jest Testing | ||
|
||
To run jest tests after integrating this module, you will need to mock out the native parts of Notifee or you will get an error that looks like: | ||
|
||
```bash | ||
● Test suite failed to run | ||
|
||
Notifee native module not found. | ||
|
||
59 | this._nativeModule = NativeModules[this._moduleConfig.nativeModuleName]; | ||
60 | if (this._nativeModule == null) { | ||
> 61 | throw new Error('Notifee native module not found.'); | ||
| ^ | ||
62 | } | ||
63 | | ||
64 | return this._nativeModule; | ||
``` | ||
Add this to a setup file in your project e.g. `jest.setup.js`: | ||
If you don't already have a Jest setup file configured, please add the following to your Jest configuration file and create the new jest.setup.js file in project root: | ||
```js | ||
setupFiles: ['<rootDir>/jest.setup.js'], | ||
``` | ||
You can then add the following line to that setup file to mock `notifee`: | ||
```js | ||
jest.mock('@notifee/react-native', () => require('@notifee/react-native/jest-mock')) | ||
``` | ||
You will also need to add `@notifee` to `transformIgnorePatterns` in your config file (`jest.config.js`): | ||
```bash | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(jest-)?react-native|@react-native|@notifee)' | ||
] | ||
``` | ||
### Detox Testing | ||
To utilise Detox's functionality to mock a local notification and trigger notifee's event handlers, you will need a payload with a key `__notifee_notification`: | ||
```js | ||
{ | ||
title: 'test', | ||
body: 'Body', | ||
payload: { | ||
__notifee_notification: { | ||
ios: { | ||
foregroundPresentationOptions: { | ||
banner: true, | ||
list: true, | ||
}, | ||
}, | ||
data: {} | ||
}, | ||
}, | ||
} | ||
``` | ||
The important part is to make sure you have a `__notifee_notification` object under `payload` with the default properties. | ||
## License | ||
- See [LICENSE](/LICENSE) | ||
--- | ||
<p> | ||
<img align="left" width="50px" src="https://static.invertase.io/assets/invertase-logo-small.png"> | ||
<p align="left"> | ||
Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>. | ||
</p> | ||
</p> | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[**@notifee/react-native**](../README.mdx) | ||
|
||
*** | ||
|
||
[@notifee/react-native](../globals.mdx) / AlarmType | ||
|
||
# Enumeration: AlarmType | ||
|
||
An interface representing the different alarm types which can be used with `TimestampTrigger.alarmManager.type`. | ||
|
||
View the [Triggers](/react-native/docs/triggers) documentation to learn more. | ||
|
||
## Enumeration Members | ||
|
||
### SET | ||
|
||
> **SET**: `0` | ||
#### Defined in | ||
|
||
[packages/react-native/src/types/Trigger.ts:43](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/Trigger.ts#L43) | ||
|
||
*** | ||
|
||
### SET\_ALARM\_CLOCK | ||
|
||
> **SET\_ALARM\_CLOCK**: `4` | ||
#### Defined in | ||
|
||
[packages/react-native/src/types/Trigger.ts:47](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/Trigger.ts#L47) | ||
|
||
*** | ||
|
||
### SET\_AND\_ALLOW\_WHILE\_IDLE | ||
|
||
> **SET\_AND\_ALLOW\_WHILE\_IDLE**: `1` | ||
#### Defined in | ||
|
||
[packages/react-native/src/types/Trigger.ts:44](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/Trigger.ts#L44) | ||
|
||
*** | ||
|
||
### SET\_EXACT | ||
|
||
> **SET\_EXACT**: `2` | ||
#### Defined in | ||
|
||
[packages/react-native/src/types/Trigger.ts:45](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/Trigger.ts#L45) | ||
|
||
*** | ||
|
||
### SET\_EXACT\_AND\_ALLOW\_WHILE\_IDLE | ||
|
||
> **SET\_EXACT\_AND\_ALLOW\_WHILE\_IDLE**: `3` | ||
#### Defined in | ||
|
||
[packages/react-native/src/types/Trigger.ts:46](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/Trigger.ts#L46) |
53 changes: 53 additions & 0 deletions
53
docs/react-native/reference/enumerations/AndroidBadgeIconType.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[**@notifee/react-native**](../README.mdx) | ||
|
||
*** | ||
|
||
[@notifee/react-native](../globals.mdx) / AndroidBadgeIconType | ||
|
||
# Enumeration: AndroidBadgeIconType | ||
|
||
Enum used to define how a notification badge is displayed in badge mode. | ||
|
||
View the [Badges](/react-native/docs/android/appearance#badges) documentation for more information. | ||
|
||
## Platform | ||
|
||
android | ||
|
||
## Enumeration Members | ||
|
||
### LARGE | ||
|
||
> **LARGE**: `2` | ||
Shows the badge as the notifications `largeIcon` (if available). | ||
|
||
This is the default value used by a notification if not provided. | ||
|
||
#### Defined in | ||
|
||
[packages/react-native/src/types/NotificationAndroid.ts:1092](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/NotificationAndroid.ts#L1092) | ||
|
||
*** | ||
|
||
### NONE | ||
|
||
> **NONE**: `0` | ||
No badge is displayed, will always show as a number. | ||
|
||
#### Defined in | ||
|
||
[packages/react-native/src/types/NotificationAndroid.ts:1080](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/NotificationAndroid.ts#L1080) | ||
|
||
*** | ||
|
||
### SMALL | ||
|
||
> **SMALL**: `1` | ||
Shows the badge as the notifications `smallIcon`. | ||
|
||
#### Defined in | ||
|
||
[packages/react-native/src/types/NotificationAndroid.ts:1085](https://github.com/invertase/notifee/blob/bf6deb3c72c777c677e21f5eda602131249f4f83/packages/react-native/src/types/NotificationAndroid.ts#L1085) |
Oops, something went wrong.