This commit is contained in:
DDIsFriend
2023-08-30 18:35:34 +08:00
parent 456b879a00
commit cce7060345
11 changed files with 163 additions and 5 deletions

View File

@@ -19,9 +19,19 @@ class NotificationService: UNNotificationServiceExtension {
if let bestAttemptContent = bestAttemptContent {
// Modify the notification content here...
// bestAttemptContent.title = "\(bestAttemptContent.title) [modified]"
let userInfo = bestAttemptContent.userInfo
if let dict = GROUP.parserAlertToDictionary(userInfo: userInfo) {
if let title = dict[pushNoti_title_key] {
bestAttemptContent.title = title
}
if let body = dict[pushNoti_body_key] {
bestAttemptContent.body = body
}
}else if let body = GROUP.parserAlertToString(userInfo: userInfo) {
bestAttemptContent.body = body
}
// group
if GROUP.isOrderPushNotification(userInfo: userInfo) == true {
var sound : UNNotificationSound?