From 83ecfe239e607f066b18809c1c19e7788aa7a8a4 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 21 Oct 2020 00:40:35 +0200 Subject: [PATCH] ios quick_actions: Add workaround https://github.com/flutter/flutter/issues/13634 --- ios/Runner/AppDelegate.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index 02b7eecb..5c94b51c 100644 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -329,4 +329,12 @@ bool handleError(FlutterResult result, int err) { return true; } + +// For quick_actions - https://github.com/flutter/flutter/issues/13634 +- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler { + FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController; + + FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/quick_actions" binaryMessenger:controller]; + [channel invokeMethod:@"launch" arguments:shortcutItem.type]; +} @end