filter notification text

pull/1/head
Michael Kirk 6 years ago
parent d88ffc4775
commit fe4e416daf

@ -156,6 +156,7 @@ extension LegacyNotificationPresenterAdaptee: NotificationPresenterAdaptee {
let alertBody: String
if let title = title {
// TODO - Make this a format string for better l10n
alertBody = title.rtlSafeAppend(":").rtlSafeAppend(" ").rtlSafeAppend(body)
} else {
alertBody = body
@ -163,7 +164,7 @@ extension LegacyNotificationPresenterAdaptee: NotificationPresenterAdaptee {
let notification = UILocalNotification()
notification.category = category.identifier
notification.alertBody = alertBody
notification.alertBody = alertBody.filterForDisplay
notification.userInfo = userInfo
notification.soundName = sound?.filename

@ -132,10 +132,12 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee {
}
if shouldPresentNotification(category: category, userInfo: userInfo) {
if let title = title {
content.title = title
if let displayableTitle = title?.filterForDisplay {
content.title = displayableTitle
}
if let displayableBody = body.filterForDisplay {
content.body = displayableBody
}
content.body = body
} else {
// Play sound and vibrate, but without a `body` no banner will show.
Logger.debug("supressing notification body")

Loading…
Cancel
Save