File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ + (ICMUserAttributes *)userAttributesForDictionary:(NSDictionary *)attributesDic
2424 attributes.signedUpAt = [self dateValueForKey: @" signedUpAt" inDictionary: attributesDict];
2525 }
2626 if ([self stringValueForKey: @" unsubscribedFromEmails" inDictionary: attributesDict]) {
27- attributes.unsubscribedFromEmails = [self stringValueForKey :@" unsubscribedFromEmails" inDictionary: attributesDict];
27+ attributes.unsubscribedFromEmails = [self boolValueForKey :@" unsubscribedFromEmails" inDictionary: attributesDict];
2828 }
2929 if (attributesDict[@" customAttributes" ]) {
3030 attributes.customAttributes = attributesDict[@" customAttributes" ];
@@ -98,5 +98,16 @@ + (NSDate *)dateValueForKey:(NSString *)key inDictionary:(NSDictionary *)diction
9898 return nil ;
9999}
100100
101+ + (BOOL )boolValueForKey : (NSString *)key inDictionary : (NSDictionary *)dictionary {
102+ id value = dictionary[key];
103+ if ([value isKindOfClass: [NSNumber class ]]) {
104+ return [value boolValue ];
105+ }
106+ if ([value isKindOfClass: [NSString class ]]) {
107+ return [value boolValue ];
108+ }
109+ return NO ;
110+ }
111+
101112
102113@end
You can’t perform that action at this time.
0 commit comments