Expose performActionForShortcutItem call to all registered plugins so we can handle quick actions (flutter/engine#3763)
* Expose performActionForShortcutItem call to all registered plugins so we can handle quick actions * Should return BOOL not void * clang-formatted
This commit is contained in:
committed by
GitHub
parent
89ab65beea
commit
f38ab73dab
@@ -98,8 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
handleOpenURL:(NSURL*)url;
|
||||
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url;
|
||||
|
||||
/**
|
||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
||||
@@ -107,9 +106,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
openURL:(NSURL*)url
|
||||
sourceApplication:(NSString*)sourceApplication
|
||||
annotation:(id)annotation;
|
||||
openURL:(NSURL*)url
|
||||
sourceApplication:(NSString*)sourceApplication
|
||||
annotation:(id)annotation;
|
||||
|
||||
/**
|
||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
||||
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
|
||||
completionHandler:(void (^)(BOOL succeeded))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
|
||||
@@ -155,8 +155,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
handleOpenURL:(NSURL*)url {
|
||||
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url {
|
||||
for (id<FlutterPlugin> plugin in _pluginDelegates) {
|
||||
if ([plugin respondsToSelector:_cmd]) {
|
||||
if ([plugin application:application handleOpenURL:url]) {
|
||||
@@ -168,15 +167,15 @@
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
openURL:(NSURL*)url
|
||||
sourceApplication:(NSString*)sourceApplication
|
||||
annotation:(id)annotation {
|
||||
openURL:(NSURL*)url
|
||||
sourceApplication:(NSString*)sourceApplication
|
||||
annotation:(id)annotation {
|
||||
for (id<FlutterPlugin> plugin in _pluginDelegates) {
|
||||
if ([plugin respondsToSelector:_cmd]) {
|
||||
if ([plugin application:application
|
||||
openURL:url
|
||||
sourceApplication:sourceApplication
|
||||
annotation:annotation]) {
|
||||
openURL:url
|
||||
sourceApplication:sourceApplication
|
||||
annotation:annotation]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
@@ -184,6 +183,20 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)application:(UIApplication*)application
|
||||
performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
|
||||
completionHandler:(void (^)(BOOL succeeded))completionHandler {
|
||||
for (id<FlutterPlugin> plugin in _pluginDelegates) {
|
||||
if ([plugin respondsToSelector:_cmd]) {
|
||||
if ([plugin application:application
|
||||
performActionForShortcutItem:shortcutItem
|
||||
completionHandler:completionHandler]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSObject<FlutterPluginRegistrar>*)registrarForPlugin:(NSString*)pluginKey {
|
||||
NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey);
|
||||
self.pluginPublications[pluginKey] = [NSNull null];
|
||||
|
||||
Reference in New Issue
Block a user