From 85faf7e029a7cfb786ce15fe090b81ae78e0e62a Mon Sep 17 00:00:00 2001 From: Brandon Parrish Date: Tue, 29 May 2018 13:56:12 -0700 Subject: [PATCH] Correctly added application callback for dynamic links (flutter/engine#5385) * Correctly added application callback for dynamic links * Misspelling --- .../darwin/ios/framework/Headers/FlutterPlugin.h | 9 +++++++++ .../ios/framework/Source/FlutterAppDelegate.mm | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 646ffa30d7..1fe71dd8b2 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -146,6 +146,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + + - Returns: `YES` if this plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler; @end /** diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index a5132bf4ee..6e8d07d183 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -235,6 +235,21 @@ } } +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]) { + return YES; + } + } + } + return NO; +} + // TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. - (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController;