Skip to content

Commit 909b924

Browse files
Added method docs and comment.
1 parent 4c1e69a commit 909b924

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CleverTapSDK/CTUtils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
+ (double)haversineDistance:(CLLocationCoordinate2D)coordinateA coordinateB:(CLLocationCoordinate2D)coordinateB;
1515
+ (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string;
1616
+ (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string withLocale:(NSLocale * _Nullable)locale;
17+
18+
/**
19+
* Get the CT normalized version of an event or a property name.
20+
*/
1721
+ (NSString * _Nullable)getNormalizedName:(NSString * _Nullable)name;
22+
23+
/**
24+
* Check if two event/property names are equal with applied CT normalization
25+
*/
1826
+ (BOOL)areEqualNormalizedName:(NSString * _Nullable)firstName andName:(NSString * _Nullable)secondName;
1927

2028
@end

CleverTapSDK/CTUtils.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ + (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string withLocale
144144

145145
+ (NSString * _Nullable)getNormalizedName:(NSString * _Nullable)name {
146146
if (name) {
147+
// Lowercase with English locale for consistent behavior with the backend
148+
// and across different device locales.
147149
NSString *normalizedName = [name stringByReplacingOccurrencesOfString:@" " withString:@""];
148150
NSLocale *englishLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
149151
normalizedName = [normalizedName lowercaseStringWithLocale:englishLocale];

0 commit comments

Comments
 (0)