Skip to content

Commit

Permalink
Fixed Safari view not being presentable from a modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Amwam committed Jan 20, 2017
1 parent 3f3cb20 commit 01658cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SafariViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ - (dispatch_queue_t)methodQueue
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 = ctrl.presentedViewController;
}

// Display the Safari View
[ctrl presentViewController:self.safariView animated:YES completion:nil];

[self.bridge.eventDispatcher sendDeviceEventWithName:@"SafariViewOnShow" body:nil];
Expand Down

0 comments on commit 01658cc

Please sign in to comment.