yarn add @yunzhoukit/react-native-orientation-locker
yarn add @yunzhoukit/react-native-orientation-locker
react-native link @yunzhoukit/react-native-orientation-locker
For Windows, if you are using RNW v0.63.0 or higher, autolinking should link the module for you. Otherwise, you must follow the steps outlined here for linking module.
Add following to MainApplication.java (This will be added automatically by auto link. If not, please manually add the following )
//...
+import org.wonday.orientation.OrientationPackage;
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
+ packages.add(new OrientationPackage());
return packages;
}
//...