Skip to content

Commit f1678ed

Browse files
authored
fix(ios): scene notify first launch (#11149)
1 parent 9273f46 commit f1678ed

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/core/application/application.ios.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ class SceneDelegate extends UIResponder implements UIWindowSceneDelegate {
186186
return;
187187
}
188188

189+
const isFirstScene = !Application.ios.getPrimaryScene() && !Application.hasLaunched();
190+
189191
this._scene = scene;
190192

191193
// Create window for this scene
@@ -221,7 +223,7 @@ class SceneDelegate extends UIResponder implements UIWindowSceneDelegate {
221223
}
222224

223225
// If this is the first scene, trigger app startup
224-
if (!Application.ios.getPrimaryScene()) {
226+
if (isFirstScene) {
225227
Application.ios._notifySceneAppStarted();
226228
}
227229
}
@@ -905,8 +907,11 @@ export class iOSApplication extends ApplicationCommon {
905907
setiOSWindow(window);
906908
}
907909

908-
// Set up the window content for the primary scene
909-
this.setWindowContent();
910+
// During initial scene startup we must wait for launch to be notified first.
911+
// Some frameworks provide root content from launch handlers.
912+
if (this.hasLaunched()) {
913+
this.setWindowContent();
914+
}
910915
}
911916
}
912917

0 commit comments

Comments
 (0)