From 96de5ba10ee003f5a25b3ed50b873211e526fffd Mon Sep 17 00:00:00 2001 From: Tamara Slosarek Date: Thu, 8 Jun 2023 14:01:00 +0200 Subject: [PATCH] fix: keep previous function in AppDelegate --- app/ios/Runner/AppDelegate.swift | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/ios/Runner/AppDelegate.swift b/app/ios/Runner/AppDelegate.swift index 61fa59bc8..718ff9f73 100644 --- a/app/ios/Runner/AppDelegate.swift +++ b/app/ios/Runner/AppDelegate.swift @@ -4,13 +4,18 @@ import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + override func application( _ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { - // This line is not in the flutter_sharing_intent tutorial but was here - // before - GeneratedPluginRegistrant.register(with: self) let sharingIntent = SwiftFlutterSharingIntentPlugin.instance // if the url is made from SwiftFlutterSharingIntentPlugin then handle it // with plugin [SwiftFlutterSharingIntentPlugin] @@ -18,6 +23,6 @@ import Flutter return sharingIntent.application(app, open: url, options: options) } // Proceed url handling for other Flutter libraries like uni_links - return super.application(app, open: url, options:options) + return super.application(app, open: url, options: options) } -} +} \ No newline at end of file