From 6eb76315eb5e83f8bb81be679257accfd31533c2 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:22:01 +0100 Subject: [PATCH] ios: NSE debug logging --- apps/ios/SimpleX NSE/NotificationService.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/ios/SimpleX NSE/NotificationService.swift b/apps/ios/SimpleX NSE/NotificationService.swift index c937786210..8decba34d1 100644 --- a/apps/ios/SimpleX NSE/NotificationService.swift +++ b/apps/ios/SimpleX NSE/NotificationService.swift @@ -26,15 +26,17 @@ class NotificationService: UNNotificationServiceExtension { self.contentHandler = contentHandler receiveNtfMessages(request, contentHandler) case .suspending: + logger.debug("NotificationService: app is suspending") self.contentHandler = contentHandler receiveNtfMessages(request, contentHandler) default: - print("userInfo", request.content.userInfo) + logger.debug("NotificationService: app state is \(appState.rawValue, privacy: .public)") contentHandler(request.content) } } func receiveNtfMessages(_ request: UNNotificationRequest, _ contentHandler: @escaping (UNNotificationContent) -> Void) { + logger.debug("NotificationService: receiveNtfMessages") if case .documents = dbContainerGroupDefault.get() { contentHandler(request.content) return @@ -44,13 +46,17 @@ class NotificationService: UNNotificationServiceExtension { let nonce = ntfData["nonce"] as? String, let encNtfInfo = ntfData["message"] as? String, let _ = startChat() { + logger.debug("NotificationService: receiveNtfMessages: chat is started") if let ntfMsgInfo = apiGetNtfMessage(nonce: nonce, encNtfInfo: encNtfInfo) { + logger.debug("NotificationService: receiveNtfMessages: apiGetNtfMessage \(String(describing: ntfMsgInfo), privacy: .public)") if let connEntity = ntfMsgInfo.connEntity { bestAttemptContent = createConnectionEventNtf(connEntity) } if let content = receiveMessageForNotification() { + logger.debug("NotificationService: receiveMessageForNotification: has message") contentHandler(content) } else if let content = bestAttemptContent { + logger.debug("NotificationService: receiveMessageForNotification: no message") contentHandler(content) } }