mirror of
https://github.com/tappollo/react-native-safari-view.git
synced 2026-04-30 04:45:10 +08:00
Merge pull request #53 from Amwam/bugfix/modal-presentation
Fixed Safari view not being presentable from a modal
This commit is contained in:
@@ -70,8 +70,14 @@ RCT_EXPORT_METHOD(show:(NSDictionary *)args callback:(RCTResponseSenderBlock)cal
|
||||
self.safariView.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
}
|
||||
|
||||
// Display the Safari View
|
||||
UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
|
||||
|
||||
// Cycle through view controllers to get the view closest to the foreground
|
||||
while (ctrl.presentedViewController && !ctrl.isBeingDismissed) {
|
||||
ctrl = ctrl.presentedViewController;
|
||||
}
|
||||
|
||||
// Display the Safari View
|
||||
[ctrl presentViewController:self.safariView animated:YES completion:nil];
|
||||
|
||||
if (hasListeners) {
|
||||
|
||||
Reference in New Issue
Block a user