2828
2929#define VERSION @" 1.4.2"
3030
31+ #define PROPERTY_LENGTH_LIMITATION 255
32+
3133@implementation SensorsAnalyticsDebugException
3234
3335@end
@@ -762,8 +764,8 @@ - (BOOL)assertPropertyTypes:(NSDictionary *)properties withEventType:(NSString *
762764 }
763765 }
764766 NSUInteger objLength = [((NSString *)object) lengthOfBytesUsingEncoding: NSUnicodeStringEncoding];
765- if (objLength > 255 ) {
766- NSString * errMsg = [NSString stringWithFormat: @" %@ The value in NSString is too long. " , self ];
767+ if (objLength > PROPERTY_LENGTH_LIMITATION ) {
768+ NSString * errMsg = [NSString stringWithFormat: @" %@ The value in NSString is too long: %@ " , self , ( NSString *)object ];
767769 if (_debugMode != SensorsAnalyticsDebugOff) {
768770 @throw [SensorsAnalyticsDebugException exceptionWithName: @" InvalidDataException"
769771 reason: errMsg
@@ -776,11 +778,11 @@ - (BOOL)assertPropertyTypes:(NSDictionary *)properties withEventType:(NSString *
776778 }
777779 }
778780
779- // NSString 类型最大长度不超过255
780- if ([properties[k] isKindOfClass: [NSString class ]]) {
781+ // NSString 检查长度,但忽略部分属性
782+ if ([properties[k] isKindOfClass: [NSString class ]] && ![k isEqualToString: @" $binding_path " ] && ![k isEqualToString: @" $lib_detail " ] ) {
781783 NSUInteger objLength = [((NSString *)properties[k]) lengthOfBytesUsingEncoding: NSUnicodeStringEncoding];
782- if (objLength > 255 ) {
783- NSString * errMsg = [NSString stringWithFormat: @" %@ The value in NSString is too long. " , self ];
784+ if (objLength > PROPERTY_LENGTH_LIMITATION ) {
785+ NSString * errMsg = [NSString stringWithFormat: @" %@ The value in NSString is too long: %@ " , self , ( NSString *)properties[k] ];
784786 if (_debugMode != SensorsAnalyticsDebugOff) {
785787 @throw [SensorsAnalyticsDebugException exceptionWithName: @" InvalidDataException"
786788 reason: errMsg
0 commit comments