Marino Faggiana před 6 roky
rodič
revize
d2e09fd49a

+ 7 - 9
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")
     }
 
 }