fix(messaging,ios): fix an issue where the scene initializer could be called twice in latest Flutter versions#18051
Conversation
… called twice in latest Flutter versions
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
|
Our Flutter app also crashes because of this issue. Coding agent is recommending to put this into the AppDelegate as workaround but I don't know if that's proper: Could you please release a new version with this fix? |
Description
Fix EXC_BAD_ACCESS crash on iOS when tapping a notification under UIScene lifecycle (
FlutterImplicitEngineDelegate).setupNotificationHandlingWithRemoteNotification:was called twice (fromUIApplicationDidFinishLaunchingNotification+scene:willConnectToSession:), causing_originalNotificationCenterDelegateto point toself→ infinite recursion on notification tap.Added a guard so delegate/swizzler setup only runs once, while still allowing the second call to process the launch notification.
No test: requires a real push notification tap delivered by the OS under UIScene lifecycle — not possible from E2E or unit tests.
Related Issues
Fixes #18037
Checklist
///).melos run analyze) does not report any problems on my PR.Breaking Change