Skip to content

Commit

Permalink
fix: Support plain text push notifications #2070 (#2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
priyonto authored Jul 2, 2024
1 parent e5f147f commit a2404ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ class NotificationService: UNNotificationServiceExtension {
let bestAttemptContent {
// If this value is not available on data, show formatted message.
// Otherwise don't do anything.
let showLocallyFormattedMessage = userInfo["showLocallyFormatted"] as? Bool ?? true
if showLocallyFormattedMessage {
var showLocallyFormatted: Bool = true
// Its a shame that properties from userInfo are always string somehow.
// So, cast it as string and compare with 'false' value.
if let showLocallyFormattedMessage = userInfo["showLocallyFormatted"] as? String {
showLocallyFormatted = showLocallyFormattedMessage != "false"
}
if showLocallyFormatted {
if let sensorName = userInfo["name"] as? String,
let alertType = userInfo["alertType"] as? String,
let triggerType = userInfo["triggerType"] as? String,
Expand Down
2 changes: 1 addition & 1 deletion station.localization

0 comments on commit a2404ab

Please sign in to comment.