Skip to content

Plugins with dart plugin registrants don't work on background isolates #112240

@gaaclarke

Description

@gaaclarke

After #13937, platform channels work on background isolates. Plugins should work as well, but if a plugin relies on a dart plugin registrant (example shared_preferences usage to set the platform_interface subclass) the registrant isn't executed on the background isolate, so the plugin doesn't function correctly. Specifically there aren't handlers registered for the platform channels.

The solution should be to execute the Dart plugin registrant on the background isolate when it registers with the root isolate.

See:

  • PlatformConfigurationNativeApi::RegisterBackgroundIsolate
  • flutter::FindAndInvokeDartPluginRegistrant

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions