Skip to content

Commit

Permalink
Added method docs and comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-clevertap committed Nov 14, 2024
1 parent 4c1e69a commit 909b924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CleverTapSDK/CTUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
+ (double)haversineDistance:(CLLocationCoordinate2D)coordinateA coordinateB:(CLLocationCoordinate2D)coordinateB;
+ (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string;
+ (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string withLocale:(NSLocale * _Nullable)locale;

/**
* Get the CT normalized version of an event or a property name.
*/
+ (NSString * _Nullable)getNormalizedName:(NSString * _Nullable)name;

/**
* Check if two event/property names are equal with applied CT normalization
*/
+ (BOOL)areEqualNormalizedName:(NSString * _Nullable)firstName andName:(NSString * _Nullable)secondName;

@end
2 changes: 2 additions & 0 deletions CleverTapSDK/CTUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ + (NSNumber * _Nullable)numberFromString:(NSString * _Nullable)string withLocale

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

0 comments on commit 909b924

Please sign in to comment.