-
Notifications
You must be signed in to change notification settings - Fork 28.6k
setInitialRoute is broken for iOS add-to-app #59895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setInitialRoute is broken for iOS add-to-app #59895
Comments
@chinmaygarde says this is more or less working as intended and that there is a workaround so I will reduce it to P3; he will update this bug shortly. |
@mehmetf : So, I am not sure how the initial recommendation on the page you linked was made. It is definitely inaccurate. Channel setup has always occurred when the underlying shell in the engine is setup. In the The behavior described in the docs is a fair ask but it is a bit mystifying how that recommendation was made when the implementation has never worked that way. In any case, I see you bumped up the priority of this to P1. Is this now a blocker? My reading of the internal issue indicated that there was a workaround. I'll have reprioritize some other stuff if this is at indicated priority. |
FWIW, I was very surprised at that recommendation as well. Are you referring to However, it is not a launch blocker for them for now so lowering priority to P2. We should, at the very least, fix documentation asap tho. |
Yes. Ok. This would be a blocker for them eventually because there is no way in the current API to send a message before the run call. The UIViewController manages this today because it makes a private call to the engine to create its shell and setup channels. I'll find an owner for this in the next triage run. |
ah yes, the docs are totally off. I'm surprised no one ran into this so far. We have this on Android https://flutter.dev/docs/development/add-to-app/android/add-flutter-screen#initial-route-with-a-cached-engine and implemented channel buffers to fix timing issues flutter/engine#12167 but we didn't change the loading sequence on iOS. Haven't decided how to fix this yet but I'm tempted to fix the loading sequence discrepancy between Android and iOS which causes unnecessary confusion https://flutter.dev/docs/development/add-to-app/performance#starting-the-dart-vm. |
Actually that doesn't also fix the other root issue that the whole setInitialRoute API is incredibly confusing. I think we made slight progress in making it less of a footgun building it into the FlutterActivity builder pattern. I'm going to repeat the same thing here: 1- Deprecate the FlutterViewController setInitialRoute API which needs to be called at a (very fleeting) specific moment. This fixes 2 issues with one code change. |
@xster I am bumping the milestone for this as the month is out. Please re-adjust as necessary if you think the linked patch cannot land by then. |
yup, thanks |
mini update: about the land fix PR |
@xster when this fix will merge to stable channel? |
Did you mean 1.21? We're currently not planning to. Are you blocked on this issue? |
@xster yes. My app's feature should jump to flutter page from native page, but setInitialRoute not work so that can not jump to specified page.Is it possible release a 1.20.2 to fix this bug? |
Reverted. Reworking tests. |
@lds8988 it's a non-trivial refactor so we're not going to make a cherry pick on the stable branch. Please wait for the 1.22 release. In the meantime, if you're blocked, consider the following workarounds:
|
@xster I'll try it. Thx for reply. |
@xster I am facing the same problem, setting initial route on engines navigation channel has no impact and eventually had to navigate to desired screen without warming up the engine. |
It's already on master. I'll add more documentation on it once it's on stable channel in about a month. In the meantime, you can probably figure out how to use the new APIs from the headers. (e.g. use the specific |
thanks @xster , I can see that you introduced |
No, you should |
Is this fixed already in 1.22.0-1.0.pre? How to initialRoute with arguments? |
What should I do to control the foremost visible route? If I use |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
b/159359456
https://flutter.dev/docs/development/add-to-app/ios/add-flutter-screen?tab=entrypoint-library-swift-tab#route recommends
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.
The text was updated successfully, but these errors were encountered: