0.0.2 • Published 5 years ago

react-native-lock-orientation v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

react-native-lock-orientation

Getting started

yarn add react-native-lock-orientation 
# or npm 
# npm install react-native-lock-orientation --save

installation

React Native 0.60 and higher

On newer versions of React Native, linking is automatic.

To complete the linking on iOS, make sure you have Cocoapods installed. Then run:

cd ios
pod install
cd ..

React Native 0.59 and lower

$ react-native link react-native-lock-orientation

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]

  2. Go to node_modulesreact-native-lock-orientation and add LockOrientation.xcodeproj

  3. In XCode, in the project navigator, select your project. Add libLockOrientation.a to your project's Build PhasesLink Binary With Libraries

  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.bjuma.orientation.LockOrientationPackage; to the imports at the top of the file

  • Add new LockOrientationPackage() to the list returned by the getPackages() method

  1. Append the following lines to android/settings.gradle:
include ':react-native-lock-orientation'

project(':react-native-lock-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-lock-orientation/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
compile project(':react-native-lock-orientation')

Usage

import LockOrientation from  'react-native-lock-orientation';

  

// TODO: What to do with the module?

LockOrientation;