15 - (void)scene:(UIScene*)scene
16 willConnectToSession:(UISceneSession*)session
17 options:(UISceneConnectionOptions*)connectionOptions {
19 if (appDelegate.window.rootViewController) {
20 NSLog(
@"WARNING - The UIApplicationDelegate is setting up the UIWindow and "
21 @"UIWindow.rootViewController at launch. This was deprecated after the "
22 @"UISceneDelegate adoption. Setup logic should be moved to a UISceneDelegate.");
25 UIWindowScene* windowScene = (UIWindowScene*)scene;
26 self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
27 self.window.rootViewController = appDelegate.window.rootViewController;
28 appDelegate.window =
self.window;
29 [
self.window makeKeyAndVisible];
33 - (void)windowScene:(UIWindowScene*)windowScene
34 performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
35 completionHandler:(
void (^)(BOOL succeeded))completionHandler {
37 if ([appDelegate respondsToSelector:
@selector(lifeCycleDelegate)]) {
39 [lifeCycleDelegate
application:FlutterSharedApplication.application
45 static NSDictionary<UIApplicationOpenURLOptionsKey, id>* ConvertOptions(
46 UISceneOpenURLOptions* options) {
47 if (@available(iOS 14.5, *)) {
49 UIApplicationOpenURLOptionsSourceApplicationKey : options.sourceApplication
50 ? options.sourceApplication
52 UIApplicationOpenURLOptionsAnnotationKey : options.annotation ? options.annotation
54 UIApplicationOpenURLOptionsOpenInPlaceKey : @(options.openInPlace),
55 UIApplicationOpenURLOptionsEventAttributionKey : options.eventAttribution
56 ? options.eventAttribution
61 UIApplicationOpenURLOptionsSourceApplicationKey : options.sourceApplication
62 ? options.sourceApplication
64 UIApplicationOpenURLOptionsAnnotationKey : options.annotation ? options.annotation
66 UIApplicationOpenURLOptionsOpenInPlaceKey : @(options.openInPlace),
71 - (void)scene:(UIScene*)scene openURLContexts:(NSSet<UIOpenURLContext*>*)URLContexts {
73 if ([appDelegate respondsToSelector:
@selector(lifeCycleDelegate)]) {
75 for (UIOpenURLContext* context in URLContexts) {
76 [lifeCycleDelegate
application:FlutterSharedApplication.application
78 options:ConvertOptions(context.options)];
void application:performActionForShortcutItem:completionHandler:(UIApplication *application,[performActionForShortcutItem] UIApplicationShortcutItem *shortcutItem,[completionHandler] ios(9.0) API_AVAILABLE)
BOOL application:openURL:options:(UIApplication *application,[openURL] NSURL *url,[options] NSDictionary< UIApplicationOpenURLOptionsKey, id > *options)
UIApplication * application