mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
22 lines
507 B
Swift
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
|
|
}
|
|
}
|