Skip to content

Commit

Permalink
Fix app extension support by using RCTKeyWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Feb 16, 2022
1 parent 684c8a0 commit d5fab0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ios/SafeAreaView/RNCSafeAreaProviderManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ - (UIView *)view

- (NSDictionary *)constantsToExport
{
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
if (@available(iOS 11.0, *)) {
UIWindow *window = RCTKeyWindow();
if (window == nil) {
return @{@"initialWindowMetrics" : [NSNull null]};
} else if (@available(iOS 11.0, *)) {
UIEdgeInsets safeAreaInsets = window.safeAreaInsets;
return @{
@"initialWindowMetrics" : @{
Expand Down

0 comments on commit d5fab0b

Please sign in to comment.