0.0.2 • Published 5 years ago
react-native-lock-orientation v0.0.2
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
In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
Go to
node_modules
➜react-native-lock-orientation
and addLockOrientation.xcodeproj
In XCode, in the project navigator, select your project. Add
libLockOrientation.a
to your project'sBuild Phases
➜Link Binary With Libraries
Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
Add
import com.bjuma.orientation.LockOrientationPackage;
to the imports at the top of the fileAdd
new LockOrientationPackage()
to the list returned by thegetPackages()
method
- 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')
- 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;