diff options
author | Marino Faggiana <m.faggiana@twsweb.it> | 2018-08-03 10:14:18 +0300 |
---|---|---|
committer | Marino Faggiana <marinofaggiana@mbp-di-marino.homenet.telecomitalia.it> | 2018-08-03 10:14:18 +0300 |
commit | d2e09fd49ae3ecc2a209fb8e84b2a5c79623f21b (patch) | |
tree | 11f3652ba2a68f645aa106abb768202acfc4aad8 /Notification Service Extension | |
parent | 1b37650141ad0b543679ff00b28d87eac53cc742 (diff) |
fix
Diffstat (limited to 'Notification Service Extension')
-rw-r--r-- | Notification Service Extension/NotificationService.swift | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Notification Service Extension/NotificationService.swift b/Notification Service Extension/NotificationService.swift index 98a4d9875..eb523e050 100644 --- a/Notification Service Extension/NotificationService.swift +++ b/Notification Service Extension/NotificationService.swift @@ -36,7 +36,7 @@ class NotificationService: UNNotificationServiceExtension { if let bestAttemptContent = bestAttemptContent { - bestAttemptContent.title = "Nextcloud notification 🔔" + bestAttemptContent.title = "" bestAttemptContent.body = "Nextcloud notification 🔔" let message = bestAttemptContent.userInfo["subject"] as! String @@ -51,11 +51,9 @@ class NotificationService: UNNotificationServiceExtension { return } - NSLog("[LOG] PN Decr Message, %@", decryptedMessage) - let pushNotification = NCPushNotification.init(fromDecryptedString: decryptedMessage) if (pushNotification != nil) { - bestAttemptContent.title = "Nextcloud notification 🔔" + bestAttemptContent.title = pushNotification!.app.uppercased() bestAttemptContent.body = pushNotification!.bodyForRemoteAlerts() } @@ -64,14 +62,14 @@ class NotificationService: UNNotificationServiceExtension { } override func serviceExtensionTimeWillExpire() { - // Called just before the extension will be terminated by the system. - // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. + if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { - NSLog("[LOG] PN X1") + + bestAttemptContent.title = "" + bestAttemptContent.body = "Nextcloud notification 🔔" + contentHandler(bestAttemptContent) } - - NSLog("[LOG] PN X2") } } |