Skip to content

Commit

Permalink
Added application callback (flutter#5369)
Browse files Browse the repository at this point in the history
* Added application callback

* Formatting
  • Loading branch information
bparrishMines authored May 25, 2018
1 parent 933d406 commit a1a54ad
Show file tree
Hide file tree
Showing 2 changed files with 23 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
14 changes: 14 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,20 @@ - (void)application:(UIApplication*)application
}
}

- (void)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:userActivty
restorationHandler:restorationHandler]) {
return;
}
}
}
}

// 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 a1a54ad

Please sign in to comment.