diff --git a/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK.podspec index 6a2f917b..3bc577b1 100644 --- a/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "4.6.0" + s.version = "4.6.1" 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.xcodeproj/project.pbxproj b/SensorsAnalyticsSDK.xcodeproj/project.pbxproj index ba17aafd..8e80a0a2 100644 --- a/SensorsAnalyticsSDK.xcodeproj/project.pbxproj +++ b/SensorsAnalyticsSDK.xcodeproj/project.pbxproj @@ -523,6 +523,7 @@ F2CD8A7A28A2410A00A186B8 /* SAExposureConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = F2CD8A7828A2410A00A186B8 /* SAExposureConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; F2CD8A7B28A2410A00A186B8 /* SAExposureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CD8A7928A2410A00A186B8 /* SAExposureConfig.m */; }; F2CFD14726EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = F2CFD14526EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F2D769D42B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */; }; F2E36483287682E6008D9151 /* SADeviceWhiteList.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E36481287682E6008D9151 /* SADeviceWhiteList.h */; }; F2E36484287682E6008D9151 /* SADeviceWhiteList.m in Sources */ = {isa = PBXBuildFile; fileRef = F2E36482287682E6008D9151 /* SADeviceWhiteList.m */; }; F2E364872876EE94008D9151 /* SASlinkCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E364852876EE94008D9151 /* SASlinkCreator.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1121,6 +1122,7 @@ F2CD8A7828A2410A00A186B8 /* SAExposureConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SAExposureConfig.h; sourceTree = ""; }; F2CD8A7928A2410A00A186B8 /* SAExposureConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SAExposureConfig.m; sourceTree = ""; }; F2CFD14526EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SAConfigOptions+RemoteConfig.h"; sourceTree = ""; }; + F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; F2E36481287682E6008D9151 /* SADeviceWhiteList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SADeviceWhiteList.h; sourceTree = ""; }; F2E36482287682E6008D9151 /* SADeviceWhiteList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SADeviceWhiteList.m; sourceTree = ""; }; F2E364852876EE94008D9151 /* SASlinkCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SASlinkCreator.h; sourceTree = ""; }; @@ -1593,6 +1595,7 @@ 881A40F4253D7B4F00854F69 /* SensorsAnalyticsSDK+Private.h */, 45A565BB263C17E400C9C41B /* SAAppLifecycle.h */, 45A565BA263C17E400C9C41B /* SAAppLifecycle.m */, + F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */, ); path = Core; sourceTree = ""; @@ -2689,6 +2692,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + F2D769D42B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SensorsAnalyticsSDK/AppPush/SAAppPushManager.m b/SensorsAnalyticsSDK/AppPush/SAAppPushManager.m index e389101b..4a8bb519 100644 --- a/SensorsAnalyticsSDK/AppPush/SAAppPushManager.m +++ b/SensorsAnalyticsSDK/AppPush/SAAppPushManager.m @@ -53,13 +53,13 @@ - (void)setEnable:(BOOL)enable { } } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("AppPush not supported for iOS extensions.") { _configOptions = configOptions; [UIApplication sharedApplication].sensorsdata_launchOptions = configOptions.launchOptions; self.enable = configOptions.enableTrackPush; } -- (void)proxyNotifications { +- (void)proxyNotifications NS_EXTENSION_UNAVAILABLE("AppPush not supported for iOS extensions.") { //处理未实现代理方法也能采集事件的逻辑 [SAMethodHelper swizzleRespondsToSelector]; diff --git a/SensorsAnalyticsSDK/AppPush/SAConfigOptions+AppPush.h b/SensorsAnalyticsSDK/AppPush/SAConfigOptions+AppPush.h index b1bf978c..3e7ab334 100644 --- a/SensorsAnalyticsSDK/AppPush/SAConfigOptions+AppPush.h +++ b/SensorsAnalyticsSDK/AppPush/SAConfigOptions+AppPush.h @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (AppPush) ///开启自动采集通知 -@property (nonatomic, assign) BOOL enableTrackPush API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableTrackPush API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("AppPush not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackManager.m b/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackManager.m index 647ff5aa..66ac63fa 100644 --- a/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackManager.m +++ b/SensorsAnalyticsSDK/AutoTrack/SAAutoTrackManager.m @@ -199,7 +199,7 @@ - (void)remoteConfigModelChanged:(NSNotification *)sender { #pragma mark - Public -- (BOOL)isAutoTrackEnabled { +- (BOOL)isAutoTrackEnabled NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions.") { if (self.isDisableSDK) { SALogDebug(@"SDK is disabled"); return NO; @@ -219,7 +219,7 @@ - (BOOL)isAutoTrackEnabled { } } -- (BOOL)isAutoTrackEventTypeIgnored:(SensorsAnalyticsAutoTrackEventType)eventType { +- (BOOL)isAutoTrackEventTypeIgnored:(SensorsAnalyticsAutoTrackEventType)eventType NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions.") { if (self.isDisableSDK) { SALogDebug(@"SDK is disabled"); return YES; @@ -316,7 +316,7 @@ - (void)enableAppClickAutoTrack { } } -- (void)enableAppPageLeave { +- (void)enableAppPageLeave NS_EXTENSION_UNAVAILABLE("TrackPageLeave not supported for iOS extensions.") { if (!self.configOptions.enableTrackPageLeave) { return; } @@ -324,7 +324,7 @@ - (void)enableAppPageLeave { [UIViewController sa_swizzleMethod:@selector(viewDidDisappear:) withMethod:@selector(sensorsdata_pageLeave_viewDidDisappear:) error:NULL]; } -- (void)registerPlugins { +- (void)registerPlugins NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions.") { BOOL enableAppClick = self.configOptions.autoTrackEventType & SensorsAnalyticsEventTypeAppClick; if (!enableAppClick) { return; diff --git a/SensorsAnalyticsSDK/AutoTrack/SensorsAnalyticsSDK+SAAutoTrack.h b/SensorsAnalyticsSDK/AutoTrack/SensorsAnalyticsSDK+SAAutoTrack.h index 1450b33f..bc7f033b 100644 --- a/SensorsAnalyticsSDK/AutoTrack/SensorsAnalyticsSDK+SAAutoTrack.h +++ b/SensorsAnalyticsSDK/AutoTrack/SensorsAnalyticsSDK+SAAutoTrack.h @@ -77,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param aClass View 对应的 Class */ -- (void)ignoreViewType:(Class)aClass NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions."); +- (void)ignoreViewType:(Class)aClass; /** * @abstract @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param controllers controller ‘字符串’数组 */ -- (void)ignoreAutoTrackViewControllers:(NSArray *)controllers NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions."); +- (void)ignoreAutoTrackViewControllers:(NSArray *)controllers; /** * @abstract @@ -163,7 +163,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (AutoTrack) ///开启自动采集页面浏览时长 -@property (nonatomic, assign) BOOL enableTrackPageLeave API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableTrackPageLeave API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("TrackPageLeave not supported for iOS extensions."); /// 是否开启子页面的页面浏览时长 @@ -190,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN * https://sensorsdata.cn/manual/ios_sdk.html * 该功能默认关闭 */ -@property (nonatomic) SensorsAnalyticsAutoTrackEventType autoTrackEventType API_UNAVAILABLE(macos); +@property (nonatomic) SensorsAnalyticsAutoTrackEventType autoTrackEventType API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("AutoTrack not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/ChannelMatch/SAChannelMatchManager.m b/SensorsAnalyticsSDK/ChannelMatch/SAChannelMatchManager.m index 97192a8c..fd6332c4 100644 --- a/SensorsAnalyticsSDK/ChannelMatch/SAChannelMatchManager.m +++ b/SensorsAnalyticsSDK/ChannelMatch/SAChannelMatchManager.m @@ -219,7 +219,7 @@ - (NSDictionary *)profileProperties:(NSDictionary *)properties { } #pragma mark - 附加渠道信息 -- (void)trackChannelWithEventObject:(SABaseEventObject *)obj properties:(nullable NSDictionary *)propertyDict { +- (void)trackChannelWithEventObject:(SABaseEventObject *)obj properties:(nullable NSDictionary *)propertyDict NS_EXTENSION_UNAVAILABLE("DeepLink not supported for iOS extensions.") { if (self.configOptions.enableAutoAddChannelCallbackEvent) { return [SensorsAnalyticsSDK.sharedInstance trackEventObject:obj properties:propertyDict]; } @@ -255,7 +255,7 @@ - (void)archiveTrackChannelEventNames { [[SAStoreManager sharedInstance] setObject:copyEventNames forKey:kSAEventPropertyChannelDeviceInfo]; } -- (NSDictionary *)channelInfoWithEvent:(NSString *)event { +- (NSDictionary *)channelInfoWithEvent:(NSString *)event NS_EXTENSION_UNAVAILABLE("DeepLink not supported for iOS extensions.") { if (self.configOptions.enableAutoAddChannelCallbackEvent) { NSMutableDictionary *channelInfo = [NSMutableDictionary dictionaryWithDictionary:[self channelPropertiesWithEvent:event]]; channelInfo[kSAEventPropertyChannelDeviceInfo] = @"1"; diff --git a/SensorsAnalyticsSDK/ChannelMatch/SensorsAnalyticsSDK+SAChannelMatch.h b/SensorsAnalyticsSDK/ChannelMatch/SensorsAnalyticsSDK+SAChannelMatch.h index 5c93e9e9..d3b8c511 100644 --- a/SensorsAnalyticsSDK/ChannelMatch/SensorsAnalyticsSDK+SAChannelMatch.h +++ b/SensorsAnalyticsSDK/ChannelMatch/SensorsAnalyticsSDK+SAChannelMatch.h @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN @param event event 的名称 */ -- (void)trackChannelEvent:(NSString *)event NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackChannelEvent:(NSString *)event; /** 调用 track 接口并附加渠道信息 @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @param event event 的名称 @param propertyDict event 的属性 */ -- (void)trackChannelEvent:(NSString *)event properties:(nullable NSDictionary *)propertyDict NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackChannelEvent:(NSString *)event properties:(nullable NSDictionary *)propertyDict; /** * @abstract @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN * @discussion * 注意:如果之前使用 - trackInstallation: 触发的激活事件,需要继续保持原来的调用,无需改成 - trackAppInstall: ,否则会导致激活事件数据分离。 */ -- (void)trackAppInstall NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackAppInstall; /** * @abstract @@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param properties 激活事件的属性 */ -- (void)trackAppInstallWithProperties:(nullable NSDictionary *)properties NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackAppInstallWithProperties:(nullable NSDictionary *)properties; /** * @abstract @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN * @param properties 激活事件的属性 * @param disableCallback 是否关闭这次渠道匹配的回调请求 */ -- (void)trackAppInstallWithProperties:(nullable NSDictionary *)properties disableCallback:(BOOL)disableCallback NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackAppInstallWithProperties:(nullable NSDictionary *)properties disableCallback:(BOOL)disableCallback; /** * @abstract @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param event event 的名称 */ -- (void)trackInstallation:(NSString *)event NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackInstallation:(NSString *)event; /** * @abstract @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN * @param event event 的名称 * @param propertyDict event 的属性 */ -- (void)trackInstallation:(NSString *)event withProperties:(nullable NSDictionary *)propertyDict NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackInstallation:(NSString *)event withProperties:(nullable NSDictionary *)propertyDict; /** * @abstract @@ -116,14 +116,14 @@ NS_ASSUME_NONNULL_BEGIN * @param propertyDict event 的属性 * @param disableCallback 是否关闭这次渠道匹配的回调请求 */ -- (void)trackInstallation:(NSString *)event withProperties:(nullable NSDictionary *)propertyDict disableCallback:(BOOL)disableCallback NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); +- (void)trackInstallation:(NSString *)event withProperties:(nullable NSDictionary *)propertyDict disableCallback:(BOOL)disableCallback; @end @interface SAConfigOptions (ChannelMatch) /// 是否在手动埋点事件中自动添加渠道匹配信息 -@property (nonatomic, assign) BOOL enableAutoAddChannelCallbackEvent API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableAutoAddChannelCallbackEvent API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("ChannelMatch not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Core/PrivacyInfo.xcprivacy b/SensorsAnalyticsSDK/Core/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..0f47dbb0 --- /dev/null +++ b/SensorsAnalyticsSDK/Core/PrivacyInfo.xcprivacy @@ -0,0 +1,80 @@ + + + + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCoarseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeCrashData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeOtherDiagnosticData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyTrackingDomains + + NSPrivacyTracking + + + diff --git a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m index c1bea028..52ade5ee 100755 --- a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m +++ b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m @@ -68,7 +68,7 @@ #import #endif -#define VERSION @"4.6.0" +#define VERSION @"4.6.1" void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag; diff --git a/SensorsAnalyticsSDK/Deeplink/SADeeplinkManager.m b/SensorsAnalyticsSDK/Deeplink/SADeeplinkManager.m index 530d3a44..f33f719b 100644 --- a/SensorsAnalyticsSDK/Deeplink/SADeeplinkManager.m +++ b/SensorsAnalyticsSDK/Deeplink/SADeeplinkManager.m @@ -127,7 +127,7 @@ - (void)disableDeferredDeepLink { [[SAStoreManager sharedInstance] setInteger:SADeferredDeepLinkStatusDisable forKey:kSADeferredDeepLinkStatus]; } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("DeepLink not supported for iOS extensions.") { if ([SAApplication isAppExtension]) { configOptions.enableDeepLink = NO; } @@ -201,7 +201,7 @@ - (void)unarchiveLatestChannels:(BOOL)enableSave { } /// 开启本地保存 DeepLinkInfo 开关时,每次 DeepLink 唤起解析后都需要更新本地文件中数据 -- (void)archiveLatestChannels:(NSDictionary *)dictionary { +- (void)archiveLatestChannels:(NSDictionary *)dictionary NS_EXTENSION_UNAVAILABLE("DeepLink not supported for iOS extensions.") { if (!_configOptions.enableSaveDeepLinkInfo) { return; } diff --git a/SensorsAnalyticsSDK/Deeplink/SensorsAnalyticsSDK+Deeplink.h b/SensorsAnalyticsSDK/Deeplink/SensorsAnalyticsSDK+Deeplink.h index eae5f86d..ea5389c7 100644 --- a/SensorsAnalyticsSDK/Deeplink/SensorsAnalyticsSDK+Deeplink.h +++ b/SensorsAnalyticsSDK/Deeplink/SensorsAnalyticsSDK+Deeplink.h @@ -82,7 +82,7 @@ DeepLink 回调函数 @interface SAConfigOptions (DeepLink) /// DeepLink 中解析出来的参数是否需要保存到本地 -@property (nonatomic, assign) BOOL enableSaveDeepLinkInfo API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableSaveDeepLinkInfo API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("DeepLink not supported for iOS extensions."); /// DeepLink 中用户自定义来源渠道属性 key 值,可传多个。 @property (nonatomic, copy) NSArray *sourceChannels API_UNAVAILABLE(macos); diff --git a/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.h b/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.h index a5e179d4..a9a438da 100644 --- a/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.h +++ b/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.h @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (DeviceOrientation) -@property (nonatomic, assign) BOOL enableDeviceOrientation; +@property (nonatomic, assign) BOOL enableDeviceOrientation NS_EXTENSION_UNAVAILABLE("DeviceOrientation not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.m b/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.m index cb9abbb6..d2f6d4c1 100644 --- a/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.m +++ b/SensorsAnalyticsSDK/DeviceOrientation/SADeviceOrientationManager.m @@ -75,7 +75,7 @@ - (void)setEnable:(BOOL)enable { } } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("DeviceOrientation not supported for iOS extensions.") { _configOptions = configOptions; self.enable = configOptions.enableDeviceOrientation; } diff --git a/SensorsAnalyticsSDK/DeviceOrientation/SensorsAnalyticsSDK+DeviceOrientation.h b/SensorsAnalyticsSDK/DeviceOrientation/SensorsAnalyticsSDK+DeviceOrientation.h index e060e3ef..82aa5b6e 100644 --- a/SensorsAnalyticsSDK/DeviceOrientation/SensorsAnalyticsSDK+DeviceOrientation.h +++ b/SensorsAnalyticsSDK/DeviceOrientation/SensorsAnalyticsSDK+DeviceOrientation.h @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param enable YES/NO */ -- (void)enableTrackScreenOrientation:(BOOL)enable API_UNAVAILABLE(macos); +- (void)enableTrackScreenOrientation:(BOOL)enable API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("DeviceOrientation not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Encrypt/SAConfigOptions+Encrypt.h b/SensorsAnalyticsSDK/Encrypt/SAConfigOptions+Encrypt.h index 310bac70..a8b668be 100644 --- a/SensorsAnalyticsSDK/Encrypt/SAConfigOptions+Encrypt.h +++ b/SensorsAnalyticsSDK/Encrypt/SAConfigOptions+Encrypt.h @@ -26,10 +26,10 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (Encrypt) /// 是否开启埋点数据入库加密 -@property (nonatomic, assign) BOOL enableEncrypt API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableEncrypt API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions."); /// 是否开启埋点数据上报传输加密 -@property (nonatomic, assign) BOOL enableTransportEncrypt API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableTransportEncrypt API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions."); /// 注册埋点加密插件 - (void)registerEncryptor:(id)encryptor API_UNAVAILABLE(macos); diff --git a/SensorsAnalyticsSDK/Encrypt/SAEncryptInterceptor.m b/SensorsAnalyticsSDK/Encrypt/SAEncryptInterceptor.m index 7c13e246..b162dde3 100644 --- a/SensorsAnalyticsSDK/Encrypt/SAEncryptInterceptor.m +++ b/SensorsAnalyticsSDK/Encrypt/SAEncryptInterceptor.m @@ -33,7 +33,7 @@ @implementation SAEncryptInterceptor -- (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)completion { +- (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)completion NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { NSParameterAssert(input.configOptions); NSParameterAssert(input.record || input.records); @@ -67,7 +67,7 @@ - (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)co /// 即使未开启加密,也需要进行筛选,可能因为后期修改加密开关,导致本地同时存在明文和密文数据 /// /// @param records 数据 -- (NSArray *)encryptEventRecords:(NSArray *)records { +- (NSArray *)encryptEventRecords:(NSArray *)records NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { NSMutableArray *encryptRecords = [NSMutableArray arrayWithCapacity:records.count]; for (SAEventRecord *record in records) { if (record.isEncrypted) { diff --git a/SensorsAnalyticsSDK/Encrypt/SAEncryptManager.m b/SensorsAnalyticsSDK/Encrypt/SAEncryptManager.m index 3d8f4ecc..97b1ca0f 100644 --- a/SensorsAnalyticsSDK/Encrypt/SAEncryptManager.m +++ b/SensorsAnalyticsSDK/Encrypt/SAEncryptManager.m @@ -106,7 +106,7 @@ - (void)setEnable:(BOOL)enable { } } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { //register event encryptor [configOptions registerEventEncryptor:[[SAAESEventEncryptor alloc] init]]; _configOptions = configOptions; @@ -464,7 +464,7 @@ - (void)loadLocalRemoteConfig { [self enableFlushEncryptWithRemoteConfig:config]; } -- (void)enableFlushEncryptWithRemoteConfig:(NSDictionary *)config { +- (void)enableFlushEncryptWithRemoteConfig:(NSDictionary *)config NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { if (![config isKindOfClass:[NSDictionary class]]) { return; } diff --git a/SensorsAnalyticsSDK/Exception/SAConfigOptions+Exception.h b/SensorsAnalyticsSDK/Exception/SAConfigOptions+Exception.h index fad1337e..540933b8 100644 --- a/SensorsAnalyticsSDK/Exception/SAConfigOptions+Exception.h +++ b/SensorsAnalyticsSDK/Exception/SAConfigOptions+Exception.h @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (Exception) /// 是否自动收集 App Crash 日志,该功能默认是关闭的 -@property (nonatomic, assign) BOOL enableTrackAppCrash API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableTrackAppCrash API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("Exception not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Exception/SAExceptionManager.m b/SensorsAnalyticsSDK/Exception/SAExceptionManager.m index 411cd77a..d207b73a 100644 --- a/SensorsAnalyticsSDK/Exception/SAExceptionManager.m +++ b/SensorsAnalyticsSDK/Exception/SAExceptionManager.m @@ -69,7 +69,7 @@ - (void)setEnable:(BOOL)enable { } } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("Exception not supported for iOS extensions.") { _configOptions = configOptions; self.enable = configOptions.enableTrackAppCrash; } diff --git a/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m b/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m index d12e5e69..0aac2278 100644 --- a/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m +++ b/SensorsAnalyticsSDK/Exposure/SAExposureViewObject.m @@ -248,7 +248,7 @@ - (void)exposureConditionCheck { } } -- (UIWindow *)topWindow { +- (UIWindow *)topWindow NS_EXTENSION_UNAVAILABLE("Exposure not supported for iOS extensions.") { NSArray *windows; if (@available(iOS 13.0, *)) { __block UIWindowScene *scene = nil; diff --git a/SensorsAnalyticsSDK/Exposure/SensorsAnalyticsSDK+Exposure.h b/SensorsAnalyticsSDK/Exposure/SensorsAnalyticsSDK+Exposure.h index 6ca2efa0..13c8e03c 100644 --- a/SensorsAnalyticsSDK/Exposure/SensorsAnalyticsSDK+Exposure.h +++ b/SensorsAnalyticsSDK/Exposure/SensorsAnalyticsSDK+Exposure.h @@ -29,19 +29,19 @@ NS_ASSUME_NONNULL_BEGIN /// - Parameters: /// - view: view to expose /// - data: exposure data, such as event name, properties, etc. -- (void)addExposureView:(UIView *)view withData:(SAExposureData *)data; +- (void)addExposureView:(UIView *)view withData:(SAExposureData *)data NS_EXTENSION_UNAVAILABLE("Exposure not supported for iOS extensions."); /// remove exposure for certain view /// - Parameters: /// - view: view that need to remove exposure /// - identifier: exposure identifier to identify certain view, if no identifier specified when addExposureView -- (void)removeExposureView:(UIView *)view withExposureIdentifier:(nullable NSString *)identifier; +- (void)removeExposureView:(UIView *)view withExposureIdentifier:(nullable NSString *)identifier NS_EXTENSION_UNAVAILABLE("Exposure not supported for iOS extensions."); /// update properties for certain view that need to expose /// - Parameters: /// - view: view to expose /// - properties: properties to update -- (void)updateExposure:(UIView *)view withProperties:(NSDictionary *)properties; +- (void)updateExposure:(UIView *)view withProperties:(NSDictionary *)properties NS_EXTENSION_UNAVAILABLE("Exposure not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Location/SALocationManager.h b/SensorsAnalyticsSDK/Location/SALocationManager.h index 89e90da8..02144481 100644 --- a/SensorsAnalyticsSDK/Location/SALocationManager.h +++ b/SensorsAnalyticsSDK/Location/SALocationManager.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SAConfigOptions (Location) -@property (nonatomic, assign) BOOL enableLocation; +@property (nonatomic, assign) BOOL enableLocation NS_EXTENSION_UNAVAILABLE("Location not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Location/SALocationManager.m b/SensorsAnalyticsSDK/Location/SALocationManager.m index 0a529f4c..d98f0666 100644 --- a/SensorsAnalyticsSDK/Location/SALocationManager.m +++ b/SensorsAnalyticsSDK/Location/SALocationManager.m @@ -72,7 +72,7 @@ - (void)setup { [self setupListeners]; } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("Location not supported for iOS extensions.") { _configOptions = configOptions; self.enable = configOptions.enableLocation; } diff --git a/SensorsAnalyticsSDK/Location/SensorsAnalyticsSDK+Location.h b/SensorsAnalyticsSDK/Location/SensorsAnalyticsSDK+Location.h index 5f7a91ac..3cfb5464 100644 --- a/SensorsAnalyticsSDK/Location/SensorsAnalyticsSDK+Location.h +++ b/SensorsAnalyticsSDK/Location/SensorsAnalyticsSDK+Location.h @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN * * @param enable YES/NO */ -- (void)enableTrackGPSLocation:(BOOL)enable API_UNAVAILABLE(macos); +- (void)enableTrackGPSLocation:(BOOL)enable API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("Location not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/RemoteConfig/SAConfigOptions+RemoteConfig.h b/SensorsAnalyticsSDK/RemoteConfig/SAConfigOptions+RemoteConfig.h index 617d8b1c..df5d6750 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SAConfigOptions+RemoteConfig.h +++ b/SensorsAnalyticsSDK/RemoteConfig/SAConfigOptions+RemoteConfig.h @@ -26,16 +26,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - 请求远程配置策略 /// 请求远程配置地址,默认从 serverURL 解析 -@property (nonatomic, copy) NSString *remoteConfigURL API_UNAVAILABLE(macos); +@property (nonatomic, copy) NSString *remoteConfigURL API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions."); /// 禁用随机时间请求远程配置 -@property (nonatomic, assign) BOOL disableRandomTimeRequestRemoteConfig API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL disableRandomTimeRequestRemoteConfig API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions."); /// 最小间隔时长,单位:小时,默认 24 -@property (nonatomic, assign) NSInteger minRequestHourInterval API_UNAVAILABLE(macos); +@property (nonatomic, assign) NSInteger minRequestHourInterval API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions."); /// 最大间隔时长,单位:小时,默认 48 -@property (nonatomic, assign) NSInteger maxRequestHourInterval API_UNAVAILABLE(macos); +@property (nonatomic, assign) NSInteger maxRequestHourInterval API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigCommonOperator.m b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigCommonOperator.m index 728a3123..0ecdbe5b 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigCommonOperator.m +++ b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigCommonOperator.m @@ -66,7 +66,7 @@ - (void)enableLocalRemoteConfig { [self enableRemoteConfig:config]; } -- (void)tryToRequestRemoteConfig { +- (void)tryToRequestRemoteConfig NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions.") { // 触发远程配置请求的三个条件 // 1. 判断是否禁用分散请求,如果禁用则直接请求,同时将本地存储的随机时间清除 if (self.configOptions.disableRandomTimeRequestRemoteConfig || self.configOptions.maxRequestHourInterval < self.configOptions.minRequestHourInterval) { @@ -129,7 +129,7 @@ - (void)handleRandomTimeWithType:(SARemoteConfigHandleRandomTimeType)type { } } -- (void)createRandomTime { +- (void)createRandomTime NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions.") { // 当前时间,以开机时间为准,单位:秒 NSTimeInterval currentTime = NSProcessInfo.processInfo.systemUptime; @@ -165,7 +165,7 @@ - (void)requestRemoteConfigWithHandleRandomTimeType:(SARemoteConfigHandleRandomT } } -- (void)requestRemoteConfigWithDelay:(NSTimeInterval)delay index:(NSUInteger)index isForceUpdate:(BOOL)isForceUpdate { +- (void)requestRemoteConfigWithDelay:(NSTimeInterval)delay index:(NSUInteger)index isForceUpdate:(BOOL)isForceUpdate NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { __weak typeof(self) weakSelf = self; void(^completion)(BOOL success, NSDictionary *config) = ^(BOOL success, NSDictionary *config) { __strong typeof(weakSelf) strongSelf = weakSelf; diff --git a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigManager.m b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigManager.m index 2c78d16a..475b74ef 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigManager.m +++ b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigManager.m @@ -48,6 +48,9 @@ + (instancetype)defaultManager { } - (void)setConfigOptions:(SAConfigOptions *)configOptions { +/* RemoteConfig 可以远程开启全埋点,AppExtension 不支持全埋点,这里暂不支持 RemoteConfig + 后期在 web 增加说明 + */ if ([SAApplication isAppExtension]) { configOptions.enableRemoteConfig = NO; } diff --git a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.m b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.m index 91472ce7..b7536226 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.m +++ b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigOperator.m @@ -152,7 +152,7 @@ - (BOOL)isLibVersionUnchanged { return [self.model.localLibVersion isEqualToString:SensorsAnalyticsSDK.sdkInstance.libVersion]; } -- (BOOL)shouldAddVersionOnEnableEncrypt { +- (BOOL)shouldAddVersionOnEnableEncrypt NS_EXTENSION_UNAVAILABLE("Encrypt not supported for iOS extensions.") { #if __has_include("SAConfigOptions+Encrypt.h") if (!self.configOptions.enableEncrypt) { return YES; @@ -218,7 +218,7 @@ - (BOOL)isDisableDebugMode { return self.model.disableDebugMode; } -- (NSURL *)remoteConfigURL { +- (NSURL *)remoteConfigURL NS_EXTENSION_UNAVAILABLE("RemoteConfig not supported for iOS extensions.") { return [NSURL URLWithString:self.configOptions.remoteConfigURL]; } diff --git a/SensorsAnalyticsSDK/Visualized/SAVisualizedAbstractMessage.m b/SensorsAnalyticsSDK/Visualized/SAVisualizedAbstractMessage.m index 218205a4..a6eead5d 100644 --- a/SensorsAnalyticsSDK/Visualized/SAVisualizedAbstractMessage.m +++ b/SensorsAnalyticsSDK/Visualized/SAVisualizedAbstractMessage.m @@ -87,7 +87,7 @@ - (NSDictionary *)payload { return [_payload copy]; } -- (NSData *)JSONDataWithFeatureCode:(NSString *)featureCode { +- (NSData *)JSONDataWithFeatureCode:(NSString *)featureCode NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { NSMutableDictionary *jsonObject = [[NSMutableDictionary alloc] init]; jsonObject[@"type"] = _type; jsonObject[@"os"] = @"iOS"; // 操作系统类型 diff --git a/SensorsAnalyticsSDK/Visualized/SAVisualizedConnection.m b/SensorsAnalyticsSDK/Visualized/SAVisualizedConnection.m index 7113a8b4..e71718a0 100644 --- a/SensorsAnalyticsSDK/Visualized/SAVisualizedConnection.m +++ b/SensorsAnalyticsSDK/Visualized/SAVisualizedConnection.m @@ -204,7 +204,7 @@ - (void)sendMessage:(id)message { } /// 解析调试信息 -- (void)analysisDebugMessage:(NSDictionary *)message { +- (void)analysisDebugMessage:(NSDictionary *)message NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { // 关闭自定义属性也不再处理调试信息 if (message.count == 0 || !SAVisualizedManager.defaultManager.configOptions.enableVisualizedProperties) { return; diff --git a/SensorsAnalyticsSDK/Visualized/SAVisualizedManager.m b/SensorsAnalyticsSDK/Visualized/SAVisualizedManager.m index 808b7171..6831e6e3 100644 --- a/SensorsAnalyticsSDK/Visualized/SAVisualizedManager.m +++ b/SensorsAnalyticsSDK/Visualized/SAVisualizedManager.m @@ -107,7 +107,7 @@ - (void)configChangedWithValid:(BOOL)valid { } #pragma mark - -- (void)setEnable:(BOOL)enable { +- (void)setEnable:(BOOL)enable NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { _enable = enable; if (!enable) { @@ -139,7 +139,7 @@ - (void)setEnable:(BOOL)enable { } } -- (void)setConfigOptions:(SAConfigOptions *)configOptions { +- (void)setConfigOptions:(SAConfigOptions *)configOptions NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { _configOptions = configOptions; // 由于自定义属性依赖于可视化全埋点,所以只要开启自定义属性,默认打开可视化全埋点相关功能 @@ -156,7 +156,7 @@ -(void)updateServerURL:(NSString *)serverURL { } #pragma mark - -- (NSString *)javaScriptSource { +- (NSString *)javaScriptSource NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { if (!self.enable) { return nil; } diff --git a/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.h b/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.h index baa552cd..4dcf12b1 100644 --- a/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.h +++ b/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.h @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN @param viewController 页面 viewController @return YES/NO */ -- (BOOL)isVisualizedAutoTrackViewController:(UIViewController *)viewController NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions."); +- (BOOL)isVisualizedAutoTrackViewController:(UIViewController *)viewController; #pragma mark HeatMap @@ -71,22 +71,22 @@ NS_ASSUME_NONNULL_BEGIN @param viewController 当前页面 viewController @return 当前 viewController 是否支持点击图分析 */ -- (BOOL)isHeatMapViewController:(UIViewController *)viewController NS_EXTENSION_UNAVAILABLE("HeatMap not supported for iOS extensions."); +- (BOOL)isHeatMapViewController:(UIViewController *)viewController; @end @interface SAConfigOptions (Visualized) /// 开启点击图 -@property (nonatomic, assign) BOOL enableHeatMap API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableHeatMap API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("HeatMap not supported for iOS extensions."); /// 开启可视化全埋点 -@property (nonatomic, assign) BOOL enableVisualizedAutoTrack API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableVisualizedAutoTrack API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions."); /// 开启可视化全埋点自定义属性 /// /// 开启后,SDK 会默认开启可视化全埋点功能 -@property (nonatomic, assign) BOOL enableVisualizedProperties API_UNAVAILABLE(macos); +@property (nonatomic, assign) BOOL enableVisualizedProperties API_UNAVAILABLE(macos) NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions."); @end diff --git a/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.m b/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.m index deb62dd8..756d7c09 100644 --- a/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.m +++ b/SensorsAnalyticsSDK/Visualized/SensorsAnalyticsSDK+Visualized.m @@ -29,7 +29,7 @@ @implementation SensorsAnalyticsSDK (Visualized) #pragma mark - VisualizedAutoTrack -- (BOOL)isVisualizedAutoTrackEnabled { +- (BOOL)isVisualizedAutoTrackEnabled NS_EXTENSION_UNAVAILABLE("VisualizedAutoTrack not supported for iOS extensions.") { return self.configOptions.enableVisualizedAutoTrack || self.configOptions.enableVisualizedProperties; } @@ -42,7 +42,7 @@ - (BOOL)isVisualizedAutoTrackViewController:(UIViewController *)viewController { } #pragma mark - HeatMap -- (BOOL)isHeatMapEnabled { +- (BOOL)isHeatMapEnabled NS_EXTENSION_UNAVAILABLE("HeatMap not supported for iOS extensions.") { return self.configOptions.enableHeatMap; }