Skip to content

Commit

Permalink
Correctly added application callback for dynamic links (flutter#5385)
Browse files Browse the repository at this point in the history
* Correctly added application callback for dynamic links

* Misspelling
  • Loading branch information
bparrishMines authored May 29, 2018
1 parent 0dca520 commit 8c564ad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
15 changes: 15 additions & 0 deletions shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,21 @@ - (void)application:(UIApplication*)application
}
}

- (BOOL)application:(UIApplication*)application
continueUserActivity:(NSUserActivity*)userActivity
restorationHandler:(void (^)(NSArray*))restorationHandler {
for (id<FlutterPlugin> 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<FlutterBinaryMessenger>*)binaryMessenger {
UIViewController* rootViewController = _window.rootViewController;
Expand Down

0 comments on commit 8c564ad

Please sign in to comment.