device_identity/ios/Classes/SwiftDeviceIdentityPlugin.swift

15 lines
528 B
Swift
Raw Permalink Normal View History

2023-05-10 16:07:15 +08:00
import Flutter
import UIKit
public class SwiftDeviceIdentityPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "device_identity", binaryMessenger: registrar.messenger())
let instance = SwiftDeviceIdentityPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result("iOS " + UIDevice.current.systemVersion)
}
}