Bark/notificationContentExtension/UNNotificationContent+Extension.swift
2025-08-26 14:31:44 +08:00

22 lines
507 B
Swift

//
// UNNotificationContent+Extension.swift
// NotificationContentExtension
//
// Created by huangfeng on 8/26/25.
// Copyright © 2025 Fin. All rights reserved.
//
import UIKit
extension UNNotificationContent {
var bodyText: String {
guard let aps = self.userInfo["aps"] as? [String: Any],
let alert = aps["alert"] as? [String: Any],
let bodyText = alert["body"] as? String
else {
return self.body
}
return bodyText
}
}