diff --git a/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK.podspec index 8533b40d..4b112b21 100644 --- a/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "4.8.1" + s.version = "4.8.2" 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}" } @@ -12,6 +12,9 @@ Pod::Spec.new do |s| s.default_subspec = 'Core' s.frameworks = 'Foundation', 'SystemConfiguration' + # 限制 CocoaPods 版本 + s.cocoapods_version = '>= 1.12.0' + s.libraries = 'icucore', 'z' s.subspec '__Store' do |store| diff --git a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m index d3efcf71..447363f4 100755 --- a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m +++ b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m @@ -69,7 +69,7 @@ #import #endif -#define VERSION @"4.8.1" +#define VERSION @"4.8.2" void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag; diff --git a/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h b/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h index b81f6460..db44ae43 100644 --- a/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h +++ b/SensorsAnalyticsSDK/Core/Tracker/SAEventStore.h @@ -43,6 +43,8 @@ extern NSString * const kSADatabaseDefaultFileName; * * @return 初始化的结果 */ +- (instancetype)initWithFilePath:(NSString *)filePath; + + (instancetype)eventStoreWithFilePath:(NSString *)filePath; /// fetch first records with a certain size diff --git a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.h b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.h index e1822fa1..0c9d6525 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.h +++ b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.h @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN /// 从请求远程配置的返回结果中获取加密相关内容 /// @param config 请求远程配置的返回结果 /// @return 加密相关内容 -- (NSDictionary *)extractEncryptConfig:(NSDictionary *)config; +//- (NSDictionary *)extractEncryptConfig:(NSDictionary *)config; /// 触发 $AppRemoteConfigChanged 事件 /// @param remoteConfig 事件中的属性 diff --git a/SensorsAnalyticsSDK/Store/SABaseStoreManager.m b/SensorsAnalyticsSDK/Store/SABaseStoreManager.m index 7df40996..b7f065fe 100644 --- a/SensorsAnalyticsSDK/Store/SABaseStoreManager.m +++ b/SensorsAnalyticsSDK/Store/SABaseStoreManager.m @@ -106,7 +106,7 @@ - (void)registerStorePlugin:(id)plugin { [self.plugins enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([plugin.type isEqualToString:obj.type]) { [self.plugins removeObjectAtIndex:idx]; - } else { + } else if ([plugin respondsToSelector:@selector(upgradeWithOldPlugin:)]){ [plugin upgradeWithOldPlugin:obj]; } }]; diff --git a/SensorsAnalyticsSDK/Store/SAStorePlugin.h b/SensorsAnalyticsSDK/Store/SAStorePlugin.h index c71aa3ac..c9bec56c 100644 --- a/SensorsAnalyticsSDK/Store/SAStorePlugin.h +++ b/SensorsAnalyticsSDK/Store/SAStorePlugin.h @@ -26,6 +26,11 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)type; +- (nullable id)objectForKey:(NSString *)key; +- (void)setObject:(nullable id)value forKey:(NSString *)key; +- (void)removeObjectForKey:(NSString *)key; + +@optional /// 可以用于将一些重要特殊的 key 进行迁移操作 /// /// SDK 会在注册新插件时,调用该方法 @@ -34,10 +39,6 @@ NS_ASSUME_NONNULL_BEGIN /// @param oldPlugin 旧插件 - (void)upgradeWithOldPlugin:(id)oldPlugin; -- (nullable id)objectForKey:(NSString *)key; -- (void)setObject:(nullable id)value forKey:(NSString *)key; -- (void)removeObjectForKey:(NSString *)key; - /// 注册自定义存储插件,是否忽略历史旧数据 /// /// 如果未实现,则默认不忽略,即迁移历史数据迁移