Code effected
iOS code that sets up channels manually (not plugins).
PR
https://github.com/flutter/engine/pull/9419
Old architecture
New architecture
Justification
The old architecture could lead to inadvertent retain cycles. For example:
FlutterEngine *-- FlutterPlugin *-- FlutterMethodChannel *-- FlutterEngine
This is of particular interest to the add-to-app flow.
Relevant Issue:
https://github.com/flutter/flutter/issues/26007
Migration
Old Code:
[FlutterMethodChannel
methodChannelWithName:@"foo"
binaryMessenger:flutterViewController]
New Code:
[FlutterMethodChannel
methodChannelWithName:@"foo"
binaryMessenger:flutterViewController.binaryMessenger]
Plugins:
Plugins usually get the binary messenger from the FlutterPluginRegistrar (ex. [registrar messenger]), so they shouldn't be affected.
In Closing
This proposal should be an easy migration that shouldn't affect many people. Let me know if this would be a problem for you.