diff options
author | Marino Faggiana <m.faggiana@twsweb.it> | 2018-08-02 17:34:28 +0300 |
---|---|---|
committer | Marino Faggiana <marinofaggiana@MacBook-Pro-di-Marino.local> | 2018-08-02 17:34:28 +0300 |
commit | 8202e0aff94f21ccd532d09ea4cecb412c53b584 (patch) | |
tree | 031527d8554c0ab30123511b6ce238a3910a45a0 /Notification Service Extension | |
parent | c064eec7b821c4adb9b61c23deab2c7b126a6656 (diff) |
Push Notification
Diffstat (limited to 'Notification Service Extension')
-rw-r--r-- | Notification Service Extension/NotificationService.swift | 7 | ||||
-rw-r--r-- | Notification Service Extension/NotificationServiceExtension-Bridging-Header.h | 1 |
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" |