Generic OS-notification + window-focus surface. Hand-rolled MethodChannel + EventChannel, registered through XPlugin alongside the existing camera / video / clipboard plugins. macOS native handler uses UNUserNotificationCenter with thread-grouping support, NSApp activation on tap, and NSApplicationDidBecomeActive/DidResignActive for the focus signal (more reliable than Flutter's AppLifecycleState on macOS).
26 lines
680 B
Swift
26 lines
680 B
Swift
import FlutterMacOS
|
|
import AppKit
|
|
|
|
public class XPlugin: NSObject, FlutterPlugin {
|
|
private static var plugins: [NativePlugin] = []
|
|
|
|
public static func register(with registrar: FlutterPluginRegistrar) {
|
|
plugins = [
|
|
FilePlugin(),
|
|
ClipboardPlugin(),
|
|
GalleryPlugin(),
|
|
CameraPlugin(),
|
|
UxVideoPlayerPlugin(),
|
|
UrlPlugin(),
|
|
NotificationsPlugin(),
|
|
]
|
|
for plugin in plugins {
|
|
plugin.register(with: registrar)
|
|
}
|
|
}
|
|
|
|
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
result(FlutterMethodNotImplemented)
|
|
}
|
|
}
|