React Native app with CarPlay support, bug on launch sometimes after iOS 15

Hello everyone! We have a react native app which supports CarPlay on iOS. We implemented CarPlay using 'scenes' because we need the 'PointOfInterest' template.

After iOS 15 we have a bug on launch and when the last launch happens about 30 min ago.

The app skips the SplashScreen and after that everything are rendered wrong in terms of positioning.

When that happens it seems like the app tries to open from the background even if it wan closed from the last launch.

We know that the bug is related to CarPlay because without it we haven't that bug but it's related to iOS 15 too because we haven't it before.

Any help is welcome!! :)

Do you have any code in AppDelegate "didFinishLaunchingWithOptions"? I'm unsure if this is intended behavior or a bug but recently code in "didFinishLaunchingWithOptions" is being run during App Warming without the ability to execute some code.

See: https://developer.apple.com/forums/thread/667959?answerId=693810022#693810022

@JavierRefuerzo thanks for the response. Yes I have some code in "didFinishLaunchingWithOptions":

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   if ([FIRApp defaultApp] == nil) {
     [FIRApp configure];
   }
   #ifdef FB_SONARKIT_ENABLED
     InitializeFlipper(application);
   #endif
  [GMSServices provideAPIKey:@"..."];
  [Intercom setApiKey:@"..." forAppId:@"..."];
  [Intercom registerUnidentifiedUser];
  [Stripe setDefaultPublishableKey:@"..."];
 
   // Define UNUserNotificationCenter
   UNUserNotificationCenter *notifcenter = [UNUserNotificationCenter currentNotificationCenter];
   [notifcenter setDelegate: self];
   [notifcenter requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionAlert 
   |UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error) {
      // check this with break point
      NSLog(@"Succes %d", granted);
   }];
   [[UIApplication sharedApplication] registerForRemoteNotifications];
 
   RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
   RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"..." initialProperties:nil];
 
   RNBridgeInstanceHolder *instance = [RNBridgeInstanceHolder sharedManager];
   instance.bridge = bridge;
   instance.rootView = rootView;
 
   return YES;
}

We also using 'react-native-default-preference' package in order to pass some data from 'react native' code to 'objC' native code. Is it possible for this to be related with this bug?

We finally manage to solve it. It was a problem because of using 'SceneDelegate' (for multiple scenes support) and iOS15 'prewarming' new feature. Solved by transferring the RTCBridge protocol from AppDelegate -'didFinishWithLaunchOptions' to SceneDelegate - 'willConnectToSession'.

React Native app with CarPlay support, bug on launch sometimes after iOS 15
 
 
Q