Skip to content

Commit 4a8c57e

Browse files
authored
Merge pull request #108 from joebernard/face-up-down
Adding support for iOS FACE-UP and FACE-DOWN orientations
2 parents c3e8b44 + ea62158 commit 4a8c57e

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ orientation can return one of:
270270
- `LANDSCAPE-LEFT` camera left home button right
271271
- `LANDSCAPE-RIGHT` camera right home button left
272272
- `PORTRAIT-UPSIDEDOWN`
273+
- `FACE-UP`
274+
- `FACE-DOWN`
273275
- `UNKNOWN`
274276

275-
Notice: PORTRAIT-UPSIDEDOWN is currently not supported on iOS at the moment.
277+
Notice: PORTRAIT-UPSIDEDOWN is currently not supported on iOS at the moment. FACE-UP and FACE-DOWN are only supported on iOS.

iOS/RCTOrientation/Orientation.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@ - (NSString *)getOrientationStr: (UIInterfaceOrientation)orientation {
9999

100100
orientationStr = @"PORTRAIT-UPSIDEDOWN";
101101
break;
102-
102+
103+
case UIDeviceOrientationFaceUp:
104+
105+
orientationStr = @"FACE-UP";
106+
break;
107+
108+
case UIDeviceOrientationFaceDown:
109+
110+
orientationStr = @"FACE-DOWN";
111+
break;
112+
103113
default:
104114
orientationStr = @"UNKNOWN";
105115
break;

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
export type OrientationType = "PORTRAIT" | "PORTRAIT-UPSIDEDOWN" | "LANDSCAPE-LEFT" | "LANDSCAPE-RIGHT" | "UNKNOWN";
9+
export type OrientationType = "PORTRAIT" | "PORTRAIT-UPSIDEDOWN" | "LANDSCAPE-LEFT" | "LANDSCAPE-RIGHT" | "FACE-UP" | "FACE-DOWN" | "UNKNOWN";
1010

1111
declare class Orientation {
1212
static addOrientationListener(callback: (orientation: OrientationType) => void): void;

0 commit comments

Comments
 (0)