mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-03-30 07:09:48 +08:00
23 lines
591 B
Swift
23 lines
591 B
Swift
//
|
|
// AppLifecycleChannel.swift
|
|
//
|
|
// Created by wanghongen on 2023/12/21.
|
|
//
|
|
|
|
import Foundation
|
|
import FlutterMacOS
|
|
|
|
class AppLifecycleChannel {
|
|
static private var channel : FlutterMethodChannel?
|
|
|
|
//注册
|
|
static func registerChannel(flutterViewController: FlutterViewController) {
|
|
channel = FlutterMethodChannel(name: "com.proxy/appLifecycle", binaryMessenger: flutterViewController.engine.binaryMessenger)
|
|
}
|
|
|
|
static func appDetached() {
|
|
channel!.invokeMethod("appDetached", arguments: nil)
|
|
Thread.sleep(forTimeInterval: 0.5)
|
|
}
|
|
}
|