From 3122786ad52ae33009ee696896b8ab7b0a1ae93d Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 10 Jul 2019 13:10:05 -0700 Subject: [PATCH] Fixed build of example code to use new binary messenger API. (#35825) Fixed build of example code to use new binary messenger API. --- dev/bots/test.dart | 8 +++----- .../platform_channel_swift/ios/Runner/AppDelegate.swift | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dev/bots/test.dart b/dev/bots/test.dart index fc739f1a96..7818b77c9c 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -272,12 +272,10 @@ Future _runBuildTests() async { continue; } final String examplePath = fileEntity.path; - final String basename = path.basename(examplePath); - final bool expectIpaBuildFailure = basename == 'platform_channel_swift'; // Remove when https://github.com/flutter/flutter/issues/35773 is fixed. await _flutterBuildAot(examplePath); await _flutterBuildApk(examplePath); - await _flutterBuildIpa(examplePath, expectIpaBuildFailure: expectIpaBuildFailure); + await _flutterBuildIpa(examplePath); } await _flutterBuildDart2js(path.join('dev', 'integration_tests', 'web')); @@ -322,7 +320,7 @@ Future _flutterBuildApk(String relativePathToApplication) async { print('Done.'); } -Future _flutterBuildIpa(String relativePathToApplication, {bool expectIpaBuildFailure = false}) async { +Future _flutterBuildIpa(String relativePathToApplication) async { if (!Platform.isMacOS) { return; } @@ -341,7 +339,7 @@ Future _flutterBuildIpa(String relativePathToApplication, {bool expectIpaB await runCommand(flutter, ['build', 'ios', '--no-codesign', '--debug', '-v'], workingDirectory: path.join(flutterRoot, relativePathToApplication), - expectNonZeroExit: expectIpaBuildFailure, + expectNonZeroExit: false, timeout: _kShortTimeout, ); print('Done.'); diff --git a/examples/platform_channel_swift/ios/Runner/AppDelegate.swift b/examples/platform_channel_swift/ios/Runner/AppDelegate.swift index 04ca367664..937c819746 100644 --- a/examples/platform_channel_swift/ios/Runner/AppDelegate.swift +++ b/examples/platform_channel_swift/ios/Runner/AppDelegate.swift @@ -31,7 +31,7 @@ enum MyFlutterErrorCode { fatalError("rootViewController is not type FlutterViewController") } let batteryChannel = FlutterMethodChannel(name: ChannelName.battery, - binaryMessenger: controller) + binaryMessenger: controller.binaryMessenger) batteryChannel.setMethodCallHandler({ [weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in guard call.method == "getBatteryLevel" else { @@ -42,7 +42,7 @@ enum MyFlutterErrorCode { }) let chargingChannel = FlutterEventChannel(name: ChannelName.charging, - binaryMessenger: controller) + binaryMessenger: controller.binaryMessenger) chargingChannel.setStreamHandler(self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) }