Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-notifier
Advanced tools
Fast and simple in-app notifications for React Native
This library uses react-native-gesture-handler, perfect library for swipes and other gesture events.
If you are using react-navigation then you already have it. If you don't, check Getting Stated guide: https://software-mansion.github.io/react-native-gesture-handler/docs/getting-started.html
yarn add react-native-notifier
Or
npm install --save react-native-notifier
Wrap your app with NotifierWrapper
import { NotifierWrapper } from 'react-native-notifier';
const App = () => (
<NotifierWrapper>
<Navigation />
</NotifierWrapper>
);
Or add NotifierRoot
at end of your App.js component. Note that NotifierRoot
should the last component to display notifications correctly
import { NotifierRoot } from 'react-native-notifier';
const App = () => (
<>
<Navigation />
<NotifierRoot />
</>
);
Then call Notifier.showNotification()
anywhere in code
import { Notifier, Easing } from 'react-native-notifier';
Notifier.showNotification({
title: 'John Doe',
description: 'Hello! Can you help me with notifications?',
duration: 0,
showAnimationDuration: 800,
showEasing: Easing.bounce,
onHide: () => console.log('onHide'),
onPress: () => console.log('Press'),
hideOnPress: false,
});
Notifier.showNotification
paramsName | Type | Default | Description |
---|---|---|---|
title | String | null | Title of notification |
description | String | null | Description of notification |
swipeEnabled | Boolean | true | Can notification be swiped-out |
duration | Number | 3000 | Time after notification will disappear |
Component | Component | MainComponent | Your custom component of notification body |
animationDuration | Number | 300 | How fast notification will appear/disappear |
showAnimationDuration | Number | animationDuration || 300 | How fast notification will appear. |
hideAnimationDuration | Number | animationDuration || 300 | How fast notification will disappear. |
easing | Easing | null | Animation easing. Details: https://reactnative.dev/docs/easing |
showEasing | Easing | easing || null | Show Animation easing. |
hideEasing | Easing | easing || null | Hide Animation easing. |
onHide | Function | null | Function called when notification started hiding |
onPress | Function | null | Function called when user press on notification |
hideOnPress | Boolean | true | Should notification hide when user press on it |
swipePixelsToClose | Number | 20 | How many pixels user should swipe-up notification to dismiss it |
swipeEasing | Easing | null | Animation easing after user finished swiping |
swipeAnimationDuration | Number | 200 | How fast should be animation after user finished swiping |
MIT
FAQs
Fast and simple in-app notifications for React Native
The npm package react-native-notifier receives a total of 3,534 weekly downloads. As such, react-native-notifier popularity was classified as popular.
We found that react-native-notifier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.