From 448d07d03ffb1b034dda93cda973dcab222d1859 Mon Sep 17 00:00:00 2001 From: Sumeru Chatterjee Date: Tue, 7 Jan 2025 14:34:33 +0100 Subject: [PATCH] [MOB-9233] Updated code according to the new discussion --- .../Internal/in-app/InAppPersistence.swift | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/swift-sdk/Internal/in-app/InAppPersistence.swift b/swift-sdk/Internal/in-app/InAppPersistence.swift index fa93daf7..87b764b2 100644 --- a/swift-sdk/Internal/in-app/InAppPersistence.swift +++ b/swift-sdk/Internal/in-app/InAppPersistence.swift @@ -282,17 +282,17 @@ extension IterableInAppMessage: Codable { let priorityLevel = (try? container.decode(Double.self, forKey: .priorityLevel)) ?? Const.PriorityLevel.unassigned self.init(messageId: messageId, - campaignId: campaignId, - trigger: trigger, - createdAt: createdAt, - expiresAt: expiresAt, - content: content, - saveToInbox: saveToInbox && jsonOnly != 1, - inboxMetadata: inboxMetadata, - customPayload: customPayload, - read: read, - priorityLevel: priorityLevel, - jsonOnly: jsonOnly == 1) + campaignId: campaignId, + trigger: trigger, + createdAt: createdAt, + expiresAt: expiresAt, + content: content, + saveToInbox: saveToInbox && jsonOnly != 1, + inboxMetadata: inboxMetadata, + customPayload: customPayload, + read: read, + priorityLevel: priorityLevel, + jsonOnly: jsonOnly == 1) self.didProcessTrigger = didProcessTrigger self.consumed = consumed @@ -364,6 +364,7 @@ extension IterableInAppMessage: Codable { guard let contentContainer = try? container.nestedContainer(keyedBy: ContentCodingKeys.self, forKey: .content) else { ITBError() + return createDefaultContent() }