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

react-native-modal-notifier

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-modal-notifier

react-native-modal-notifier is a third party in-app notification package! It provides modal notification popup.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-91.67%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Modal Notifier

npm dw platforms: ios, android license MIT

react-native-modal-notifier is a third party in-app notification package! It provides modal notification popup. There are more than one usage example;

  1. Can be triggered by useEffect function
  2. Can be triggered by user action
  3. Can be triggered by api service data

drawing

Installation

yarn add react-native-modal-notifier

Or

npm install --save react-native-modal-notifier

Usage

Wrap your app with NotifierContainer

import { NotifierContainer } from 'react-native-modal-notifier';
const App = () => (
  <NotifierContainer>
    <HomeScreen />
  </NotifierContainer>
);

Then import useNotifier anywhere in your code/screen/components

import { useNotifier } from 'react-native-modal-notifier';

const HomeScreen = () => {
    const notifier = useNotifier();

    useEffect(() => {
        alert && notifier({
            title: alert.title,
            message: alert.message
        });
    }, [alert]);

    return (
    <TouchableHighlight
      onPress={() =>
        notifier({
          title: 'New Notification',
          message:
            'New Notification',
        })
      }>
      <Text>Set Notification</Text>
    </TouchableHighlight>
  );
};

Props of useNotifier

NameDescriptionTypeDefault
titleTitle of the messagestringnull
messageThe message of the contentstringnull
headerShownHeader visibility optionbooleantrue
primaryButtonTextThe text in the primary button contentstringundefined
primaryButtonActionThe primary button actionfuncundefined
primaryButtonColorThe background color of the primary buttonstring#3a86ff
primaryButtonPositionThe position of the primary button in the notifiercenter or right or leftcenter

Keywords

FAQs

Package last updated on 07 May 2022

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