提交 4f5d6fab 编写于 作者: T Todd Volkert 提交者: GitHub

Add support for `application:openURL:options:` in FlutterPlugin (#3766)

Both the following, which we also support, are deprecated in UIKit:

* `application:handleOpenURL:`
* `application:openURL:sourceApplication:annotation:`
上级 800d817b
......@@ -93,6 +93,15 @@ NS_ASSUME_NONNULL_BEGIN
didReceiveRemoteNotification:(NSDictionary*)userInfo
fetchCompletionHandler:(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
openURL:(NSURL*)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
/**
Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
......
......@@ -155,6 +155,21 @@
}
}
- (BOOL)application:(UIApplication*)application
openURL:(NSURL*)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options {
for (id<FlutterPlugin> plugin in _pluginDelegates) {
if ([plugin respondsToSelector:_cmd]) {
if ([plugin application:application
openURL:url
options:options]) {
return YES;
}
}
}
return NO;
}
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url {
for (id<FlutterPlugin> plugin in _pluginDelegates) {
if ([plugin respondsToSelector:_cmd]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册