7.8.2 • Published 5 months ago

@notifee/react-native v7.8.2

Weekly downloads
8,212
License
Apache-2.0
Repository
github
Last release
5 months ago

A feature rich Android & iOS notifications library for React Native.

> Learn More

Installation

yarn add @notifee/react-native

Documentation

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
AppearanceChange the appearance of a notification; icons, colors, visibility etc.
BehaviourCustomize how a notification behaves when it is delivered to a device; sound, vibration, lights etc.
Channels & GroupsOrganize your notifications into channels & groups to allow users to control how notifications are handled on their device
Foreground ServiceLong running background tasks can take advantage of a Android Foreground Services to display an on-going, prominent notification.
Grouping & SortingGroup and sort related notifications in a single notification pane.
InteractionAllow users to interact with your application directly from the notification with actions.
Progress IndicatorsShow users a progress indicator of an on-going background task, and learn how to keep it updated.
StylesStyle notifications to show richer content, such as expandable images/text, or message conversations.
TimersDisplay 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
AppearanceChange now the notification is displayed to your users.
BehaviourControl how notifications behave when they are displayed to a device; sound, crtitial alerts etc.
CategoriesCreate & assign categories to notifications.
InteractionHandle user interaction with your notifications.
PermissionsRequest 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:

 ● 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:

setupFiles: ['<rootDir>/jest.setup.js'],

You can then add the following line to that setup file to mock notifee:

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):

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:

{
  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



7.8.2

5 months ago

7.8.1

5 months ago

7.8.0

10 months ago

7.6.1

1 year ago

7.6.0

1 year ago

7.7.0-0

1 year ago

7.7.1

1 year ago

7.7.0

1 year ago

7.5.0

1 year ago

7.3.0

1 year ago

7.4.0

1 year ago

7.2.0

1 year ago

8.0.0

1 year ago

7.1.0

1 year ago

7.0.4

2 years ago

7.0.3

2 years ago

7.0.2

2 years ago

7.1.0-1

2 years ago

7.1.0-2

1 year ago

7.0.1-0

2 years ago

7.0.1-1

2 years ago

7.0.0

2 years ago

7.1.0-0

2 years ago

7.0.1

2 years ago

6.0.0

2 years ago

5.7.0

2 years ago

5.4.1

2 years ago

5.4.0

2 years ago

5.5.0

2 years ago

5.6.0

2 years ago

5.3.0

2 years ago

6.0.0-0

2 years ago

5.2.2

2 years ago

5.0.3

2 years ago

5.1.0

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.1.0

2 years ago

5.0.0-0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.0-0

2 years ago

3.0.4

2 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.3-0

3 years ago

3.0.5-0

3 years ago

3.1.0-0

3 years ago

3.0.2-1

3 years ago

3.0.2-0

3 years ago

3.0.4-0

3 years ago

3.0.1

3 years ago

3.0.1-0

3 years ago

3.0.1-1

3 years ago

3.0.0

3 years ago

2.0.0-0

3 years ago

2.0.0

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.2-0

3 years ago

1.10.1

3 years ago

1.10.0-0

3 years ago

1.10.0

3 years ago

1.9.2

3 years ago

1.11.0-alpha.0

3 years ago

1.9.1

3 years ago

1.9.0-0

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.8.1-0

3 years ago

1.9.0-alpha.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.2.0-3

3 years ago

1.2.0-2

3 years ago

1.2.0-1

3 years ago

1.2.0-0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0-0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.16.0-1

3 years ago

0.16.0

3 years ago

0.16.0-0

3 years ago

0.15.2

3 years ago

0.15.2-0

3 years ago

0.15.1-0

3 years ago

0.15.1

3 years ago

0.15.0

4 years ago

0.15.0-0

4 years ago

0.14.0

4 years ago

0.13.3-0

4 years ago

0.13.2

4 years ago

0.13.1

4 years ago

0.13.0

4 years ago

0.12.3

4 years ago

0.12.2

4 years ago

0.12.1

4 years ago

0.12.0

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.8.0-3.0

4 years ago

0.8.0-2.0

4 years ago

0.8.0-1.0

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago