yamill/react-native-orientation

Unlock all orientations

noway opened this issue ยท 0 comments

noway commented

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch react-native-orientation@3.1.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-orientation/iOS/RCTOrientation/Orientation.m b/node_modules/react-native-orientation/iOS/RCTOrientation/Orientation.m
index 15e9927..2e07efd 100644
--- a/node_modules/react-native-orientation/iOS/RCTOrientation/Orientation.m
+++ b/node_modules/react-native-orientation/iOS/RCTOrientation/Orientation.m
@@ -12,7 +12,7 @@
 @implementation Orientation
 @synthesize bridge = _bridge;
 
-static UIInterfaceOrientationMask _orientation = UIInterfaceOrientationMaskAllButUpsideDown;
+static UIInterfaceOrientationMask _orientation = UIInterfaceOrientationMaskAll;
 + (void)setOrientation: (UIInterfaceOrientationMask)orientation {
   _orientation = orientation;
 }
@@ -218,7 +218,7 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation {
   #if DEBUG
     NSLog(@"Unlock All Orientations");
   #endif
-  [Orientation setOrientation:UIInterfaceOrientationMaskAllButUpsideDown];
+  [Orientation setOrientation:UIInterfaceOrientationMaskAll];
 //  AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 //  delegate.orientation = 3;
 }

This issue body was partially generated by patch-package.