Recover iPadOS MenuBar state from different scenes

I’m building a Flutter plugin to access the new menubar API on iPadOS. Everything works fine with a single scene, but I’m running into issues when adding support for multiple scenes:

  • Only odd-numbered windows (first, third, etc.) build their menus correctly.
  • Even-numbered windows ignore the menus sent from Flutter and fall back to a default menubar.
  • When switching between scenes, the last rendered menu always persists instead of updating to the current focus.

So far, I’ve:

  • Implemented the plugin as a singleton.
  • Tried to persist menu state per scene, but without success.

What would be the recommended approach here? Should I avoid a singleton and manage state entirely per UIScene instance?

The project is open-source, and if anyone is willing to take a look, here are the relevant files:

Any guidance would be much appreciated.

Answered by DTS Engineer in 860772022

Are you able to demonstrate the issue in a test project created from one of Xcode's templates, and using only Apple APIs? If not, you should check with the support resources provided by Flutter to get assistance with their software. You can find tips on creating and sharing a test project in Creating a Test Project.

Are you able to demonstrate the issue in a test project created from one of Xcode's templates, and using only Apple APIs? If not, you should check with the support resources provided by Flutter to get assistance with their software. You can find tips on creating and sharing a test project in Creating a Test Project.

Recover iPadOS MenuBar state from different scenes
 
 
Q