Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarino Faggiana <m.faggiana@twsweb.it>2018-08-02 17:34:28 +0300
committerMarino Faggiana <marinofaggiana@MacBook-Pro-di-Marino.local>2018-08-02 17:34:28 +0300
commit8202e0aff94f21ccd532d09ea4cecb412c53b584 (patch)
tree031527d8554c0ab30123511b6ce238a3910a45a0 /Notification Service Extension
parentc064eec7b821c4adb9b61c23deab2c7b126a6656 (diff)
Push Notification
Diffstat (limited to 'Notification Service Extension')
-rw-r--r--Notification Service Extension/NotificationService.swift7
-rw-r--r--Notification Service Extension/NotificationServiceExtension-Bridging-Header.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/Notification Service Extension/NotificationService.swift b/Notification Service Extension/NotificationService.swift
index 20da432f5..48cd19c33 100644
--- a/Notification Service Extension/NotificationService.swift
+++ b/Notification Service Extension/NotificationService.swift
@@ -41,11 +41,16 @@ class NotificationService: UNNotificationServiceExtension {
let message = bestAttemptContent.userInfo["subject"] as! String
guard let decryptedMessage = NCPushNotificationEncryption.sharedInstance().decryptPushNotification(message, withDevicePrivateKey: CCUtility.getPushNotificationPrivateKey()) else {
+
contentHandler(bestAttemptContent)
return
}
- bestAttemptContent.body = decryptedMessage
+ let pushNotification = NCPushNotification.init(fromDecryptedString: decryptedMessage)
+ if (pushNotification != nil) {
+ bestAttemptContent.title = ""
+ bestAttemptContent.body = pushNotification!.bodyForRemoteAlerts()
+ }
contentHandler(bestAttemptContent)
}
diff --git a/Notification Service Extension/NotificationServiceExtension-Bridging-Header.h b/Notification Service Extension/NotificationServiceExtension-Bridging-Header.h
index d00d9eecf..c40b5fa8f 100644
--- a/Notification Service Extension/NotificationServiceExtension-Bridging-Header.h
+++ b/Notification Service Extension/NotificationServiceExtension-Bridging-Header.h
@@ -23,6 +23,7 @@
#import "CCUtility.h"
#import "NCPushNotificationEncryption.h"
+#import "NCPushNotification.h"
#import "OCActivity.h"
#import "OCUserProfile.h"