38 lines
1.5 KiB
Swift
38 lines
1.5 KiB
Swift
import UIKit
|
|
import Flutter
|
|
import flutter_downloader
|
|
import receive_sharing_intent
|
|
|
|
@UIApplicationMain
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
GeneratedPluginRegistrant.register(with: self)
|
|
FlutterDownloaderPlugin.setPluginRegistrantCallback { registry in
|
|
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
|
|
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
|
|
}
|
|
}
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
}
|
|
|
|
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
|
|
let sharingIntent = SwiftReceiveSharingIntentPlugin.instance
|
|
if sharingIntent.hasMatchingSchemePrefix(url: url) {
|
|
return sharingIntent.application(app, open: url, options: options)
|
|
}
|
|
|
|
// For example load MSALPublicClientApplication
|
|
// return MSALPublicClientApplication.handleMSALResponse(url, sourceApplication: options[.sourceApplication] as? String)
|
|
|
|
// Cancel url handling
|
|
// return false
|
|
|
|
// Proceed url handling for other Flutter libraries like uni_links
|
|
return super.application(app, open: url, options:options)
|
|
}
|
|
|
|
}
|