You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
30 lines
1.0 KiB
import Flutter
|
|
import UIKit
|
|
|
|
public class DeepvoiceUtilsPlugin: NSObject, FlutterPlugin {
|
|
private static let TAG = "DeepvoiceUtilsPlugin"
|
|
|
|
public static func register(with registrar: FlutterPluginRegistrar) {
|
|
let channel = FlutterMethodChannel(name: "deepvoice_utils", binaryMessenger: registrar.messenger())
|
|
let instance = DeepvoiceUtilsPlugin()
|
|
registrar.addMethodCallDelegate(instance, channel: channel)
|
|
|
|
// 初始化文件日志
|
|
FileLogger.initialize()
|
|
FileLogger.d(TAG, "DeepvoiceUtilsPlugin 已初始化")
|
|
}
|
|
|
|
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
|
|
switch call.method {
|
|
case "getPlatformVersion":
|
|
result("iOS \(UIDevice.current.systemVersion)")
|
|
default:
|
|
result(FlutterMethodNotImplemented)
|
|
}
|
|
}
|
|
|
|
public func detachFromEngine(for registrar: FlutterPluginRegistrar) {
|
|
// 关闭日志系统
|
|
FileLogger.shutdown()
|
|
}
|
|
}
|