This commit is contained in:
Woit 2024-11-25 12:49:47 +01:00
parent 477e58f35c
commit a59d3bbeb7
3 changed files with 23 additions and 6 deletions

View file

@ -3736,6 +3736,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3826,6 +3827,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3918,6 +3920,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -4010,6 +4013,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -4102,6 +4106,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -4194,6 +4199,7 @@
MARKETING_VERSION = 1.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View file

@ -1,3 +1,4 @@
import monalxmpp
import SwiftUI
@main
@ -5,6 +6,10 @@ struct AnotherIMApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@StateObject var wrapper = MonalXmppWrapper()
init() {
DDLog.add(DDOSLogger.sharedInstance, with: .all)
}
var body: some Scene {
WindowGroup {
RootView()
@ -13,4 +18,9 @@ struct AnotherIMApp: App {
}
}
class AppDelegate: NSObject, UIApplicationDelegate {}
class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillEnterForeground(_: UIApplication) {
// let manager = MLXMPPManager.sharedInstance()
// manager.nowForegrounded()
}
}

View file

@ -25,7 +25,8 @@ final class MonalXmppWrapper: ObservableObject {
NotificationCenter.default.post(name: Notification.Name(kMonalRefresh), object: nil)
// reconnect
xmpp.connectIfNecessary()
// xmpp.nowForegrounded()
// xmpp.connectIfNecessary()
}
deinit {
@ -85,12 +86,10 @@ private final class LoginTry {
// Обработать кейс когда бесячий monalxmpp возвращает nil при попытке добавить тот же JID
func tryLogin(_ login: String, _ password: String) async -> Bool {
async let notify = await withCheckedContinuation { [weak self] continuation in
self?.successObserver = NotificationCenter.default.addObserver(forName: Notification.Name("kMLResourceBoundNotice"), object: nil, queue: .main) { notification in
print(notification.debugDescription)
self?.successObserver = NotificationCenter.default.addObserver(forName: Notification.Name("kMLResourceBoundNotice"), object: nil, queue: .main) { _ in
continuation.resume(returning: true)
}
self?.failureObserver = NotificationCenter.default.addObserver(forName: Notification.Name("kXMPPError"), object: nil, queue: .main) { notification in
print(notification.debugDescription)
self?.failureObserver = NotificationCenter.default.addObserver(forName: Notification.Name("kXMPPError"), object: nil, queue: .main) { _ in
continuation.resume(returning: false)
}
}
@ -188,6 +187,8 @@ final class MonalChatWrapper: ObservableObject {
self.contact = contact
self.db = db
self.xmpp = xmpp
subscribe()
}
deinit {