Skip to content

setInitialRoute is broken for iOS add-to-app #59895

@mehmetf

Description

@mehmetf

b/159359456

https://flutter.dev/docs/development/add-to-app/ios/add-flutter-screen?tab=entrypoint-library-swift-tab#route recommends

FlutterEngine *flutterEngine =
    [[FlutterEngine alloc] initWithName:@"my flutter engine"];
[[flutterEngine navigationChannel] invokeMethod:@"setInitialRoute"
                                      arguments:@"/onboarding"];
[flutterEngine run];

This does not work. The initial route comes out as default ("/"). If I initialize view controller with project (instead of engine) and use [flutterViewController setInitialRoute], it works.

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: existing-appsIntegration with existing apps via the add-to-app flowc: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.platform-iosiOS applications specificallywaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions