Forward openURL requests to plugins (flutter/engine#3679)
This commit is contained in:
committed by
GitHub
parent
498a9da159
commit
27fcb31df5
@@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
||||
|
||||
- Returns: `YES` if this plugin handles request.
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
didReceiveRemoteNotification:(NSDictionary*)userInfo
|
||||
@@ -96,10 +96,20 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
||||
|
||||
- Returns: `YES` if this plugin handles request.
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
handleOpenURL:(NSURL*)url;
|
||||
|
||||
/**
|
||||
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
|
||||
|
||||
- Returns: `YES` if this plugin handles the request.
|
||||
*/
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
openURL:(NSURL*)url
|
||||
sourceApplication:(NSString*)sourceApplication
|
||||
annotation:(id)annotation;
|
||||
@end
|
||||
|
||||
/**
|
||||
|
||||
@@ -167,6 +167,23 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication*)application
|
||||
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]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (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