diff --git a/packages/react-native/React/Base/RCTUtils.m b/packages/react-native/React/Base/RCTUtils.m index 96e59e2db10181..716b5439ad0129 100644 --- a/packages/react-native/React/Base/RCTUtils.m +++ b/packages/react-native/React/Base/RCTUtils.m @@ -569,6 +569,10 @@ BOOL RCTRunningInAppExtension(void) } UIWindowScene *windowScene = (UIWindowScene *)scene; + if (@available(iOS 15.0, *)) { + return windowScene.keyWindow; + } + for (UIWindow *window in windowScene.windows) { if (window.isKeyWindow) { return window;