Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Release Date

## Release Version

- [minor] Added support for tracking epoch time in User Attribute

# 04-05-2026

## 6.9.0
Expand Down
2 changes: 2 additions & 0 deletions Sources/MoEngagePluginBase/MoEngagePluginBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ import MoEngageInApps
case MoEngagePluginConstants.UserAttribute.timestamp:
if let timeStamp = userAttribute.value as? String {
MoEngageSDKAnalytics.sharedInstance.setUserAttributeISODate(timeStamp, withAttributeName: userAttribute.name, forAppID: identifier)
} else if let timeStamp = userAttribute.value as? Double {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning — Silent value type mismatch: If userAttribute.value is neither String (line 127) nor Double (line 128), the timestamp attribute is silently ignored with no logging or error. This happens when a plugin sends an Int, Float, NSNumber, or any other type for a timestamp attribute.

Impact: Plugin developers won't know their timestamp wasn't tracked. The general attribute handler (lines 116-123) has the same issue, so this is a pre-existing pattern in this codebase.

Suggestion: Consider adding an else clause after line 129:

} else {
    MoEngageLogger.logDefault(logLevel: .error, message: "Invalid timestamp value type for attribute '\(userAttribute.name)': expected String (ISO) or Double (epoch), got \(type(of: userAttribute.value))")
}

This helps plugin SDK authors debug integration issues. Not a blocker — log the warning in a follow-up ticket if desired.

MoEngageSDKAnalytics.sharedInstance.setUserAttributeEpochTime(timeStamp, withAttributeName: userAttribute.name, forAppID: identifier)
}

case MoEngagePluginConstants.UserAttribute.location:
Expand Down
Loading