Open afl-dev opened 11 months ago
same for me, in iOS when running app event handler not called. share_handler: ^0.0.19
import share_handler_ios
@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 {
let sharingIntent = SwiftShareHandlerIosPlatform.instance
/// if the url is made from SwiftFlutterSharingIntentPlugin then handle it with plugin [SwiftFlutterSharingIntentPlugin]
if sharingIntent.hasMatchingSchemePrefix(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)
}
}
Try adding above override function in AppDelegate. Its helps me.
iOS not work event handler ShareHandler.instance.sharedMediaStream, when the application is running and we try to send a file, it is not called event handler, on startup everything is fine (ShareHandler.instance.getInitialSharedMedia())
share_handler: ^0.0.18