diff --git a/doric-iOS/Pod/Classes/Plugin/DoricNotchPlugin.m b/doric-iOS/Pod/Classes/Plugin/DoricNotchPlugin.m index 1e20c3f5..6f16b51e 100644 --- a/doric-iOS/Pod/Classes/Plugin/DoricNotchPlugin.m +++ b/doric-iOS/Pod/Classes/Plugin/DoricNotchPlugin.m @@ -32,7 +32,13 @@ - (instancetype)initWithContext:(DoricContext *)doricContext { - (void)inset:(NSDictionary *)argument withPromise:(DoricPromise *)promise { dispatch_async(dispatch_get_main_queue(), ^{ if (@available(iOS 11.0, *)) { - UIView *superView = [UIApplication sharedApplication].windows.lastObject; + UIView *superView; + if (self.doricContext.vc) { + superView = self.doricContext.vc.view.window; + } else { + superView = [UIApplication sharedApplication].windows.lastObject; + } + CGFloat top = superView.safeAreaInsets.top; CGFloat left = superView.safeAreaInsets.left; CGFloat bottom = superView.safeAreaInsets.bottom;