fix(ios): unwrap optional title/body in dual-notification path
NotificationContent.title and .body are String?; assigning them to non-optional String caused Swift build errors. Use ?? with the same defaults as the config fallback so both branches yield non-optional title/body.
This commit is contained in:
@@ -476,8 +476,8 @@ public class DailyNotificationPlugin: CAPPlugin {
|
|||||||
let title: String
|
let title: String
|
||||||
let body: String
|
let body: String
|
||||||
if useFetched {
|
if useFetched {
|
||||||
title = fetchedContent.title
|
title = fetchedContent.title ?? "Daily Notification"
|
||||||
body = fetchedContent.body
|
body = fetchedContent.body ?? "Your daily update is ready"
|
||||||
} else if fallbackBehavior == "show_default" {
|
} else if fallbackBehavior == "show_default" {
|
||||||
title = userNotification["title"] as? String ?? "Daily Notification"
|
title = userNotification["title"] as? String ?? "Daily Notification"
|
||||||
body = userNotification["body"] as? String ?? "Your daily update is ready"
|
body = userNotification["body"] as? String ?? "Your daily update is ready"
|
||||||
|
|||||||
Reference in New Issue
Block a user