react-native-lightbox
react-native-lightbox copied to clipboard
Modal crash in iOS
my app orientations only landspace
Modal was presented with 0x2 orientations mask but the application only supports 0x18.Add more interface orientations to your app's Info.plist to fix this.NOTE: This will crash in non-dev mode.
-[RCTModalHostViewController supportedInterfaceOrientations] RCTModalHostViewController.m:66 -[UIViewController __supportedInterfaceOrientations] -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:] -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] -[UIViewController _presentViewController:withAnimationController:completion:] __63-[UIViewController _presentViewController:animated:completion:]_block_invoke_2 +[UIView(Animation) performWithoutAnimation:] __63-[UIViewController _presentViewController:animated:completion:]_block_invoke -[UIViewController _performCoordinatedPresentOrDismiss:animated:] -[UIViewController _presentViewController:animated:completion:] -[UIViewController presentViewController:animated:completion:] -[RCTModalHostViewManager presentModalHostView:withViewController:animated:] -[RCTModalHostView didMoveToWindow] -[UIView(Internal) _didMoveFromWindow:toWindow:] __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke -[NSISEngine withBehaviors:performModifications:] -[UIView(Hierarchy) _postMovedFromSuperview:] -[UIView(Internal) _addSubview:positioned:relativeTo:] -[UIView(React) didUpdateReactSubviews] -[RCTView didUpdateReactSubviews] __48-[RCTUIManager _dispatchChildrenDidChangeEvents]_block_invoke __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke __44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.544 __RCTExecuteOnMainQueue_block_invoke _dispatch_call_block_and_release _dispatch_client_callout _dispatch_main_queue_callback_4CF CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE __CFRunLoopRun CFRunLoopRunSpecific GSEventRunModal UIApplicationMain main start
Path: node_modules/react-native-lightbox/LightboxOverlay.js i added supportedOrientations={['landscape']} to Modal. problem is resolve.
<Modal visible={isOpen} transparent={true} onRequestClose={() => this.close()}>
{background}
{content}
{header}
</Modal>
?
I think you need to add orientation for your app. You can add it info.plist. You can review this
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
This is a blocking issue for apps/games where the design only supports landscape orientation (i.e. situations where adding UIInterfaceOrientationPortrait
is not possible because it would break the rest of the app layout).
If the lightbox had a landscapeOnly
prop or similar, that could pass the correct supportedOrientations
prop to the underlying Modal
component and prevent the crash.