Skip to content

Commit

Permalink
Handle new attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Jun 1, 2024
1 parent e6f3e36 commit f0c629e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/RemoteMessaging/Matchers/UserAttributeMatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ public struct UserAttributeMatcher: AttributeMatcher {
}

return BooleanMatchingAttribute(value).matches(value: isPrivacyProSubscriber)
case let matchingAttribute as PrivacyProDaysSinceSubscribedMatchingAttribute:
if matchingAttribute.value != MatchingAttributeDefaults.intDefaultValue {
return IntMatchingAttribute(matchingAttribute.value).matches(value: privacyProDaysSinceSubscribed)
} else {
return RangeIntMatchingAttribute(min: matchingAttribute.min, max: matchingAttribute.max).matches(value: privacyProDaysSinceSubscribed)
}
case let matchingAttribute as PrivacyProDaysUntilExpiryMatchingAttribute:
if matchingAttribute.value != MatchingAttributeDefaults.intDefaultValue {
return IntMatchingAttribute(matchingAttribute.value).matches(value: privacyProDaysUntilExpiry)
} else {
return RangeIntMatchingAttribute(min: matchingAttribute.min, max: matchingAttribute.max).matches(value: privacyProDaysUntilExpiry)
}
default:
assertionFailure("Could not find matching attribute")
return nil
Expand Down

0 comments on commit f0c629e

Please sign in to comment.