2024-11-25 11:49:47 +00:00
|
|
|
import monalxmpp
|
2024-11-18 14:53:52 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
@main
|
|
|
|
struct AnotherIMApp: App {
|
2024-11-20 15:52:49 +00:00
|
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
2024-11-19 12:59:22 +00:00
|
|
|
@StateObject var wrapper = MonalXmppWrapper()
|
|
|
|
|
2024-11-25 11:49:47 +00:00
|
|
|
init() {
|
|
|
|
DDLog.add(DDOSLogger.sharedInstance, with: .all)
|
2024-11-29 17:43:27 +00:00
|
|
|
MLProcessLock.initialize(forProcess: "MainApp")
|
2024-11-25 11:49:47 +00:00
|
|
|
}
|
|
|
|
|
2024-11-18 14:53:52 +00:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2024-11-20 13:31:51 +00:00
|
|
|
RootView()
|
|
|
|
.environmentObject(wrapper)
|
2024-11-18 14:53:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-20 15:52:49 +00:00
|
|
|
|
2024-11-25 11:49:47 +00:00
|
|
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
|
|
func applicationWillEnterForeground(_: UIApplication) {
|
2024-11-27 15:49:36 +00:00
|
|
|
MLXMPPManager.sharedInstance().nowForegrounded()
|
|
|
|
}
|
|
|
|
|
|
|
|
func applicationDidEnterBackground(_: UIApplication) {
|
|
|
|
MLXMPPManager.sharedInstance().nowBackgrounded()
|
2024-11-25 11:49:47 +00:00
|
|
|
}
|
|
|
|
}
|