[cloud_functions] Fix method channel name#1862
Conversation
| /// plugin. | ||
| @visibleForTesting | ||
| static const MethodChannel channel = MethodChannel( | ||
| 'plugins.flutter.io/cloud_functions', |
There was a problem hiding this comment.
When I created this file, I was copying and modifying a different plugin and didn't understand exactly how MethodChannel names worked. The plugin I was cribbing from used a different naming convention, and I didn't catch the mistake. The unit tests only check to see that the MethodChannel gets invoked, not what the channel name is. Moreover, the actual iOS and Android implementations are in the cloud_functions plugin, not this platform interface plugin, meaning integration testing is problematic. This feels to me like an architecture problem -- like maybe the method channel implementation should be in the plugin with the platform implementations -- but there are ramifications that get complicated, and the "right thing" might wind up being a breaking change.
Description
In implementing the
MethodChannelCloudFunctionsI assigned the wrong name to the channel. This meant that the tests passed (because the channel was being invoked) but that when the cloud_functions plugin with iOS or Android implementations was used, the invocation would fail because the channel wouldn't be found.This change fixes the method channel name so that it matches the name being registered by the iOS and Android plugins.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?