From 929b92180e636ac27ac3e20186e8a14af6dd1c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=80=E6=9C=88?= Date: Tue, 29 Aug 2023 10:36:38 +0800 Subject: [PATCH] Release 4.5.17 --- SensorsAnalyticsSDK.podspec | 13 ++- .../EventBuild/SAPropertyInterceptor.m | 8 ++ SensorsAnalyticsSDK/Core/SAConstants.m | 15 ++- SensorsAnalyticsSDK/Core/SACoreResources.h | 2 +- SensorsAnalyticsSDK/Core/SACoreResources.m | 4 + .../Core/SensorsAnalyticsSDK.m | 2 +- .../RemoteConfig/SARemoteConfigInterceptor.m | 6 + .../Resources/SACoreResourcesTests.m | 18 +++ .../en.lproj/Localizable.strings | 95 ++++++++++++++++ SpecialFileSources/SACoreResources+English.h | 32 ++++++ SpecialFileSources/SACoreResources+English.m | 104 ++++++++++++++++++ 11 files changed, 292 insertions(+), 7 deletions(-) create mode 100644 SensorsAnalyticsTests/Resources/SensorsAnalyticsSDKTest.bundle/en.lproj/Localizable.strings create mode 100644 SpecialFileSources/SACoreResources+English.h create mode 100644 SpecialFileSources/SACoreResources+English.m diff --git a/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK.podspec index 0dab417e..3b8af140 100644 --- a/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "4.5.16" + s.version = "4.5.17" 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}" } @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.subspec 'Base' do |b| core_dir = "SensorsAnalyticsSDK/Core/" b.source_files = core_dir + "**/*.{h,m}" - b.exclude_files = core_dir + "SAAlertController.h", core_dir + "SAAlertController.m" + b.exclude_files = core_dir + 'SAAlertController.{h,m}' b.public_header_files = core_dir + "SensorsAnalyticsSDK.h", core_dir + "SensorsAnalyticsExtension.h", core_dir + "SensorsAnalyticsSDK+Public.h", core_dir + "SASecurityPolicy.h", core_dir + "SAConfigOptions.h", core_dir + "SAConstants.h", core_dir + "PropertyPlugin/SAPropertyPlugin.h" b.ios.frameworks = 'CoreTelephony' b.dependency 'SensorsAnalyticsSDK/__Store' @@ -49,7 +49,7 @@ Pod::Spec.new do |s| g.frameworks = 'UIKit' end -# 可视化相关功能,包含可视化全埋点和点击图 + # 可视化相关功能,包含可视化全埋点和点击图 s.subspec 'Visualized' do |f| f.ios.deployment_target = '9.0' f.dependency 'SensorsAnalyticsSDK/AutoTrack' @@ -127,4 +127,11 @@ Pod::Spec.new do |s| h.public_header_files = 'SensorsAnalyticsSDK/Exposure/SAConfigOptions+Exposure.h', 'SensorsAnalyticsSDK/Exposure/SAExposureConfig.h', 'SensorsAnalyticsSDK/Exposure/SAExposureData.h', 'SensorsAnalyticsSDK/Exposure/SensorsAnalyticsSDK+Exposure.h', 'SensorsAnalyticsSDK/Exposure/UIView+ExposureIdentifier.h', 'SensorsAnalyticsSDK/Exposure/SAExposureListener.h' end + # SDK 切换到英文版,运营商属性、日志和弹框提示等,都换成英文。使用前咨询神策售后技术顾问,否则请慎重使用! + s.subspec 'EnglishResources' do |e| + e.dependency 'SensorsAnalyticsSDK/Base' + e.source_files = 'SpecialFileSources/SACoreResources+English.{h,m}' + e.project_header_files = 'SpecialFileSources/SACoreResources+English.h' + end + end diff --git a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m index c631dea4..6851d495 100644 --- a/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m +++ b/SensorsAnalyticsSDK/Core/Interceptor/EventBuild/SAPropertyInterceptor.m @@ -36,11 +36,19 @@ @implementation SAPropertyInterceptor - (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)completion { NSParameterAssert(input.eventObject); + // 线上极端情况下,切换到异步 serialQueue 后,eventObject 可能被释放 + if(!input.eventObject || ![input.eventObject isKindOfClass:SABaseEventObject.class]) { + input.state = SAFlowStateError; + input.message = @"A memory problem has occurred, eventObject may be freed. End the track flow"; + completion(input); + } + // 注册自定义属性采集插件,采集 track 附带属性 SACustomPropertyPlugin *customPlugin = [[SACustomPropertyPlugin alloc] initWithCustomProperties:input.properties]; [[SAPropertyPluginManager sharedInstance] registerCustomPropertyPlugin:customPlugin]; SABaseEventObject *object = input.eventObject; + // 获取插件采集的所有属性 NSDictionary *pluginProperties = [[SAPropertyPluginManager sharedInstance] propertiesWithFilter:object]; // 属性合法性校验 diff --git a/SensorsAnalyticsSDK/Core/SAConstants.m b/SensorsAnalyticsSDK/Core/SAConstants.m index 433e1516..87749288 100644 --- a/SensorsAnalyticsSDK/Core/SAConstants.m +++ b/SensorsAnalyticsSDK/Core/SAConstants.m @@ -27,6 +27,10 @@ #import "SensorsAnalyticsSDK+Private.h" #import "SACoreResources.h" +#if __has_include("SACoreResources+English.h") +#import "SACoreResources+English.h" +#endif + #pragma mark - Track Timer NSString *const kSAEventIdSuffix = @"_SATimer"; @@ -127,7 +131,7 @@ #pragma mark - bridge name NSString * const SA_SCRIPT_MESSAGE_HANDLER_NAME = @"sensorsdataNativeTracker"; -NSSet* sensorsdata_reserved_properties() { +NSSet* sensorsdata_reserved_properties(void) { return [NSSet setWithObjects:@"date", @"datetime", @"distinct_id", @"event", @"events", @"first_id", @"id", @"original_id", @"properties", @"second_id", @"time", @"user_id", @"users", nil]; } @@ -148,8 +152,15 @@ void sensorsdata_dispatch_safe_sync(dispatch_queue_t queue,DISPATCH_NOESCAPE dis static NSDictionary *languageResources = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - // 获取默认语言资源 JSON + +#if __has_include("SACoreResources+English.h") + // 获取英文资源 + languageResources = [SACoreResources englishLanguageResources]; +#else + // 默认加载中文资源 languageResources = [SACoreResources defaultLanguageResources]; +#endif + }); return languageResources[key] ?: value; diff --git a/SensorsAnalyticsSDK/Core/SACoreResources.h b/SensorsAnalyticsSDK/Core/SACoreResources.h index 5e8b0c31..0555404d 100644 --- a/SensorsAnalyticsSDK/Core/SACoreResources.h +++ b/SensorsAnalyticsSDK/Core/SACoreResources.h @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN + (NSDictionary *)mcc; -/// 默认语言资源 +/// 默认加载中文资源 + (NSDictionary *)defaultLanguageResources; @end diff --git a/SensorsAnalyticsSDK/Core/SACoreResources.m b/SensorsAnalyticsSDK/Core/SACoreResources.m index fcd35fe0..691d645d 100644 --- a/SensorsAnalyticsSDK/Core/SACoreResources.m +++ b/SensorsAnalyticsSDK/Core/SACoreResources.m @@ -43,7 +43,11 @@ + (NSDictionary *)mcc { } + (NSDictionary *)defaultLanguageResources { +#if __has_include("SACoreResources+English.h") + return nil; +#else return @{@"SADebugMode":@"SDK 调试模式选择",@"SADebugOnly":@"开启调试模式(不导入数据)",@"SADebugAndTrack":@"开启调试模式(导入数据)",@"SADebugOff":@"调试模式已关闭",@"SADebugCurrentlyInDebugOnly":@"当前为调试模式(不导入数据)",@"SADebugCurrentlyInDebugAndTrack":@"当前为调试模式(导入数据)",@"SADebugModeTurnedOff":@"已关闭调试模式,重新扫描二维码开启",@"SADebugOnlyModeTurnedOn":@"开启调试模式,校验数据,但不进行数据导入;\n关闭 App 进程后,将自动关闭调试模式。",@"SADebugAndTrackModeTurnedOn":@"开启调试模式,校验数据,并将数据导入神策分析中;\n关闭 App 进程后,将自动关闭调试模式。",@"SADebugNowInDebugOnlyMode":@"现在您打开了'DEBUG_ONLY'模式,此模式下只校验数据但不导入数据,数据出错时会以提示框的方式提示开发者,请上线前一定关闭。",@"SADebugNowInDebugAndTrackMode":@"现在您打开了'DEBUG_AND_TRACK'模式,此模式下会校验数据并且导入数据,数据出错时会以提示框的方式提示开发者,请上线前一定关闭。",@"SADebugNotes":@"SensorsData 重要提示",@"SAVisualizedAutoTrack":@"可视化全埋点",@"SAVisualizedPageErrorTitle":@"当前页面无法进行可视化全埋点",@"SAVisualizedConfigurationDocument":@"配置文档",@"SAVisualizedConnect":@"正在连接 App 可视化全埋点",@"SAVisualizedWifi":@",建议在 WiFi 环境下使用",@"SAVisualizedProjectError":@"App 集成的项目与电脑浏览器打开的项目不同,无法进行可视化全埋点",@"SAVisualizedEnableLogHint":@"可视化全埋点进入 Debug 模式,需要开启日志打印用于收集调试信息,退出 Debug 模式关闭日志打印,是否需要开启呢?",@"SAVisualizedEnableLogAction":@"开启日志打印",@"SAVisualizedTemporarilyDisabled":@"暂不开启",@"SAVisualizedWebPageErrorMessage":@"此页面不是 WKWebView,iOS App 内嵌 H5 可视化全埋点,只支持 WKWebView",@"SAVisualizedJSError":@"此页面未集成 Web JS SDK 或者 Web JS SDK 版本过低,请集成最新版 Web JS SDK",@"SAVisualizedSDKError":@"SDK 没有被正确集成,请联系贵方技术人员开启可视化全埋点",@"SAVisualizedParameterError":@"参数错误",@"SAVisualizedFlutterPageErrorMessage":@"此页面未集成 Flutter 全埋点 SDK 或 Flutter 全埋点 SDK 版本过低,请集成最新版 Flutter 全埋点 SDK",@"SAAppClicksAnalyticsConnect":@"正在连接 App 点击分析",@"SAAppClicksAnalyticsSDKError":@"SDK 没有被正确集成,请联系贵方技术人员开启点击分析",@"SAAppClicksAnalyticsProjectError":@"App 集成的项目与电脑浏览器打开的项目不同,无法进行点击分析",@"SAAppClicksAnalyticsPageErrorTitle":@"当前页面无法进行点击分析",@"SAAppClicksAnalyticsPageWebErrorMessage":@"此页面包含 UIWebView,iOS App 内嵌 H5 点击分析,只支持 WKWebView",@"SAAppClicksAnalytics":@"点击分析",@"SARemoteConfigStart":@"开始获取采集控制信息",@"SARemoteConfigObtainFailed":@"远程配置获取失败,请稍后重新扫描二维码",@"SARemoteConfigProjectError":@"App 集成的项目与二维码对应的项目不同,无法进行调试",@"SARemoteConfigOSError":@"App 与二维码对应的操作系统不同,无法进行调试",@"SARemoteConfigAppError":@"当前 App 与二维码对应的 App 不同,无法进行调试",@"SARemoteConfigQRError":@"二维码信息校验失败,请检查采集控制是否配置正确",@"SARemoteConfigNetworkError":@"网络连接失败,请检查设备网络,确认网络畅通后,请重新扫描二维码进行调试",@"SARemoteConfigWrongVersion":@"版本不一致",@"SARemoteConfigLoaded":@"采集控制加载完成,可以通过 Xcode 控制台日志来调试",@"SARemoteConfigCompareVersion":@"获取到采集控制信息的版本:%@,二维码信息的版本:%@,请稍后重新扫描二维码",@"SAEncryptSelectedKeyInvalid":@"密钥验证不通过,所选密钥无效",@"SAEncryptNotEnabled":@"当前 App 未开启加密,请开启加密后再试",@"SAEncryptAppKeyEmpty":@"密钥验证不通过,App 端密钥为空",@"SAEncryptKeyVerificationPassed":@"密钥验证通过,所选密钥与 App 端密钥相同",@"SAEncryptKeyTypeVerificationFailed":@"密钥验证不通过,所选密钥与 App 端密钥不相同。所选密钥对称算法类型:%@,非对称算法类型:%@,App 端对称算法类型:%@,非对称算法类型:%@",@"SAEncryptKeyVersionVerificationFailed":@"密钥验证不通过,所选密钥与 App 端密钥不相同。所选密钥版本:%@,App 端密钥版本:%@",@"SAChannelReconnectError":@"无法重连,请检查是否更换了联调手机",@"SAChannelServerURLError":@"数据接收地址错误,无法使用联调诊断工具",@"SAChannelProjectError":@"App 集成的项目与电脑浏览器打开的项目不同,无法使用联调诊断工具",@"SAChannelEnableJointDebugging":@"即将开启联调模式",@"SAChannelNetworkError":@"当前网络不可用,请检查网络!",@"SAChannelRequestWhitelistFailed":@"添加白名单请求失败,请联系神策技术支持人员排查问题!",@"SAChannelSuccessfullyEnabled":@"成功开启联调模式",@"SAChannelTriggerActivation":@"此模式下不需要卸载 App,点击“激活”按钮可反复触发激活。",@"SAChannelActivate":@"激活",@"SAChannelDeviceCodeEmpty":@"检测到“设备码为空”,可能的原因如下,请排查:",@"SAChannelTroubleshooting":@"\n1.手机系统设置中「隐私->广告-> 限制广告追踪」;\n\n2.若手机系统为 iOS 14 ,请联系研发人员确认 trackAppInstall 接口是否在 “跟踪” 授权之后调用。\n\n排查修复后,请重新扫码进行联调。\n\n",@"SAChannelNetworkException":@"网络异常,请求失败!",@"SADeepLinkCallback":@"未调用 setDeepLinkCompletion 方法设置回调函数",@"SAAlertCancel":@"取消",@"SAAlertContinue":@"继续",@"SAAlertHint":@"提示",@"SAAlertOK":@"确定",@"SAAlertNotRemind":@"不再提示",@"SAPresetPropertyCarrierMobile":@"中国移动",@"SAPresetPropertyCarrierUnicom":@"中国联通",@"SAPresetPropertyCarrierTelecom":@"中国电信",@"SAPresetPropertyCarrierSatellite":@"中国卫通",@"SAPresetPropertyCarrierTietong":@"中国铁通",@"SADeviceWhiteListTitle":@"添加设备白名单",@"SADeviceWhiteListMessageProject":@"设备白名单配置项目与事件上报项目不一致",@"SADeviceWhiteListMessageDeviceType":@"请使用 iOS 设备类型扫码",@"SADeviceWhiteListMessageRequestSuccess":@"请求成功",@"SADeviceWhiteListMessageRequestFailure":@"请求失败,请重新扫码",@"SADynamicSlinkMessageNoNetwork":@"没有检测到网络连接",@"SADynamicSlinkMessageNoTemplateID":@"Slink 模板 ID 缺少",@"SADynamicSlinkMessageNoChannelName":@"渠道名缺少",@"SADynamicSlinkMessageNoAccessToken":@"token 缺少",@"SADynamicSlinkMessageNoProject":@"获取不到数据埋点地址的项目名称",@"SADynamicSlinkMessageNoRedirectURI":@"通用跳转链接缺少",@"SADynamicSlinkMessageNoDomain":@"自定义域名缺少或者填写格式不对",@"SADynamicSlinkMessageResponseError":@"后端返回数据异常"}; +#endif } @end diff --git a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m index 0cd74234..7552e60d 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.16" +#define VERSION @"4.5.17" void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag; diff --git a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigInterceptor.m b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigInterceptor.m index 13171431..09ba6dde 100644 --- a/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigInterceptor.m +++ b/SensorsAnalyticsSDK/RemoteConfig/SARemoteConfigInterceptor.m @@ -29,6 +29,12 @@ @implementation SARemoteConfigInterceptor - (void)processWithInput:(SAFlowData *)input completion:(SAFlowDataCompletion)completion { NSParameterAssert(input.eventObject); + + // 线上极端情况下,切换到异步 serialQueue 后,eventObject 可能被释放 + if(!input.eventObject || ![input.eventObject isKindOfClass:SABaseEventObject.class]) { + input.state = SAFlowStateError; + input.message = @"A memory problem has occurred, eventObject may be freed. End the track flow"; + } if ([SAModuleManager.sharedInstance isIgnoreEventObject:input.eventObject]) { input.state = SAFlowStateStop; diff --git a/SensorsAnalyticsTests/Resources/SACoreResourcesTests.m b/SensorsAnalyticsTests/Resources/SACoreResourcesTests.m index c33654f2..5c645605 100644 --- a/SensorsAnalyticsTests/Resources/SACoreResourcesTests.m +++ b/SensorsAnalyticsTests/Resources/SACoreResourcesTests.m @@ -27,6 +27,9 @@ #import "SACoreResources.h" #import "SensorsAnalyticsSDK.h" +// 默认不引入 SACoreResources+English 文件,需要在添加即可 +//#import "SACoreResources+English.h" + @interface SACoreResourcesTests : XCTestCase @property (nonatomic, strong) NSBundle *bundle; @@ -83,4 +86,19 @@ - (void)testDefaultLanguageResources { XCTAssertTrue([[SACoreResources defaultLanguageResources] isEqualToDictionary:localizedDict]); } +//- (void)testEnglishLanguageResources { +// // 获取语言资源的 Bundle +// NSBundle* languageBundle = nil; +// NSBundle *sensorsBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:self.class] pathForResource:@"SensorsAnalyticsSDKTest" ofType:@"bundle"]]; +// NSString *path = [sensorsBundle pathForResource:@"en" ofType:@"lproj"]; +// if (path) { +// languageBundle = [NSBundle bundleWithPath:path]; +// } +// +// NSString *localizablePath = [languageBundle pathForResource:@"Localizable" ofType:@"strings"]; +// NSDictionary *localizedDict = [NSDictionary dictionaryWithContentsOfFile:localizablePath]; +// +// XCTAssertTrue([[SACoreResources englishLanguageResources] isEqualToDictionary:localizedDict]); +//} + @end diff --git a/SensorsAnalyticsTests/Resources/SensorsAnalyticsSDKTest.bundle/en.lproj/Localizable.strings b/SensorsAnalyticsTests/Resources/SensorsAnalyticsSDKTest.bundle/en.lproj/Localizable.strings new file mode 100644 index 00000000..6d6e090b --- /dev/null +++ b/SensorsAnalyticsTests/Resources/SensorsAnalyticsSDKTest.bundle/en.lproj/Localizable.strings @@ -0,0 +1,95 @@ +/* + Localizable.strings + SensorsAnalyticsSDK + + Created by wenquan on 2022/6/5. + Copyright © 2022 Sensors Data Co., Ltd. All rights reserved. +*/ + +// Debug Mode +"SADebugMode" = "SDK Debug Mode"; +"SADebugOnly" = "DEBUG_ONLY"; +"SADebugAndTrack" = "DEBUG_AND_TRACK"; +"SADebugOff" = "DEBUG_OFF"; +"SADebugCurrentlyInDebugOnly" = "Currently in DEBUG_ONLY mode (don't import data)"; +"SADebugCurrentlyInDebugAndTrack" = "Currently in DEBUG_AND_TRACK mode (import data)"; +"SADebugModeTurnedOff" = "The debug mode has been turned off, please scan the QR code again to turn it on"; +"SADebugOnlyModeTurnedOn" = "Turn on the debug mode, verify the data, but do not import the data;\nAfter the App process is closed, the debug mode will be automatically turned off."; +"SADebugAndTrackModeTurnedOn" = "Turn on the debug mode, verify the data, and import the data into Sensors Analysis;\nAfter the App process is closed, the debug mode will be automatically turned off."; +"SADebugNowInDebugOnlyMode" = "Now you have turned on the 'DEBUG_ONLY' mode. In this mode, only the data is verified but not imported. When the data is wrong, the developer will be prompted by alert. Please turn it off before you go online."; +"SADebugNowInDebugAndTrackMode" = "Now you have turned on the 'DEBUG_AND_TRACK' mode. In this mode, data is verified and imported. When the data is wrong, the developer will be prompted by alert. Please turn it off before you go online."; +"SADebugNotes" = "SensorsData Important Notes"; + +// Visualized AutoTrack +"SAVisualizedConnect" = "Connecting to Visualized AutoTrack"; +"SAVisualizedWifi" = ", it is recommended to use it in a WiFi environment"; +"SAVisualizedProjectError" = "The App's project is different from the computer browser, and Visualized AutoTrack is not available"; +"SAVisualizedEnableLogHint" = "To enter the Debug mode with the Visualized AutoTrack, you need to enable log printing to collect debugging information, and exit the Debug mode to close the log printing. Do you need to enable it?"; +"SAVisualizedEnableLogAction" = "Enable Log"; +"SAVisualizedTemporarilyDisabled" = "Temporarily Disabled"; +"SAVisualizedPageErrorTitle" = "The current page cannot use Visualized AutoTrack"; +"SAVisualizedPageErrorMessage" = "This page is not a WKWebView, the iOS App embedded H5 Visualized AutoTrack, only supports WKWebView"; +"SAVisualizedConfigurationDocument" = "Configuration Document"; +"SAVisualizedJSError" = "This page is not integrated with the Web JS SDK or the version of the Web JS SDK is too low, please integrate the latest version of the Web JS SDK"; +"SAVisualizedSDKError" = "The SDK is not integrated correctly, please contact your technical staff to enable Visualized AutoTrack"; +"SAVisualizedParameterError" = "parameter error"; +"SAVisualizedAutoTrack" = "Visualized AutoTrack"; + +// App Clicks Analytics +"SAAppClicksAnalyticsConnect" = "Connecting to App Clicks Analytics"; +"SAAppClicksAnalyticsSDKError" = "The SDK is not integrated correctly, please contact your technical staff to enable App Clicks Analytics"; +"SAAppClicksAnalyticsProjectError" = "The App's project is different from the computer browser, and App Clicks Analytics is not available"; +"SAAppClicksAnalyticsPageErrorTitle" = "The current page cannot use App Clicks Analytics"; +"SAAppClicksAnalyticsPageErrorMessage" = "This page contains UIWebView, the iOS App embedded H5 App Clicks Analytics, only supports WKWebView"; +"SAAppClicksAnalytics" = "App Clicks Analytics"; + +// Remote Config +"SARemoteConfigStart" = "Start get remote config"; +"SARemoteConfigObtainFailed" = "Failed to obtain remote config, please scan the QR code again later"; +"SARemoteConfigProjectError" = "The project integrated by the app is different from the project corresponding to the QR code, and cannot be debugged"; +"SARemoteConfigOSError" = "The operating system corresponding to the App and the QR code is different and cannot be debugged"; +"SARemoteConfigAppError" = "The app is different from the app corresponding to the QR code and cannot be debugged"; +"SARemoteConfigQRError" = "QR code information verification failed, please check whether the remote config is configured correctly"; +"SARemoteConfigNetworkError" = "Network connected fails, please scan the QR code again for debugging"; +"SARemoteConfigWrongVersion" = "Wrong Version"; +"SARemoteConfigLoaded" = "The remote config is loaded and can be debugged through the Xcode console log"; +"SARemoteConfigCompareVersion" = "The version from the url: %@, the version from the QR code: %@, please scan the QR code again later"; + +// Encrypt +"SAEncryptSelectedKeyInvalid" = "Key verification failed, the selected key is invalid"; +"SAEncryptNotEnabled" = "Encryption is not enabled in the current app, please enable encryption and try again"; +"SAEncryptAppKeyEmpty" = "The key verification fails, and the App-side key is empty"; +"SAEncryptKeyVerificationPassed" = "The key verification is passed, and the selected key is the same as the App-side key"; +"SAEncryptKeyTypeVerificationFailed" = "The key verification failed, and the selected key type is different from the app-side key type. Selected key symmetric algorithm type: %@, asymmetricEncryptType: %@, App-side key symmetric algorithm type: %@, asymmetricEncryptType: %@"; +"SAEncryptKeyVersionVerificationFailed" = "The key verification failed, the selected key is not the same as the app-side key. Selected key version: %@, App-side key version: %@"; + +// Channel +"SAChannelReconnectError" = "It cannot be reconnected. Please check whether the phone has been replaced"; +"SAChannelServerURLError" = "The ServerURL is incorrect. The joint diagnostic tool cannot be used"; +"SAChannelProjectError" = "The project integrated by App is different from the project opened by computer browser, and the joint diagnostic tool cannot be used"; +"SAChannelEnableJointDebugging" = "Enable joint debugging mode"; +"SAChannelNetworkError" = "The current network is unavailable, please check the network!"; +"SAChannelRequestWhitelistFailed" = "Failed to add whitelist request, please contact SensorsData technical support personnel to troubleshoot the problem!"; +"SAChannelSuccessfullyEnabled" = "Successfully enabled joint debugging mode"; +"SAChannelTriggerActivation" = "In this mode, there is no need to uninstall the App. Click the \"Activate\" button to trigger the activation repeatedly."; +"SAChannelActivate" = "Activate"; +"SAChannelDeviceCodeEmpty" = "The \"device code is empty\" is detected, the possible reasons are as follows, please check:"; +"SAChannelTroubleshooting" = "\n1.「Privacy -> Advertising -> Limit Ad Tracking」 in the phone system settings;\n\n2.If the mobile phone system is iOS 14, please contact the developer to confirm whether the trackAppInstall interface is called after the \"tracking\" authorization.\n\nAfter troubleshooting, please scan the code again for joint debugging.\n\n"; +"SAChannelNetworkException" = "Network exception, request failed!"; + +// DeepLink +"SADeepLinkCallback" = "The callback function is not set by calling the setDeepLinkCompletion method"; + +// Alert +"SAAlertCancel" = "Cancel"; +"SAAlertContinue" = "Continue"; +"SAAlertHint" = "Hint"; +"SAAlertOK" = "OK"; +"SAAlertNotRemind" = "Don't Remind"; + +// Preset Property +"SAPresetPropertyCarrierMobile" = "MOBILE"; +"SAPresetPropertyCarrierUnicom" = "UNICOM"; +"SAPresetPropertyCarrierTelecom" = "TELECOM"; +"SAPresetPropertyCarrierSatellite" = "SATELLITE"; +"SAPresetPropertyCarrierTietong" = "TIETONG"; diff --git a/SpecialFileSources/SACoreResources+English.h b/SpecialFileSources/SACoreResources+English.h new file mode 100644 index 00000000..84e3cf3d --- /dev/null +++ b/SpecialFileSources/SACoreResources+English.h @@ -0,0 +1,32 @@ +// +// SACoreResources+English.h +// SensorsAnalyticsSDK +// +// Created by  储强盛 on 2023/8/22. +// Copyright © 2015-2023 Sensors Data Co., Ltd. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "SACoreResources.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SACoreResources (English) + +/// 加载英文资源 ++ (NSDictionary *)englishLanguageResources; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SpecialFileSources/SACoreResources+English.m b/SpecialFileSources/SACoreResources+English.m new file mode 100644 index 00000000..fb564cf8 --- /dev/null +++ b/SpecialFileSources/SACoreResources+English.m @@ -0,0 +1,104 @@ +// +// SACoreResources+English.m +// SensorsAnalyticsSDK +// +// Created by  储强盛 on 2023/8/22. +// Copyright © 2015-2023 Sensors Data Co., Ltd. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// 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 "SACoreResources+English.h" + +@implementation SACoreResources (English) + ++ (NSDictionary *)englishLanguageResources { + return @{ + @"SADebugMode": @"SDK Debug Mode", + @"SADebugOnly": @"DEBUG_ONLY", + @"SADebugAndTrack": @"DEBUG_AND_TRACK", + @"SADebugOff": @"DEBUG_OFF", + @"SADebugCurrentlyInDebugOnly": @"Currently in DEBUG_ONLY mode (don't import data)", + @"SADebugCurrentlyInDebugAndTrack": @"Currently in DEBUG_AND_TRACK mode (import data)", + @"SADebugModeTurnedOff": @"The debug mode has been turned off, please scan the QR code again to turn it on", + @"SADebugOnlyModeTurnedOn": @"Turn on the debug mode, verify the data, but do not import the data;\nAfter the App process is closed, the debug mode will be automatically turned off.", + @"SADebugAndTrackModeTurnedOn": @"Turn on the debug mode, verify the data, and import the data into Sensors Analysis;\nAfter the App process is closed, the debug mode will be automatically turned off.", + @"SADebugNowInDebugOnlyMode": @"Now you have turned on the 'DEBUG_ONLY' mode. In this mode, only the data is verified but not imported. When the data is wrong, the developer will be prompted by alert. Please turn it off before you go online.", + @"SADebugNowInDebugAndTrackMode": @"Now you have turned on the 'DEBUG_AND_TRACK' mode. In this mode, data is verified and imported. When the data is wrong, the developer will be prompted by alert. Please turn it off before you go online.", + @"SADebugNotes": @"SensorsData Important Notes", + @"SAVisualizedConnect": @"Connecting to Visualized AutoTrack", + @"SAVisualizedWifi": @", it is recommended to use it in a WiFi environment", + @"SAVisualizedProjectError": @"The App's project is different from the computer browser, and Visualized AutoTrack is not available", + @"SAVisualizedEnableLogHint": @"To enter the Debug mode with the Visualized AutoTrack, you need to enable log printing to collect debugging information, and exit the Debug mode to close the log printing. Do you need to enable it?", + @"SAVisualizedEnableLogAction": @"Enable Log", + @"SAVisualizedTemporarilyDisabled": @"Temporarily Disabled", + @"SAVisualizedPageErrorTitle": @"The current page cannot use Visualized AutoTrack", + @"SAVisualizedPageErrorMessage": @"This page is not a WKWebView, the iOS App embedded H5 Visualized AutoTrack, only supports WKWebView", + @"SAVisualizedConfigurationDocument": @"Configuration Document", + @"SAVisualizedJSError": @"This page is not integrated with the Web JS SDK or the version of the Web JS SDK is too low, please integrate the latest version of the Web JS SDK", + @"SAVisualizedSDKError": @"The SDK is not integrated correctly, please contact your technical staff to enable Visualized AutoTrack", + @"SAVisualizedParameterError": @"parameter error", + @"SAVisualizedAutoTrack": @"Visualized AutoTrack", + @"SAAppClicksAnalyticsConnect": @"Connecting to App Clicks Analytics", + @"SAAppClicksAnalyticsSDKError": @"The SDK is not integrated correctly, please contact your technical staff to enable App Clicks Analytics", + @"SAAppClicksAnalyticsProjectError": @"The App's project is different from the computer browser, and App Clicks Analytics is not available", + @"SAAppClicksAnalyticsPageErrorTitle": @"The current page cannot use App Clicks Analytics", + @"SAAppClicksAnalyticsPageErrorMessage": @"This page contains UIWebView, the iOS App embedded H5 App Clicks Analytics, only supports WKWebView", + @"SAAppClicksAnalytics": @"App Clicks Analytics", + @"SARemoteConfigStart": @"Start get remote config", + @"SARemoteConfigObtainFailed": @"Failed to obtain remote config, please scan the QR code again later", + @"SARemoteConfigProjectError": @"The project integrated by the app is different from the project corresponding to the QR code, and cannot be debugged", + @"SARemoteConfigOSError": @"The operating system corresponding to the App and the QR code is different and cannot be debugged", + @"SARemoteConfigAppError": @"The app is different from the app corresponding to the QR code and cannot be debugged", + @"SARemoteConfigQRError": @"QR code information verification failed, please check whether the remote config is configured correctly", + @"SARemoteConfigNetworkError": @"Network connected fails, please scan the QR code again for debugging", + @"SARemoteConfigWrongVersion": @"Wrong Version", + @"SARemoteConfigLoaded": @"The remote config is loaded and can be debugged through the Xcode console log", + @"SARemoteConfigCompareVersion": @"The version from the url: %@, the version from the QR code: %@, please scan the QR code again later", + @"SAEncryptSelectedKeyInvalid": @"Key verification failed, the selected key is invalid", + @"SAEncryptNotEnabled": @"Encryption is not enabled in the current app, please enable encryption and try again", + @"SAEncryptAppKeyEmpty": @"The key verification fails, and the App-side key is empty", + @"SAEncryptKeyVerificationPassed": @"The key verification is passed, and the selected key is the same as the App-side key", + @"SAEncryptKeyTypeVerificationFailed": @"The key verification failed, and the selected key type is different from the app-side key type. Selected key symmetric algorithm type: %@, asymmetricEncryptType: %@, App-side key symmetric algorithm type: %@, asymmetricEncryptType: %@", + @"SAEncryptKeyVersionVerificationFailed": @"The key verification failed, the selected key is not the same as the app-side key. Selected key version: %@, App-side key version: %@", + @"SAChannelReconnectError": @"It cannot be reconnected. Please check whether the phone has been replaced", + @"SAChannelServerURLError": @"The ServerURL is incorrect. The joint diagnostic tool cannot be used", + @"SAChannelProjectError": @"The project integrated by App is different from the project opened by computer browser, and the joint diagnostic tool cannot be used", + @"SAChannelEnableJointDebugging": @"Enable joint debugging mode", + @"SAChannelNetworkError": @"The current network is unavailable, please check the network!", + @"SAChannelRequestWhitelistFailed": @"Failed to add whitelist request, please contact SensorsData technical support personnel to troubleshoot the problem!", + @"SAChannelSuccessfullyEnabled": @"Successfully enabled joint debugging mode", + @"SAChannelTriggerActivation": @"In this mode, there is no need to uninstall the App. Click the \"Activate\" button to trigger the activation repeatedly.", + @"SAChannelActivate": @"Activate", + @"SAChannelDeviceCodeEmpty": @"The \"device code is empty\" is detected, the possible reasons are as follows, please check:", + @"SAChannelTroubleshooting": @"\n1.「Privacy -> Advertising -> Limit Ad Tracking」 in the phone system settings;\n\n2.If the mobile phone system is iOS 14, please contact the developer to confirm whether the trackAppInstall interface is called after the \"tracking\" authorization.\n\nAfter troubleshooting, please scan the code again for joint debugging.\n\n", + @"SAChannelNetworkException": @"Network exception, request failed!", + @"SADeepLinkCallback": @"The callback function is not set by calling the setDeepLinkCompletion method", + @"SAAlertCancel": @"Cancel", + @"SAAlertContinue": @"Continue", + @"SAAlertHint": @"Hint", + @"SAAlertOK": @"OK", + @"SAAlertNotRemind": @"Don't Remind", + @"SAPresetPropertyCarrierMobile": @"MOBILE", + @"SAPresetPropertyCarrierUnicom": @"UNICOM", + @"SAPresetPropertyCarrierTelecom": @"TELECOM", + @"SAPresetPropertyCarrierSatellite": @"SATELLITE", + @"SAPresetPropertyCarrierTietong": @"TIETONG" + }; +} + +@end