From 75f7a7973b4ce4bc199afa7856e734d744fd2a57 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 3 Dec 2020 17:26:29 +1100 Subject: [PATCH] Debug PN extension --- Podfile | 1 - Podfile.lock | 2 +- .../NotificationServiceExtension.swift | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Podfile b/Podfile index dc63545b6..59d3020d3 100644 --- a/Podfile +++ b/Podfile @@ -32,7 +32,6 @@ target 'SessionShareExtension' do end target 'SessionNotificationServiceExtension' do - pod 'CryptoSwift', :inhibit_warnings => true pod 'Curve25519Kit', git: 'https://github.com/signalapp/Curve25519Kit.git', :inhibit_warnings => true pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', :inhibit_warnings => true pod 'YapDatabase/SQLCipher', :git => 'https://github.com/loki-project/session-ios-yap-database.git', branch: 'signal-release', :inhibit_warnings => true diff --git a/Podfile.lock b/Podfile.lock index d81730612..e843a6e1c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -230,6 +230,6 @@ SPEC CHECKSUMS: YYImage: 6db68da66f20d9f169ceb94dfb9947c3867b9665 ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 78c69e4efd6f98e563a7da1481741827fb18e21e +PODFILE CHECKSUM: 7699c2a380fc803ef7f51157f1f75da756aa3b45 COCOAPODS: 1.10.0.rc.1 diff --git a/SessionNotificationServiceExtension/NotificationServiceExtension.swift b/SessionNotificationServiceExtension/NotificationServiceExtension.swift index 844b37895..fbae95002 100644 --- a/SessionNotificationServiceExtension/NotificationServiceExtension.swift +++ b/SessionNotificationServiceExtension/NotificationServiceExtension.swift @@ -45,9 +45,9 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension return self.handleFailure(for: notificationContent) } let snippet = tsIncomingMessage.previewText(with: transaction).filterForDisplay - let userInfo: [String:Any] = [ NotificationServiceExtension.threadIdKey : tsIncomingMessage.thread.uniqueId!, NotificationServiceExtension.isFromRemoteKey : true ] + let userInfo: [String:Any] = [ NotificationServiceExtension.threadIdKey : tsIncomingMessage.thread(with: transaction).uniqueId!, NotificationServiceExtension.isFromRemoteKey : true ] let senderPublicKey = message.sender! - let senderDisplayName = OWSProfileManager.shared().profileNameForRecipient(withID: senderPublicKey, avoidWriteTransaction: true) ?? senderPublicKey + let senderDisplayName = OWSProfileManager.shared().profileNameForRecipient(withID: senderPublicKey, transaction: transaction) ?? senderPublicKey notificationContent.userInfo = userInfo notificationContent.badge = 1 let notificationsPreference = Environment.shared.preferences!.notificationPreviewType()