From 48fefdc59421ea209c2783ab7d2c0ca6843216be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B4=8B=E6=B4=8B?= Date: Thu, 18 May 2023 18:29:23 +0800 Subject: [PATCH] Release 4.5.9 --- SensorsAnalyticsSDK.podspec | 2 +- SensorsAnalyticsSDK/AutoTrack/SAAutoTrackResources.h | 4 ---- .../Core/Builder/EventObject/SABaseEventObject.h | 2 +- .../Core/Builder/EventObject/SAPropertyValidator.m | 7 +++++-- .../Interceptor/EventBuild/SAEventValidateInterceptor.h | 4 ---- .../Core/Interceptor/EventBuild/SAPropertyInterceptor.m | 5 ++++- .../Core/Interceptor/Flush/SAFlushHTTPBodyInterceptor.h | 4 ---- .../Core/Interceptor/Flush/SAFlushJSONInterceptor.h | 4 ---- SensorsAnalyticsSDK/Core/SACoreResources.h | 4 ---- SensorsAnalyticsSDK/Core/SAHTTPSession.h | 4 ---- SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m | 2 +- SensorsAnalyticsSDK/Core/TrackTimer/SATrackTimer.h | 4 ---- SensorsAnalyticsSDK/Core/Tracker/SAEventRecord.h | 4 ---- SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h | 4 ---- SensorsAnalyticsSDK/Core/Utils/SADateFormatter.h | 4 ---- SensorsAnalyticsSDK/Exposure/SAExposureDelegateProxy.m | 2 ++ SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m | 3 --- SensorsAnalyticsSDK/Visualized/SAVisualizedResources.h | 4 ---- 18 files changed, 14 insertions(+), 53 deletions(-) diff --git a/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK.podspec index ece8b82f..c9860a33 100644 --- a/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "4.5.8" + s.version = "4.5.9" s.summary = "The official 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}" } diff --git a/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackResources.h b/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackResources.h index 0d82267f..a9eb7f33 100644 --- a/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackResources.h +++ b/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackResources.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/Builder/EventObject/SABaseEventObject.h b/SensorsAnalyticsSDK/Core/Builder/EventObject/SABaseEventObject.h index 663d9465..6e1c357b 100644 --- a/SensorsAnalyticsSDK/Core/Builder/EventObject/SABaseEventObject.h +++ b/SensorsAnalyticsSDK/Core/Builder/EventObject/SABaseEventObject.h @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *token; /// 事件属性 -@property (nonatomic, strong) NSMutableDictionary *properties; +@property (atomic, strong) NSMutableDictionary *properties; // 自定义属性,暂未开放 //@property (nonatomic, strong) NSDictionary *customProperties; diff --git a/SensorsAnalyticsSDK/Core/Builder/EventObject/SAPropertyValidator.m b/SensorsAnalyticsSDK/Core/Builder/EventObject/SAPropertyValidator.m index 27edd5fa..233eb341 100644 --- a/SensorsAnalyticsSDK/Core/Builder/EventObject/SAPropertyValidator.m +++ b/SensorsAnalyticsSDK/Core/Builder/EventObject/SAPropertyValidator.m @@ -147,10 +147,13 @@ + (NSMutableDictionary *)validProperties:(NSDictionary *)properties validator:(i if (![properties isKindOfClass:[NSDictionary class]] || ![validator conformsToProtocol:@protocol(SAEventPropertyValidatorProtocol)]) { return nil; } + + NSDictionary *newProperties = [NSDictionary dictionaryWithDictionary:properties]; + NSMutableDictionary *result = [NSMutableDictionary dictionary]; - for (id key in properties) { + for (id key in newProperties) { NSError *error = nil; - id value = [validator sensorsdata_validKey:key value:properties[key] error:&error]; + id value = [validator sensorsdata_validKey:key value:newProperties[key] error:&error]; if (error) { SALogError(@"%@",error.localizedDescription); } diff --git a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAEventValidateInterceptor.h b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAEventValidateInterceptor.h index 4406ba8a..8b0772f6 100644 --- a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAEventValidateInterceptor.h +++ b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAEventValidateInterceptor.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import "SAInterceptor.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m index e22fb52a..c631dea4 100644 --- a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m +++ b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m @@ -79,7 +79,10 @@ - (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)co [properties removeObjectForKey:kSADeviceIDPropertyPluginAnonymizationID]; } - [object.properties addEntriesFromDictionary:[properties copy]]; + // 避免 object.properties 调用 addEntriesFromDictionary 时同时获取 object.properties + NSMutableDictionary *objectProperties = [NSMutableDictionary dictionaryWithDictionary:object.properties]; + [objectProperties addEntriesFromDictionary:[properties copy]]; + object.properties = objectProperties; // 从公共属性中更新 lib 节点中的 $app_version 值 NSDictionary *superProperties = [SAPropertyPluginManager.sharedInstance currentPropertiesForPluginClasses:@[SASuperPropertyPlugin.class]]; diff --git a/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushHTTPBodyInterceptor.h b/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushHTTPBodyInterceptor.h index d79c0f3c..1390b6d1 100644 --- a/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushHTTPBodyInterceptor.h +++ b/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushHTTPBodyInterceptor.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import "SAInterceptor.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushJSONInterceptor.h b/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushJSONInterceptor.h index 3d128452..b25f194d 100644 --- a/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushJSONInterceptor.h +++ b/SensorsAnalyticsSDK/Core/Interceptor/Flush/SAFlushJSONInterceptor.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import "SAInterceptor.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/SACoreResources.h b/SensorsAnalyticsSDK/Core/SACoreResources.h index 97d69c8c..5e8b0c31 100644 --- a/SensorsAnalyticsSDK/Core/SACoreResources.h +++ b/SensorsAnalyticsSDK/Core/SACoreResources.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/SAHTTPSession.h b/SensorsAnalyticsSDK/Core/SAHTTPSession.h index 82979df1..f83947b0 100644 --- a/SensorsAnalyticsSDK/Core/SAHTTPSession.h +++ b/SensorsAnalyticsSDK/Core/SAHTTPSession.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import #import "SASecurityPolicy.h" diff --git a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m index a3d1da64..60ec6de2 100755 --- a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m +++ b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m @@ -64,7 +64,7 @@ #import "SALimitKeyManager.h" #import "NSDictionary+SACopyProperties.h" -#define VERSION @"4.5.8" +#define VERSION @"4.5.9" void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag; diff --git a/SensorsAnalyticsSDK/Core/TrackTimer/SATrackTimer.h b/SensorsAnalyticsSDK/Core/TrackTimer/SATrackTimer.h index b3a1e62a..f5b248dc 100644 --- a/SensorsAnalyticsSDK/Core/TrackTimer/SATrackTimer.h +++ b/SensorsAnalyticsSDK/Core/TrackTimer/SATrackTimer.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import #import "SAConstants.h" diff --git a/SensorsAnalyticsSDK/Core/Tracker/SAEventRecord.h b/SensorsAnalyticsSDK/Core/Tracker/SAEventRecord.h index 1dacb45c..56176070 100644 --- a/SensorsAnalyticsSDK/Core/Tracker/SAEventRecord.h +++ b/SensorsAnalyticsSDK/Core/Tracker/SAEventRecord.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h b/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h index 874c6938..db44ae43 100644 --- a/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h +++ b/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import #import "SAEventRecord.h" diff --git a/SensorsAnalyticsSDK/Core/Utils/SADateFormatter.h b/SensorsAnalyticsSDK/Core/Utils/SADateFormatter.h index 4cd6e132..a457735a 100644 --- a/SensorsAnalyticsSDK/Core/Utils/SADateFormatter.h +++ b/SensorsAnalyticsSDK/Core/Utils/SADateFormatter.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import NS_ASSUME_NONNULL_BEGIN diff --git a/SensorsAnalyticsSDK/Exposure/SAExposureDelegateProxy.m b/SensorsAnalyticsSDK/Exposure/SAExposureDelegateProxy.m index ee6715fc..5b03a024 100644 --- a/SensorsAnalyticsSDK/Exposure/SAExposureDelegateProxy.m +++ b/SensorsAnalyticsSDK/Exposure/SAExposureDelegateProxy.m @@ -43,6 +43,7 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)ce exposureViewObject.state = (exposureViewObject.state == SAExposureViewStateExposing ? SAExposureViewStateExposing : SAExposureViewStateVisible); exposureViewObject.scrollView = tableView; exposureViewObject.indexPath = indexPath; + [exposureViewObject exposureConditionCheck]; //invoke original SEL methodSelector = @selector(tableView:willDisplayCell:forRowAtIndexPath:); @@ -85,6 +86,7 @@ - (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICol exposureViewObject.state = (exposureViewObject.state == SAExposureViewStateExposing ? SAExposureViewStateExposing : SAExposureViewStateVisible); exposureViewObject.scrollView = collectionView; exposureViewObject.indexPath = indexPath; + [exposureViewObject exposureConditionCheck]; //invoke original SEL methodSelector = @selector(collectionView:willDisplayCell:forItemAtIndexPath:); diff --git a/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m b/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m index 2ad9681c..6ef29334 100644 --- a/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m +++ b/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m @@ -176,9 +176,6 @@ - (void)exposureConditionCheck { if (!self.view) { return; } - if (([self.view isKindOfClass:[UITableViewCell class]] || [self.view isKindOfClass:[UICollectionViewCell class]]) && self.state == SAExposureViewStateInvisible) { - return; - } if (!self.exposureData.config.repeated && self.lastExposure > 0) { return; diff --git a/SensorsAnalyticsSDK/Visualized/SAVisualizedResources.h b/SensorsAnalyticsSDK/Visualized/SAVisualizedResources.h index 78cd8ddf..d915b9ce 100644 --- a/SensorsAnalyticsSDK/Visualized/SAVisualizedResources.h +++ b/SensorsAnalyticsSDK/Visualized/SAVisualizedResources.h @@ -18,10 +18,6 @@ // limitations under the License. // -#if ! __has_feature(objc_arc) -#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. -#endif - #import NS_ASSUME_NONNULL_BEGIN