JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1481
  • Score
    100M100P100Q102515F
  • License ISC

React Native in-app native-like notifications.

Package Exports

  • react-native-in-app-message

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-in-app-message) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native in-app platform-specific notifications.

onDragEvent exampleforce touch example

0.0.8 - We moved on our own blur-module. The API still the same as before but now You don't need to install react-native-blur

As bonus You can use our BlurView: import {Blur} from "react-native-in-app-message/src/Blur"

  • Compatible with iPhone X, XR, XS, XS Max.
  • Allows you to use your own components.
  • Swipeable
  • Force Touch support
  • onDrag event support
  • The package react-native-gesture-handler to implement swipe and force touch gestures

Installation

  • Run npm install react-native-in-app-message
  • Run react-native link react-native-in-app-message
  • 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";

...
// Somewhere call
Notification.show(); // if You have one instance
// or ref.show() if You need to show specific instance
...

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

Methods

  • static show()
  • static hide()
  • ref.show()
  • ref.hide()

Props

  • blurType - must be one of 'xlight' | 'light' | 'dark'. iOS Only
  • blurAmount - number. iOS Only
  • showKnob - boolean. iOS Only.
  • duration - number. Message duration
  • autohide - 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+
  • onForceTouchHandlerStateChange - (event: ForceTouchGestureHandlerStateChangeEvent) => void. iOS Only and iPhone 6s+
  • useForceTouch - boolean. iOS Only and iPhone 6s+ (default - false)