MoEngageInAppState
@objcMembers
public class MoEngageInAppState : MoEngageModelObject, NSCoding, CodableA class that tracks the state and interaction history of an in-app campaign.
This class maintains important information about how an in-app campaign has been
displayed and interacted with, including display counts, timing information,
and completion status. It helps manage campaign lifecycle and prevents
over-display of campaigns. It conforms to MoEngageModelObject, NSCoding,
and Codable protocols for data persistence and management.
- 
                  
                  Unique identifier for the campaign this state belongs to. DeclarationSwift public let campaignId: String
- 
                  
                  Timestamp when the campaign expires and should no longer be displayed. Made optional until the code is completely converted to swift DeclarationSwift public var expiryTime: Date?
- 
                  
                  Timestamp for deletion based on the last synchronization with the server. This helps manage campaign cleanup and data consistency. DeclarationSwift public var delTimeBasedOnLastSync: Date?
- 
                  
                  Timestamp when the campaign was last shown to the user. Defaults to epoch time (January 1, 1970). DeclarationSwift public var lastShownTime: Date?
- 
                  
                  Total number of times this campaign has been displayed to the user. Used for frequency capping and analytics tracking. DeclarationSwift public var numberOfTimesShown: Int
- 
                  
                  Flag indicating whether the user has completed the primary action associated with this campaign (e.g., clicked a button, completed a form). DeclarationSwift public var primaryActionCompleted: Bool
- 
                  
                  Initializes a new in-app state instance with campaign information. DeclarationSwift @objc public convenience init(with campaignId: String, expiryTime: Date)ParameterscampaignIdUnique identifier for the campaign expiryTimeTimestamp when the campaign expires deleteBasedOnLastSyncTimestamp for deletion based on last sync 
- 
                  
                  Initializes the in-app state from an NSCoder for unarchiving. DeclarationSwift public required init?(coder decoder: NSCoder)ParametersdecoderThe coder to use for unarchiving. Return ValueAn initialized in-app state instance. 
- 
                  
                  Encodes the in-app state using NSCoder for archiving. DeclarationSwift public func encode(with encoder: NSCoder)ParametersencoderThe coder to use for archiving. 
- 
                  
                  Encodes the in-app state to an encoder. Throws Encoding errors if the data cannot be encoded.DeclarationSwift public func encode(to encoder: any Encoder) throwsParametersencoderThe encoder to write data to. 
- 
                  
                  Initializes the in-app state from a decoder. Throws Decoding errors if the data is malformed.DeclarationSwift public required init(from decoder: any Decoder) throwsParametersdecoderThe decoder to read data from. 
- 
                  
                  DeclarationSwift public func updateExpiryAndDeletionTime(expiryTime: Date)
