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.
18 lines
759 B
18 lines
759 B
import Flutter
|
|
import UIKit
|
|
|
|
public class AzureSpeechRecognitionPlugin: NSObject, FlutterPlugin {
|
|
public static func register(with registrar: FlutterPluginRegistrar) {
|
|
if #available(iOS 13.0, *) {
|
|
SwiftAzureSpeechRecognitionPlugin.register(with: registrar)
|
|
} else {
|
|
// 如果低于iOS 13.0,返回不支持的错误
|
|
let channel = FlutterMethodChannel(name: "com.deep_voice.azure_asr", binaryMessenger: registrar.messenger())
|
|
channel.setMethodCallHandler { (call, result) in
|
|
result(FlutterError(code: "UNSUPPORTED",
|
|
message: "需要iOS 13.0及以上系统",
|
|
details: nil))
|
|
}
|
|
}
|
|
}
|
|
}
|