Coder Social home page Coder Social logo

iq-scm / react-native-in-app-message Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kirgudkov/react-native-in-app-message

0.0 0.0 0.0 67 KB

React Native in-app notification component

Home Page: https://www.npmjs.com/package/react-native-in-app-message

License: MIT License

JavaScript 66.00% Ruby 3.84% Objective-C 30.16%

react-native-in-app-message's Introduction

React Native in-app notifications.

onDragEvent exampleforce touch example

  • Compatible with iPhone X, XR, XS, XS Max.
  • Allows you to use your own components.
  • Swipeable
  • Force Touch support
  • Taptic Engine feedback support
  • onDrag gesture event support

Installation

  • Run npm install react-native-in-app-message
  • Run react-native link react-native-in-app-message - required for iOS
  • Run npm install react-native-gesture-handler and follow the linking guide. Required for both platforms

Usage

import {Notification} from "react-native-in-app-message";

...
this.ref.current?.show();
...

//It's important to declare Notification component next to root component
//otherwise component will be shown inside the navigator
render() {
    return (
      <React.Fragment>
        <AppNavigator/>
        <Notification text={'Hello world'} ref={this.ref} />
      </React.Fragment>
    )
  }

There is an example of usage

Methods

  • show()
  • hide()

Props

  • blurType - must be one of 'xlight' | 'light' | 'dark'. iOS Only
  • blurAmount - number. iOS Only
  • tapticFeedback - boolean. iOS 10 and upper
  • showKnob - boolean. iOS Only
  • duration - number
  • autohide - boolean
  • hideStatusBar - boolean
  • text - string. The text for the message. Required if customComponent is not used.
  • textColor - string.
  • customComponent - ReactNode.
  • onPress - () => void.
  • onDragGestureEvent - (event: PanGestureHandlerGestureEvent) => void.
  • onDragGestureHandlerStateChange - (event: PanGestureHandlerGestureEvent) => void.
  • onForceTouchGestureEvent - (event: ForceTouchGestureHandlerGestureEvent) => void. iOS Only and iPhone 6s and upper
  • onForceTouchHandlerStateChange - (event: ForceTouchGestureHandlerStateChangeEvent) => void. iOS Only and iPhone 6s and upper
  • useForceTouch - boolean. iOS Only and iPhone 6s and upper (default - false)

Modules

  • Notification import {Notification} from "react-native-in-app-message";
  • Blur import {Blur} from "react-native-in-app-message";
  • TapticFeedback import {TapticFeedback} from "react-native-in-app-message";

    Usage: TapticFeedback.impact();

react-native-in-app-message's People

Contributors

hhunaid avatar kirgudkov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.