Skip to content

Commit

Permalink
Release 1.4.3
Browse files Browse the repository at this point in the history
1. Bug fixed for VTrack
  • Loading branch information
Yuhan ZOU committed May 6, 2016
1 parent b7a41f0 commit ab772ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SensorsAnalyticsSDK"
s.version = "1.4.2"
s.version = "1.4.3"
s.summary = "The offical iOS SDK of Sensors Analytics."
s.homepage = "http://www.sensorsdata.cn"
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }
Expand Down
14 changes: 8 additions & 6 deletions SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

#define VERSION @"1.4.2"

#define PROPERTY_LENGTH_LIMITATION 255

@implementation SensorsAnalyticsDebugException

@end
Expand Down Expand Up @@ -762,8 +764,8 @@ - (BOOL)assertPropertyTypes:(NSDictionary *)properties withEventType:(NSString *
}
}
NSUInteger objLength = [((NSString *)object) lengthOfBytesUsingEncoding:NSUnicodeStringEncoding];
if (objLength > 255) {
NSString * errMsg = [NSString stringWithFormat:@"%@ The value in NSString is too long.", self];
if (objLength > PROPERTY_LENGTH_LIMITATION) {
NSString * errMsg = [NSString stringWithFormat:@"%@ The value in NSString is too long: %@", self, (NSString *)object];
if (_debugMode != SensorsAnalyticsDebugOff) {
@throw [SensorsAnalyticsDebugException exceptionWithName:@"InvalidDataException"
reason:errMsg
Expand All @@ -776,11 +778,11 @@ - (BOOL)assertPropertyTypes:(NSDictionary *)properties withEventType:(NSString *
}
}

// NSString 类型最大长度不超过255
if ([properties[k] isKindOfClass:[NSString class]]) {
// NSString 检查长度,但忽略部分属性
if ([properties[k] isKindOfClass:[NSString class]] && ![k isEqualToString:@"$binding_path"] && ![k isEqualToString:@"$lib_detail"]) {
NSUInteger objLength = [((NSString *)properties[k]) lengthOfBytesUsingEncoding:NSUnicodeStringEncoding];
if (objLength > 255) {
NSString * errMsg = [NSString stringWithFormat:@"%@ The value in NSString is too long.", self];
if (objLength > PROPERTY_LENGTH_LIMITATION) {
NSString * errMsg = [NSString stringWithFormat:@"%@ The value in NSString is too long: %@", self, (NSString *)properties[k]];
if (_debugMode != SensorsAnalyticsDebugOff) {
@throw [SensorsAnalyticsDebugException exceptionWithName:@"InvalidDataException"
reason:errMsg
Expand Down

0 comments on commit ab772ed

Please sign in to comment.