Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//

#import "ReactNativeBlobUtil.h"
#import <React/RCTUtils.h>

// The seam, not the Swift module. Under SwiftPM this file compiles in its own
// target and cannot see the Swift core's generated -Swift.h, so it names a
Expand Down Expand Up @@ -55,8 +56,12 @@ - (id) init {
[_core setWarningHandler:^(NSString *message) {
RCTLogWarn(@"%@", message);
}];
// RCTPresentedViewController() finds the key window through the connected scenes, so it
// works with the UIScene life cycle (React Native 0.88's template, required to launch when
// built with the iOS 27 SDK). That template's AppDelegate has no `window`, and sending it
// one threw "-[AppDelegate window]: unrecognized selector".
_core.presentingViewController = ^UIViewController * _Nullable {
return [[[[UIApplication sharedApplication] delegate] window] rootViewController];
return RCTPresentedViewController();
};
if (commonTaskQueue == nil)
commonTaskQueue = dispatch_queue_create("ReactNativeBlobUtil.queue", DISPATCH_QUEUE_SERIAL);
Expand Down