Skip to content

A React Native wrapper that provides access to the state of the proximity sensor on iOS.

Notifications You must be signed in to change notification settings

attilaaronnagy/react-native-proximity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#react-native-proximity

A React Native wrapper that provides access to the state of the proximity sensor.

Usage of react-native-proximity and scrollview.

##Getting Started

  • Install the library
npm install --save react-native-proximity
  • Link the library
react-native link

##Usage

Import the library

import Proximity from 'react-native-proximity';

###addListener(callback)

componentDidMount(){
 Proximity.addListener(this._setProximity);
},

/**
 * State of proximity sensor
 * @param {object} data
 */
 _setProximity(data) {
   this.setState({
     proximity: data.proximity,
   });
 },

###removeListener(callback)

componentWillUnmount() {
  Proximity.removeListener(this._setProximity);
},

About

A React Native wrapper that provides access to the state of the proximity sensor on iOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 72.7%
  • JavaScript 27.3%