Skip to content

Add ability to access plugins from other plugins#182753

Merged
auto-submit[bot] merged 8 commits into
flutter:masterfrom
fuzzybinary:121527-cross-plugin-access
Mar 19, 2026
Merged

Add ability to access plugins from other plugins#182753
auto-submit[bot] merged 8 commits into
flutter:masterfrom
fuzzybinary:121527-cross-plugin-access

Conversation

@fuzzybinary

@fuzzybinary fuzzybinary commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Plugins occasionally need to communicate with other native plugins.

On iOS, plugins are able to publish values that should be accessible to other plugins. The easiest way to allow to these published value is to add an accessor in FlutterPluginRegistrar, similar to the one that exists in FlutterPluginRegistry (valuePublishedByPlugin).

On Android, we can ask for the plugin class directly by added and accessor to FlutterPluginBinding called getPlugin, which delegates to the engine's FlutterPlugins.

Fixes #121527

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@fuzzybinary fuzzybinary requested a review from a team as a code owner February 23, 2026 13:02
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Feb 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces valuePublishedByPlugin to FlutterPluginRegistrar, allowing plugins to access values published by other plugins. This change is implemented in FlutterPlugin.h and FlutterEngine.mm. The changes are straightforward, adding the method declaration and its implementation, and seem to align with the stated objective of fixing issue #121527.

Comment thread engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm Outdated
@fuzzybinary fuzzybinary force-pushed the 121527-cross-plugin-access branch from 4f1371a to d6447a6 Compare February 23, 2026 17:00
@gaaclarke gaaclarke added the fyi-ecosystem For the attention of Ecosystem team label Feb 23, 2026
@fuzzybinary fuzzybinary requested a review from a team as a code owner February 24, 2026 13:13
@github-actions github-actions Bot added platform-android Android applications specifically team-android Owned by Android platform team labels Feb 24, 2026
@fuzzybinary fuzzybinary changed the title Add valuePublishedByPlugin to PluginRegistrar Add ability to access plugins from other plugins Feb 24, 2026
@camsim99 camsim99 self-requested a review February 24, 2026 21:46

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added android tests, but not iOS tests

@fuzzybinary

Copy link
Copy Markdown
Contributor Author

👍 I'll go back and add an iOS test. There was an obvious place to add it on Android. I didn't see one on iOS, but I'll add it.

@fuzzybinary

Copy link
Copy Markdown
Contributor Author

Added tests for valuePublishedByPlugin to FlutterEngineTests.mm. Sorry for missing it on the first pass!

@reidbaker reidbaker self-requested a review February 25, 2026 19:29
hellohuanlin
hellohuanlin previously approved these changes Feb 25, 2026

@hellohuanlin hellohuanlin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ios part looks good.

}

@Nullable
public FlutterPlugin getPlugin(@NonNull Class<? extends FlutterPlugin> pluginClass) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

reidbaker
reidbaker previously approved these changes Feb 26, 2026

@reidbaker reidbaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve % public doc.

@mboetger I think this pr is a good idea are there any issues it causes us migrating to the embedder api?

}

@Nullable
public FlutterPlugin getPlugin(@NonNull Class<? extends FlutterPlugin> pluginClass) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@reidbaker

Copy link
Copy Markdown
Contributor

The failing code in google 3 is real but most look like Fakes where we need to add an implementation.

@vashworth

vashworth commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

From triage: @hellohuanlin Can you make a g3fix?

@fuzzybinary

Copy link
Copy Markdown
Contributor Author

Doc comment added. Thanks everyone!

@hellohuanlin

Copy link
Copy Markdown
Contributor

G3 fix is in. Running test again.

@hellohuanlin

Copy link
Copy Markdown
Contributor

G3 fix is approved. re-running.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 24, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 25, 2026
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
Plugins occasionally need to communicate with other native plugins.

On iOS, plugins are able to publish values that should be accessible to
other plugins. The easiest way to allow to these published value is to
add an accessor in FlutterPluginRegistrar, similar to the one that
exists in FlutterPluginRegistry (valuePublishedByPlugin).

On Android, we can ask for the plugin class directly by added and
accessor to `FlutterPluginBinding` called `getPlugin`, which delegates
to the engine's `FlutterPlugins`.

Fixes flutter#121527

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Apr 14, 2026
Plugins occasionally need to communicate with other native plugins.

On iOS, plugins are able to publish values that should be accessible to
other plugins. The easiest way to allow to these published value is to
add an accessor in FlutterPluginRegistrar, similar to the one that
exists in FlutterPluginRegistry (valuePublishedByPlugin).

On Android, we can ask for the plugin class directly by added and
accessor to `FlutterPluginBinding` called `getPlugin`, which delegates
to the engine's `FlutterPlugins`.

Fixes flutter#121527

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
fuzzybinary added a commit to fuzzybinary/packages that referenced this pull request May 14, 2026
A new way of supporting cross plugin communication is coming in Flutter 3.44 which allows for access to plugin published values through the `FlutterPluginBinding` on Android and the `FlutterPluginRegistry` on iOS. Update native WebView access to support these new methods and deprecate the old methods.

refs: flutter/flutter#121527 flutter/flutter#182753

# Conflicts:
#	packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml
fuzzybinary added a commit to fuzzybinary/packages that referenced this pull request May 14, 2026
A new way of supporting cross plugin communication is coming in Flutter 3.44 which allows for access to plugin published values through the `FlutterPluginBinding` on Android and the `FlutterPluginRegistry` on iOS. Update native WebView access to support these new methods and deprecate the old methods.

refs: flutter/flutter#121527 flutter/flutter#182753

# Conflicts:
#	packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml
fuzzybinary added a commit to fuzzybinary/packages that referenced this pull request May 14, 2026
A new way of supporting cross plugin communication is coming in Flutter 3.44 which allows for access to plugin published values through the `FlutterPluginBinding` on Android and the `FlutterPluginRegistry` on iOS. Update native WebView access to support these new methods and deprecate the old methods.

refs: flutter/flutter#121527 flutter/flutter#182753

# Conflicts:
#	packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 4, 2026
A new way of supporting cross plugin communication is coming in Flutter 3.44 which allows for access to plugin published values through the `FlutterPluginBinding` on Android and the `FlutterPluginRegistry` on iOS. Update native WebView access to support these new methods and deprecate the old methods.

refs: flutter/flutter#121527 flutter/flutter#182753

## Pre-Review Checklist
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
A new way of supporting cross plugin communication is coming in Flutter 3.44 which allows for access to plugin published values through the `FlutterPluginBinding` on Android and the `FlutterPluginRegistry` on iOS. Update native WebView access to support these new methods and deprecate the old methods.

refs: flutter/flutter#121527 flutter/flutter#182753

## Pre-Review Checklist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. fyi-ecosystem For the attention of Ecosystem team platform-android Android applications specifically platform-ios iOS applications specifically team-android Owned by Android platform team team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow plugins to access published plugin values via the plugin registrar/binding

7 participants