rn-awesome-notifications
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Description

Local notifications for React Native app

Installation

npm i --save rn-awesome-notifications

Usage

In root Component

import { NotificationProvider } from "rn-awesome-notifications";

<NotificationProvider>
  ...
</NotificationProvider>

In your Component

import { useNotify } from "rn-awesome-notifications";

const MyComponent: React.FC = () => {
  
  const notify = useNotify();
  
  return (
    <Button
      title="Without buttons and icon"
      onPress={() => {
        notify({
          title: "Test push notification",
          message: "This is push was recievd from local storage",
        })
      }}
    />
  )
}

Examples

notify.error({
    title: 'Error',
    message,
    timeout: 15000,
});

notify.success({
    title: 'Success',
    message: 'Everything is fine',
    timeout: 15000,
});

notify.info({
    title: 'Info',
    message: 'Some info',
    timeout: 15000,
});

Package Sidebar

Install

npm i rn-awesome-notifications

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

445 kB

Total Files

96

Last publish

Collaborators

  • rokotovmax