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 body: String
|
||||
if useFetched {
|
||||
title = fetchedContent.title
|
||||
body = fetchedContent.body
|
||||
title = fetchedContent.title ?? "Daily Notification"
|
||||
body = fetchedContent.body ?? "Your daily update is ready"
|
||||
} else if fallbackBehavior == "show_default" {
|
||||
title = userNotification["title"] as? String ?? "Daily Notification"
|
||||
body = userNotification["body"] as? String ?? "Your daily update is ready"
|
||||
|
||||
Reference in New Issue
Block a user