Skip to content

Commit ab772ed

Browse files
author
Yuhan ZOU
committed
Release 1.4.3
1. Bug fixed for VTrack
1 parent b7a41f0 commit ab772ed

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SensorsAnalyticsSDK"
3-
s.version = "1.4.2"
3+
s.version = "1.4.3"
44
s.summary = "The offical iOS SDK of Sensors Analytics."
55
s.homepage = "http://www.sensorsdata.cn"
66
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }

SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
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

Comments
 (0)