if you are using Swift and not objC the logic is the same and you can take some help on how to set the 'self.window' on 'SceneDelegate' from this (https://dev.to/kevinmaarek/add-a-scene-delegate-to-your-current-project-5on)
Post
Replies
Boosts
Views
Activity
These changes are helpful in case you are using react-native and SceneDelegate.
So you have to take RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil]; and RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"..." initialProperties:nil]; from AppDelegate.m and use them on SceneDelegate.m inside 'willConnectToSession' in order to initialise 'RTCBridge' and use the 'rootView' in order to set the 'self.window.rootViewController'. Also you have to take the 'RCTBridgeDelegate' from AppDelegate.h @interface and add to SceneDelegate.h @interface. And at last you have to transfer the (NSURL *)sourceURLForBridge:(RCTBridge *)bridge method from AppDelegate.m to SceneDelegate.m
@dhairyasenjaliya thanks for your response :) we have Xcode 13.2.1. Do you have also react-native project using Scenes? We are sure that the 'Scenes' is the problem because when we drop them the app launches fine.
No not this package. We use the 'SceneDelegate' except of 'AppDelegate' to manage multiple scenes of our app, like CarPlay and the iPhone app.
Here are docs and an article:
https://developer.apple.com/documentation/uikit/app_and_environment/scenes?language=objc
https://medium.com/@kalyan.parise/understanding-scene-delegate-app-delegate-7503d48c5445
@JavierRefuerzo I tried to move all the initialisations to 'willConnectToSession' but the bug persists. I left on 'didFinishLaunchingWithOptions' only the 'RCTBridge' and below.. Do you think that it's better to drop the 'didFinishLaunchingWithOptions' in order to work?
@dhairyasenjaliya no not yet..
@userff are you still persist to that fix with no problems?
@shoibahmad can you give more instruction on how you handled it?
no unfortunately we have no progress yet