Skip to content

Commit

Permalink
fix: keep previous function in AppDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Jun 8, 2023
1 parent 4ae6ef1 commit 96de5ba
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ 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]
if sharingIntent.hasSameSchemePrefix(url: url) {
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)
}
}
}

0 comments on commit 96de5ba

Please sign in to comment.