Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@notifee/react-native

Package Overview
Dependencies
Maintainers
0
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notifee/react-native

Notifee - a feature rich notifications library for React Native.

  • 9.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126K
decreased by-3.73%
Maintainers
0
Weekly downloads
 
Created

What is @notifee/react-native?

@notifee/react-native is a comprehensive library for managing local notifications in React Native applications. It provides a wide range of features for creating, displaying, and handling notifications, including support for custom sounds, actions, and scheduling.

What are @notifee/react-native's main functionalities?

Displaying a Simple Notification

This feature allows you to display a simple notification with a title and body content.

import notifee from '@notifee/react-native';

async function displayNotification() {
  await notifee.displayNotification({
    title: 'Notification Title',
    body: 'Main body content of the notification',
  });
}

Scheduling a Notification

This feature allows you to schedule a notification to be displayed at a specific time in the future.

import notifee, { TimestampTrigger, TriggerType } from '@notifee/react-native';

async function scheduleNotification() {
  const date = new Date(Date.now());
  date.setMinutes(date.getMinutes() + 5);

  const trigger = {
    type: TriggerType.TIMESTAMP,
    timestamp: date.getTime(),
  };

  await notifee.createTriggerNotification(
    {
      title: 'Scheduled Notification',
      body: 'This notification was scheduled to appear 5 minutes later',
    },
    trigger
  );
}

Custom Notification Sounds

This feature allows you to set a custom sound for your notifications.

import notifee from '@notifee/react-native';

async function customSoundNotification() {
  await notifee.displayNotification({
    title: 'Custom Sound Notification',
    body: 'This notification has a custom sound',
    android: {
      sound: 'custom_sound',
    },
  });
}

Notification Actions

This feature allows you to add actions to your notifications, enabling users to interact with them directly.

import notifee, { AndroidAction } from '@notifee/react-native';

async function notificationWithActions() {
  await notifee.displayNotification({
    title: 'Notification with Actions',
    body: 'This notification has actions',
    android: {
      actions: [
        {
          title: 'Action 1',
          pressAction: { id: 'action1' },
        },
        {
          title: 'Action 2',
          pressAction: { id: 'action2' },
        },
      ],
    },
  });
}

Other packages similar to @notifee/react-native

Keywords

FAQs

Package last updated on 20 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc