From 932e40acc0e6b97c845e122a986ad92229a58649 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 3 Jul 2023 17:01:43 +0800 Subject: [PATCH] temp upload --- GrowingAnalytics.podspec | 25 +-- GrowingAutotracker/GrowingAutotracker.h | 189 ------------------ GrowingAutotracker/GrowingAutotracker.m | 74 ------- .../UIViewController+GrowingAutotracker.m | 1 - .../GrowingNode/GrowingViewChangeProvider.m | 2 +- .../GrowingNode/GrowingViewClickProvider.m | 2 +- .../GrowingNode/GrowingViewNode.h | 4 +- .../GrowingNode/GrowingViewNode.m | 14 +- GrowingTracker/GrowingTracker.h | 125 ------------ GrowingTracker/GrowingTracker.m | 74 ------- Modules/Flutter/GrowingFlutterPlugin.m | 7 +- Modules/SwiftProtobuf/SwiftProtobuf.swift | 2 - Modules/WebCircle/GrowingWebCircle.m | 2 +- Package.swift | 78 -------- Podfile.lock | 2 +- .../GrowingAutotracker-NoIDFA-Wrapper/dummy.m | 18 -- .../include/dummy.h | 20 -- .../GrowingAutotracker-Wrapper/dummy.m | 18 -- .../include/dummy.h | 20 -- .../GrowingTracker-NoIDFA-Wrapper/dummy.m | 18 -- .../include/dummy.h | 20 -- SwiftPM-Wrap/GrowingTracker-Wrapper/dummy.m | 18 -- .../GrowingTracker-Wrapper/include/dummy.h | 20 -- 23 files changed, 15 insertions(+), 738 deletions(-) delete mode 100644 GrowingAutotracker/GrowingAutotracker.h delete mode 100644 GrowingAutotracker/GrowingAutotracker.m delete mode 100644 GrowingTracker/GrowingTracker.h delete mode 100644 GrowingTracker/GrowingTracker.m delete mode 100644 SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/dummy.m delete mode 100644 SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/include/dummy.h delete mode 100644 SwiftPM-Wrap/GrowingAutotracker-Wrapper/dummy.m delete mode 100644 SwiftPM-Wrap/GrowingAutotracker-Wrapper/include/dummy.h delete mode 100644 SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/dummy.m delete mode 100644 SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/include/dummy.h delete mode 100644 SwiftPM-Wrap/GrowingTracker-Wrapper/dummy.m delete mode 100644 SwiftPM-Wrap/GrowingTracker-Wrapper/include/dummy.h diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 4b2c3cc3d..6ca4fb16e 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -13,32 +13,9 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.osx.deployment_target = '10.12' s.ios.framework = 'WebKit' s.requires_arc = true - s.default_subspec = "Autotracker" + s.default_subspec = "TrackerCore" s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' } - s.subspec 'Autotracker' do |autotracker| - autotracker.ios.deployment_target = '9.0' - autotracker.source_files = 'GrowingAutotracker/**/*{.h,.m,.c,.cpp,.mm}' - autotracker.public_header_files = 'GrowingAutotracker/*.h' - autotracker.dependency 'GrowingAnalytics/AutotrackerCore', s.version.to_s - - # Modules - autotracker.ios.dependency 'GrowingAnalytics/Hybrid', s.version.to_s - autotracker.ios.dependency 'GrowingAnalytics/MobileDebugger', s.version.to_s - autotracker.ios.dependency 'GrowingAnalytics/WebCircle', s.version.to_s - autotracker.dependency 'GrowingAnalytics/DefaultServices', s.version.to_s - end - - s.subspec 'Tracker' do |tracker| - tracker.source_files = 'GrowingTracker/**/*{.h,.m,.c,.cpp,.mm}' - tracker.public_header_files = 'GrowingTracker/*.h' - tracker.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s - - # Modules - tracker.ios.dependency 'GrowingAnalytics/MobileDebugger', s.version.to_s - tracker.dependency 'GrowingAnalytics/DefaultServices', s.version.to_s - end - s.subspec 'TrackerCore' do |trackerCore| trackerCore.dependency 'GrowingUtils/TrackerCore', '0.0.5' trackerCore.source_files = 'GrowingTrackerCore/**/*{.h,.m,.c,.cpp,.mm}' diff --git a/GrowingAutotracker/GrowingAutotracker.h b/GrowingAutotracker/GrowingAutotracker.h deleted file mode 100644 index fabbb2a9b..000000000 --- a/GrowingAutotracker/GrowingAutotracker.h +++ /dev/null @@ -1,189 +0,0 @@ -// -// GrowingAutotracker.h -// GrowingAnalytics -// -// Created by xiangyang on 2020/11/6. -// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. -// -// 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 -#import "GrowingAttributesBuilder.h" -#import "GrowingAutotrackConfiguration.h" -#import "GrowingDynamicProxy.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface GrowingAutotracker : GrowingDynamicProxy - -///------------------------------- -#pragma mark Initialization -///------------------------------- - -/// 初始化方法 -/// @param configuration 配置信息 -/// @param launchOptions 启动参数 -+ (void)startWithConfiguration:(GrowingTrackConfiguration *)configuration launchOptions:(NSDictionary *)launchOptions; - -/// 单例获取 -+ (instancetype)sharedInstance; - -///------------------------------- -#pragma mark Configuration -///------------------------------- - -/// 打开或关闭数据采集 -/// @param enabled 打开或者关闭 -- (void)setDataCollectionEnabled:(BOOL)enabled; - -/// 当用户登录之后调用setLoginUserId API,设置登录用户ID。 -/// @param userId 用户ID -- (void)setLoginUserId:(NSString *)userId; - -/// 支持设置userId的类型, 存储方式与userId保持一致, userKey默认为null -/// @param userId 用户ID -/// @param userKey 用户ID对应的类型key值 -- (void)setLoginUserId:(NSString *)userId userKey:(NSString *)userKey; - -/// 当用户登出之后调用cleanLoginUserId,清除已经设置的登录用户ID。 -- (void)cleanLoginUserId; - -/// 设置经纬度坐标 -/// @param latitude 纬度 -/// @param longitude 经度 -- (void)setLocation:(double)latitude longitude:(double)longitude; - -/// 清除地理位置 -- (void)cleanLocation; - -/// 以登录用户的身份定义用户属性变量,用于用户信息相关分析。 -/// @param attributes 用户属性信息 -- (void)setLoginUserAttributes:(NSDictionary *)attributes; - -/// 同步获取设备id,又称为匿名用户id,SDK 自动生成用来定义唯一设备。 -- (NSString *)getDeviceId; - -///------------------------------- -#pragma mark Track Event -///------------------------------- - -/// 发送一个自定义事件 -/// @param eventName 自定义事件名称 -- (void)trackCustomEvent:(NSString *)eventName; - -/// 发送一个自定义事件 -/// @param eventName 自定义事件名称 -/// @param attributes 事件发生时所伴随的维度信息 -- (void)trackCustomEvent:(NSString *)eventName withAttributes:(NSDictionary *)attributes; - -/// 初始化事件计时器 -/// @param eventName 自定义事件名称 -/// @return 计时器唯一标识 -- (nullable NSString *)trackTimerStart:(NSString *)eventName; - -/// 暂停事件计时器 -/// @param timerId 计时器唯一标识 -- (void)trackTimerPause:(NSString *)timerId; - -/// 恢复事件计时器 -/// @param timerId 计时器唯一标识 -- (void)trackTimerResume:(NSString *)timerId; - -/// 停止事件计时器,并发送一个自定义事件 -/// @param timerId 计时器唯一标识 -- (void)trackTimerEnd:(NSString *)timerId; - -/// 停止事件计时器,并发送一个自定义事件 -/// @param timerId 计时器唯一标识 -/// @param attributes 事件发生时所伴随的维度信息 -- (void)trackTimerEnd:(NSString *)timerId withAttributes:(NSDictionary *)attributes; - -/// 删除事件计时器 -/// @param timerId 计时器唯一标识 -- (void)removeTimer:(NSString *)timerId; - -/// 清除所有事件计时器 -- (void)clearTrackTimer; - -/// 配置需要追踪页面浏览事件的页面Class,多次调用累加 -/// @param pages 页面Class数组 -- (void)appendAuotrackPages:(NSArray *)pages; - -///------------------------------- -#pragma mark Unavailable -///------------------------------- - -- (instancetype)init NS_UNAVAILABLE; - -@end - -// imp半自动打点 -@interface UIView (GrowingImpression) - -/** - 以下为元素展示打点事件 - 在元素展示前调用即可,GIO负责监听元素展示并触发事件 - 事件类型为自定义事件(cstm) - @param eventName 自定义事件名称 - */ -- (void)growingTrackImpression:(NSString *)eventName; - -/** - 以下为元素展示打点事件 - 在元素展示前调用即可,GIO负责监听元素展示并触发事件 - 事件类型为自定义事件(cstm) - @param eventName 自定义事件名称 - @param attributes 自定义属性 - */ -- (void)growingTrackImpression:(NSString *)eventName attributes:(NSDictionary *)attributes; - -// 停止该元素展示追踪 -// 通常应用于列表中的重用元素 -// 例如您只想追踪列表中的第一行元素的展示,但当第四行出现时重用了第一行的元素,此时您可调用此函数避免事件触发 -- (void)growingStopTrackImpression; - -@end - -// 该属性setter方法均使用 objc_setAssociatedObject实现 -// 如果是自定义的View建议优先使用重写getter方法来实现 以提高性能 -@interface UIView (GrowingAttributes) - -// 手动标识该view的忽略策略,请在该view被初始化后立刻赋值 -@property (nonatomic, assign) GrowingIgnorePolicy growingViewIgnorePolicy; - -// 手动标识该view的取值,请在该view被初始化后立刻赋值 -@property (nonatomic, copy) NSString *growingViewCustomContent; - -// 手动标识该view的tag -// 这个tag必须是全局唯一的,在代码结构改变时也请保持不变 -@property (nonatomic, copy) NSString *growingUniqueTag; - -@end - -// 该属性setter方法均使用 objc_setAssociatedObject实现 -// 如果是自定义的UIViewController不要使用重写getter方法来实现,因为SDK在set方法内部有逻辑处理 -@interface UIViewController (GrowingAttributes) - -- (void)autotrackPage:(NSString *)alias attributes:(NSDictionary *)attributes; - -// 是否追踪该页面的浏览事件 -@property (nonatomic, assign) BOOL growingAutotrackEnabled; - -// 手动标识该页面的标题,必须在该UIViewController显示之前设置 -@property (nonatomic, copy) NSString *growingPageAlias; - -@property (nonatomic, copy) NSDictionary *growingPageAttributes; - -@end - -NS_ASSUME_NONNULL_END diff --git a/GrowingAutotracker/GrowingAutotracker.m b/GrowingAutotracker/GrowingAutotracker.m deleted file mode 100644 index cdf590fb9..000000000 --- a/GrowingAutotracker/GrowingAutotracker.m +++ /dev/null @@ -1,74 +0,0 @@ -// -// GrowingAutotracker.m -// GrowingAnalytics -// -// Created by xiangyang on 2020/11/6. -// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. -// -// 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 "GrowingAutotracker/GrowingAutotracker.h" -#import "GrowingAutotrackerCore/GrowingRealAutotracker.h" -#import "GrowingTrackerCore/Manager/GrowingSession.h" -#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogMacros.h" -#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" - -static GrowingAutotracker *sharedInstance = nil; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wincomplete-implementation" - -@implementation GrowingAutotracker -- (instancetype)initWithRealAutotracker:(GrowingRealAutotracker *)realAutotracker { - self = [super initWithTarget:realAutotracker]; - return self; -} - -+ (void)startWithConfiguration:(GrowingTrackConfiguration *)configuration launchOptions:(NSDictionary *)launchOptions { - if (![NSThread isMainThread]) { - @throw [NSException - exceptionWithName:@"初始化异常" - reason:@"请在applicationDidFinishLaunching中调用startWithConfiguration函数,并且确保在主线程中" - userInfo:nil]; - } - - if (!configuration.projectId.length) { - @throw [NSException exceptionWithName:@"初始化异常" reason:@"ProjectId不能为空" userInfo:nil]; - } - - if (!configuration.dataSourceId.length) { - @throw [NSException exceptionWithName:@"初始化异常" reason:@"dataSourceId不能为空" userInfo:nil]; - } - - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - GrowingRealAutotracker *autotracker = [GrowingRealAutotracker trackerWithConfiguration:configuration - launchOptions:launchOptions]; - sharedInstance = [[self alloc] initWithRealAutotracker:autotracker]; - [[GrowingSession currentSession] generateVisit]; - }); -} - -+ (instancetype)sharedInstance { - if (!sharedInstance) { - @throw [NSException - exceptionWithName:@"GrowingAutotracker未初始化" - reason:@"请在applicationDidFinishLaunching中调用startWithConfiguration函数,并且确保在主线程中" - userInfo:nil]; - } - return sharedInstance; -} - -@end - -#pragma clang diagnostic pop diff --git a/GrowingAutotrackerCore/Autotrack/UIViewController+GrowingAutotracker.m b/GrowingAutotrackerCore/Autotrack/UIViewController+GrowingAutotracker.m index 91b2a7fad..503f062af 100644 --- a/GrowingAutotrackerCore/Autotrack/UIViewController+GrowingAutotracker.m +++ b/GrowingAutotrackerCore/Autotrack/UIViewController+GrowingAutotracker.m @@ -27,7 +27,6 @@ #import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h" #import "GrowingULViewControllerLifecycle.h" -static char kGrowingPageAutotrackEnabledKey; static char kGrowingPageObjectKey; static char kGrowingPageAttributesKey; diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingViewChangeProvider.m b/GrowingAutotrackerCore/GrowingNode/GrowingViewChangeProvider.m index 1b9bbba88..485b3a12a 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingViewChangeProvider.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingViewChangeProvider.m @@ -42,7 +42,7 @@ + (void)viewOnChange:(UIView *)view { NSString *pagexindex = pathInfo[@"xindex"]; GrowingViewElementBuilder *builder = GrowingViewElementEvent.builder.setEventType(GrowingEventTypeViewChange) .setPath(@"") - .setXpath([NSString stringWithFormat:@"%@%@", pagexpath, node.xPath]) + .setXpath([NSString stringWithFormat:@"%@%@", pagexpath, node.xpath]) .setXindex([NSString stringWithFormat:@"%@%@", pagexindex, node.xindex]) .setIndex(node.index) .setTextValue(node.viewContent); diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.m b/GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.m index f91e155f8..413373ca0 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.m @@ -43,7 +43,7 @@ + (void)viewOnClick:(UIView *)view { NSString *pagexindex = pathInfo[@"xindex"]; GrowingViewElementBuilder *builder = GrowingViewElementEvent.builder.setEventType(GrowingEventTypeViewClick) .setPath(@"") - .setXpath([NSString stringWithFormat:@"%@%@", pagexpath, node.xPath]) + .setXpath([NSString stringWithFormat:@"%@%@", pagexpath, node.xpath]) .setXindex([NSString stringWithFormat:@"%@%@", pagexindex, node.xindex]) .setIndex(node.index) .setTextValue(node.viewContent); diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.h b/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.h index f290419e8..cec11c5b6 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.h +++ b/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.h @@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, weak, readonly) UIView *_Nullable view; @property (nonatomic, copy, readonly) NSString *_Nullable viewContent; -@property (nonatomic, copy, readonly) NSString *_Nonnull xPath; +@property (nonatomic, copy, readonly) NSString *_Nonnull xpath; @property (nonatomic, copy, readonly) NSString *_Nonnull xindex; // 原始的位置组 @property (nonatomic, copy, readonly) NSString *_Nonnull originxindex; @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, readonly) UIView *_Nullable view; @property (nonatomic, copy, readonly) NSString *_Nullable viewContent; -@property (nonatomic, copy, readonly) NSString *_Nonnull xPath; +@property (nonatomic, copy, readonly) NSString *_Nonnull xpath; @property (nonatomic, copy, readonly) NSString *_Nonnull xindex; // 原始的位置组 @property (nonatomic, copy, readonly) NSString *_Nonnull originxindex; diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.m b/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.m index 8037f64bc..87caa8fce 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingViewNode.m @@ -27,7 +27,7 @@ @interface GrowingViewNode () -@property (nonatomic, copy, readwrite) NSString *_Nonnull xPath; +@property (nonatomic, copy, readwrite) NSString *_Nonnull xpath; @property (nonatomic, copy, readwrite) NSString *_Nonnull xindex; @property (nonatomic, copy, readwrite) NSString *_Nonnull originxindex; @@ -39,7 +39,7 @@ - (instancetype)initWithBuilder:(GrowingViewNodeBuilder *)builder { if (self = [super init]) { _view = builder.view; _viewContent = builder.viewContent; - _xPath = builder.xPath; + _xpath = builder.xpath; _xindex = builder.xindex; _originxindex = builder.originxindex; _clickableParentXpath = builder.clickableParentXpath; @@ -62,7 +62,7 @@ - (void)recalculate { recalculateXpath:self.view block:^(NSString *_Nonnull xpath, NSString *_Nonnull xindex, NSString *_Nonnull originxindex) { __strong typeof(weakSelf) self = weakSelf; - self.xPath = xpath; + self.xpath = xpath; self.xindex = xindex; self.originxindex = originxindex; }]; @@ -78,7 +78,7 @@ - (GrowingViewNode *)appendNode:(UIView *)view isRecalculate:(BOOL)recalculate { if (!subpath) { return GrowingViewNode.builder.setView(view) .setIndex(self.index) - .setXpath(self.xPath) + .setXpath(self.xpath) .setXindex(self.xindex) .setOriginXindex(self.originxindex) .setClickableParentXpath(self.clickableParentXpath) @@ -103,12 +103,12 @@ - (GrowingViewNode *)appendNode:(UIView *)view isRecalculate:(BOOL)recalculate { index = self.index; } - NSString *parentXpath = self.view.growingNodeUserInteraction ? self.xPath : self.clickableParentXpath; + NSString *parentXpath = self.view.growingNodeUserInteraction ? self.xpath : self.clickableParentXpath; NSString *content = view.growingNodeContent; return GrowingViewNode.builder.setView(view) .setIndex((int)index) - .setXpath([self.xPath stringByAppendingFormat:@"/%@", view.growingNodeSubPath]) + .setXpath([self.xpath stringByAppendingFormat:@"/%@", view.growingNodeSubPath]) .setXindex([self.originxindex stringByAppendingFormat:@"/%@", view.growingNodeSubSimilarIndex]) .setOriginXindex([self.originxindex stringByAppendingFormat:@"/%@", view.growingNodeSubIndex]) .setClickableParentXpath(parentXpath) @@ -133,7 +133,7 @@ @implementation GrowingViewNodeBuilder - (GrowingViewNodeBuilder * (^)(NSString *value))setXpath { return ^(NSString *value) { - self->_xPath = value; + self->_xpath = value; return self; }; } diff --git a/GrowingTracker/GrowingTracker.h b/GrowingTracker/GrowingTracker.h deleted file mode 100644 index 8361d1a9b..000000000 --- a/GrowingTracker/GrowingTracker.h +++ /dev/null @@ -1,125 +0,0 @@ -// -// GrowingTracker.h -// GrowingAnalytics -// -// Created by xiangyang on 2020/11/6. -// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. -// -// 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 "GrowingAttributesBuilder.h" -#import "GrowingDynamicProxy.h" -#import "GrowingTrackConfiguration.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface GrowingTracker : GrowingDynamicProxy - -///------------------------------- -#pragma mark Initialization -///------------------------------- - -/// 初始化方法 -/// @param configuration 配置信息 -/// @param launchOptions 启动参数 -+ (void)startWithConfiguration:(GrowingTrackConfiguration *)configuration launchOptions:(NSDictionary *)launchOptions; - -/// 单例获取 -+ (instancetype)sharedInstance; - -///------------------------------- -#pragma mark Configuration -///------------------------------- - -/// 打开或关闭数据采集 -/// @param enabled 打开或者关闭 -- (void)setDataCollectionEnabled:(BOOL)enabled; - -/// 当用户登录之后调用setLoginUserId API,设置登录用户ID。 -/// @param userId 用户ID -- (void)setLoginUserId:(NSString *)userId; - -/// 支持设置userId的类型, 存储方式与userId保持一致, userKey默认为null -/// @param userId 用户ID -/// @param userKey 用户ID对应的类型key值 -- (void)setLoginUserId:(NSString *)userId userKey:(NSString *)userKey; - -/// 当用户登出之后调用cleanLoginUserId,清除已经设置的登录用户ID。 -- (void)cleanLoginUserId; - -/// 设置经纬度坐标 -/// @param latitude 纬度 -/// @param longitude 经度 -- (void)setLocation:(double)latitude longitude:(double)longitude; - -/// 清除地理位置 -- (void)cleanLocation; - -/// 以登录用户的身份定义用户属性变量,用于用户信息相关分析。 -/// @param attributes 用户属性信息 -- (void)setLoginUserAttributes:(NSDictionary *)attributes; - -/// 同步获取设备id,又称为匿名用户id,SDK 自动生成用来定义唯一设备。 -- (NSString *)getDeviceId; - -///------------------------------- -#pragma mark Track Event -///------------------------------- - -/// 发送一个自定义事件 -/// @param eventName 自定义事件名称 -- (void)trackCustomEvent:(NSString *)eventName; - -/// 发送一个自定义事件 -/// @param eventName 自定义事件名称 -/// @param attributes 事件发生时所伴随的维度信息 -- (void)trackCustomEvent:(NSString *)eventName withAttributes:(NSDictionary *)attributes; - -/// 初始化事件计时器 -/// @param eventName 自定义事件名称 -/// @return 计时器唯一标识 -- (nullable NSString *)trackTimerStart:(NSString *)eventName; - -/// 暂停事件计时器 -/// @param timerId 计时器唯一标识 -- (void)trackTimerPause:(NSString *)timerId; - -/// 恢复事件计时器 -/// @param timerId 计时器唯一标识 -- (void)trackTimerResume:(NSString *)timerId; - -/// 停止事件计时器,并发送一个自定义事件 -/// @param timerId 计时器唯一标识 -- (void)trackTimerEnd:(NSString *)timerId; - -/// 停止事件计时器,并发送一个自定义事件 -/// @param timerId 计时器唯一标识 -/// @param attributes 事件发生时所伴随的维度信息 -- (void)trackTimerEnd:(NSString *)timerId withAttributes:(NSDictionary *)attributes; - -/// 删除事件计时器 -/// @param timerId 计时器唯一标识 -- (void)removeTimer:(NSString *)timerId; - -/// 清除所有事件计时器 -- (void)clearTrackTimer; - -///------------------------------- -#pragma mark Unavailable -///------------------------------- - -- (instancetype)init NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/GrowingTracker/GrowingTracker.m b/GrowingTracker/GrowingTracker.m deleted file mode 100644 index 7b9a65885..000000000 --- a/GrowingTracker/GrowingTracker.m +++ /dev/null @@ -1,74 +0,0 @@ -// -// GrowingTracker.m -// GrowingAnalytics -// -// Created by xiangyang on 2020/11/6. -// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. -// -// 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 "GrowingTracker/GrowingTracker.h" -#import "GrowingTrackerCore/GrowingRealTracker.h" -#import "GrowingTrackerCore/Manager/GrowingSession.h" -#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogMacros.h" -#import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" - -static GrowingTracker *sharedInstance = nil; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wincomplete-implementation" - -@implementation GrowingTracker -- (instancetype)initWithRealTracker:(GrowingRealTracker *)realTracker { - self = [super initWithTarget:realTracker]; - return self; -} - -+ (void)startWithConfiguration:(GrowingTrackConfiguration *)configuration launchOptions:(NSDictionary *)launchOptions { - if (![NSThread isMainThread]) { - @throw [NSException - exceptionWithName:@"初始化异常" - reason:@"请在applicationDidFinishLaunching中调用startWithConfiguration函数,并且确保在主线程中" - userInfo:nil]; - } - - if (!configuration.projectId.length) { - @throw [NSException exceptionWithName:@"初始化异常" reason:@"ProjectId不能为空" userInfo:nil]; - } - - if (!configuration.dataSourceId.length) { - @throw [NSException exceptionWithName:@"初始化异常" reason:@"dataSourceId不能为空" userInfo:nil]; - } - - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - GrowingRealTracker *realTracker = [GrowingRealTracker trackerWithConfiguration:configuration - launchOptions:launchOptions]; - sharedInstance = [[self alloc] initWithRealTracker:realTracker]; - [[GrowingSession currentSession] generateVisit]; - }); -} - -+ (instancetype)sharedInstance { - if (!sharedInstance) { - @throw [NSException - exceptionWithName:@"GrowingTracker未初始化" - reason:@"请在applicationDidFinishLaunching中调用startWithConfiguration函数,并且确保在主线程中" - userInfo:nil]; - } - return sharedInstance; -} - -@end - -#pragma clang diagnostic pop diff --git a/Modules/Flutter/GrowingFlutterPlugin.m b/Modules/Flutter/GrowingFlutterPlugin.m index fea19febe..b032dcc84 100644 --- a/Modules/Flutter/GrowingFlutterPlugin.m +++ b/Modules/Flutter/GrowingFlutterPlugin.m @@ -89,14 +89,9 @@ - (void)trackViewElementEvent:(NSDictionary *)arguments { if (!path || ![path isKindOfClass:[NSString class]] || path.length == 0) { return; } - NSNumber *ptm = arguments[@"pageShowTimestamp"]; - if (!ptm || ![ptm isKindOfClass:[NSNumber class]]) { - return; - } GrowingViewElementBuilder *builder = - GrowingViewElementEvent.builder.setEventType(eventType).setXpath(xpath).setPath(path).setPageShowTimestamp( - ptm.longLongValue); + GrowingViewElementEvent.builder.setEventType(eventType).setXpath(xpath).setPath(path); NSString *viewContent = arguments[@"textValue"]; if (viewContent && [viewContent isKindOfClass:[NSString class]] && viewContent.length > 0) { builder = builder.setTextValue(viewContent); diff --git a/Modules/SwiftProtobuf/SwiftProtobuf.swift b/Modules/SwiftProtobuf/SwiftProtobuf.swift index f6288b771..8a3f6ed6b 100644 --- a/Modules/SwiftProtobuf/SwiftProtobuf.swift +++ b/Modules/SwiftProtobuf/SwiftProtobuf.swift @@ -96,7 +96,6 @@ extension GrowingBaseEvent { var dto = EventV3Dto() dto.dataSourceID = self.dataSourceId ?? "" - dto.gioID = self.gioId ?? "" dto.sessionID = self.sessionId ?? "" dto.timestamp = self.timestamp dto.domain = self.domain @@ -104,7 +103,6 @@ extension GrowingBaseEvent { dto.deviceID = self.deviceId dto.platform = self.platform dto.platformVersion = self.platformVersion - dto.globalSequenceID = self.globalSequenceId dto.eventSequenceID = Int32(self.eventSequenceId) dto.appState = self.appState == GrowingAppState.foreground.rawValue ? "FOREGROUND" : "BACKGROUND" dto.urlScheme = self.urlScheme diff --git a/Modules/WebCircle/GrowingWebCircle.m b/Modules/WebCircle/GrowingWebCircle.m index 704effc0a..afbfd1090 100644 --- a/Modules/WebCircle/GrowingWebCircle.m +++ b/Modules/WebCircle/GrowingWebCircle.m @@ -156,7 +156,7 @@ - (NSMutableDictionary *)dictFromNode:(GrowingViewNode *)node { .setContent(node.viewContent) .setZLevel(self.zLevel++) .setIndex(node.index) - .setXpath(node.xPath) + .setXpath(node.xpath) .setParentXpath(node.clickableParentXpath) .setNodeType(node.nodeType) .setPage(page.alias) diff --git a/Package.swift b/Package.swift index a1318795a..2355d068f 100644 --- a/Package.swift +++ b/Package.swift @@ -34,14 +34,6 @@ let package = Package( name: "GrowingTracker_cdp", targets: ["GrowingTracker_cdp_Wrapper"] ), - .library( - name: "GrowingAutotracker", - targets: ["GrowingAutotracker_Wrapper"] - ), - .library( - name: "GrowingTracker", - targets: ["GrowingTracker_Wrapper"] - ), .library( name: "GrowingAutotracker_cdp_NoIDFA", targets: ["GrowingAutotracker_cdp_NoIDFA_Wrapper"] @@ -50,14 +42,6 @@ let package = Package( name: "GrowingTracker_cdp_NoIDFA", targets: ["GrowingTracker_cdp_NoIDFA_Wrapper"] ), - .library( - name: "GrowingAutotracker_NoIDFA", - targets: ["GrowingAutotracker_NoIDFA_Wrapper"] - ), - .library( - name: "GrowingTracker_NoIDFA", - targets: ["GrowingTracker_NoIDFA_Wrapper"] - ), .library( name: "GrowingModule_Hybrid", targets: ["GrowingModule_Hybrid"] @@ -115,28 +99,6 @@ let package = Package( ], path: "SwiftPM-Wrap/GrowingTracker-cdp-Wrapper" ), - .target( - name: "GrowingAutotracker_Wrapper", - dependencies: [ - "GrowingAutotracker", - "GrowingUserIdentifier", - "GrowingModule_DefaultServices", - .target(name: "GrowingModule_Hybrid", condition: .when(platforms: [.iOS, .macCatalyst])), - .target(name: "GrowingModule_MobileDebugger", condition: .when(platforms: [.iOS])), - .target(name: "GrowingModule_WebCircle", condition: .when(platforms: [.iOS])) - ], - path: "SwiftPM-Wrap/GrowingAutotracker-Wrapper" - ), - .target( - name: "GrowingTracker_Wrapper", - dependencies: [ - "GrowingTracker", - "GrowingUserIdentifier", - "GrowingModule_DefaultServices", - .target(name: "GrowingModule_MobileDebugger", condition: .when(platforms: [.iOS])) - ], - path: "SwiftPM-Wrap/GrowingTracker-Wrapper" - ), // MARK: - GrowingAnalytics Public API @@ -160,24 +122,6 @@ let package = Package( .headerSearchPath("..") ] ), - .target( - name: "GrowingAutotracker", - dependencies: ["GrowingAutotrackerCore"], - path: "GrowingAutotracker", - publicHeadersPath: ".", - cSettings: [ - .headerSearchPath("..") - ] - ), - .target( - name: "GrowingTracker", - dependencies: ["GrowingTrackerCore"], - path: "GrowingTracker", - publicHeadersPath: ".", - cSettings: [ - .headerSearchPath("..") - ] - ), // MARK: - GrowingAnalytics Core @@ -399,28 +343,6 @@ let package = Package( .target(name: "GrowingModule_MobileDebugger", condition: .when(platforms: [.iOS])) ], path: "SwiftPM-Wrap/GrowingTracker-cdp-NoIDFA-Wrapper" - ), - .target( - name: "GrowingAutotracker_NoIDFA_Wrapper", - dependencies: [ - "GrowingAutotracker", - "GrowingUserIdentifier_NoIDFA", - "GrowingModule_DefaultServices", - .target(name: "GrowingModule_Hybrid", condition: .when(platforms: [.iOS, .macCatalyst])), - .target(name: "GrowingModule_MobileDebugger", condition: .when(platforms: [.iOS])), - .target(name: "GrowingModule_WebCircle", condition: .when(platforms: [.iOS])) - ], - path: "SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper" - ), - .target( - name: "GrowingTracker_NoIDFA_Wrapper", - dependencies: [ - "GrowingTracker", - "GrowingUserIdentifier_NoIDFA", - "GrowingModule_DefaultServices", - .target(name: "GrowingModule_MobileDebugger", condition: .when(platforms: [.iOS])) - ], - path: "SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper" ) ] ) diff --git a/Podfile.lock b/Podfile.lock index 12b55dc03..5035dba67 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -130,7 +130,7 @@ EXTERNAL SOURCES: :path: "./" SPEC CHECKSUMS: - GrowingAnalytics: 9c4c3c7e33523f3daba012a06f0f419b77e02544 + GrowingAnalytics: b3927869a67c7059939726f260f8fbc25dd55b34 GrowingAnalytics-cdp: 273939219903d141466237a703700cfb6bb0b689 GrowingAPM: 79fe4f4a12d94432fa4a552d56c41940ea13961a GrowingToolsKit: 88b144e858f8895f1d84c518642ce34ce0f5aa07 diff --git a/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/dummy.m b/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/dummy.m deleted file mode 100644 index c675faf71..000000000 --- a/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/dummy.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. diff --git a/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/include/dummy.h b/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/include/dummy.h deleted file mode 100644 index 71bfa56a9..000000000 --- a/SwiftPM-Wrap/GrowingAutotracker-NoIDFA-Wrapper/include/dummy.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. - -// Prevent a missing umbrella header warning. diff --git a/SwiftPM-Wrap/GrowingAutotracker-Wrapper/dummy.m b/SwiftPM-Wrap/GrowingAutotracker-Wrapper/dummy.m deleted file mode 100644 index c675faf71..000000000 --- a/SwiftPM-Wrap/GrowingAutotracker-Wrapper/dummy.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. diff --git a/SwiftPM-Wrap/GrowingAutotracker-Wrapper/include/dummy.h b/SwiftPM-Wrap/GrowingAutotracker-Wrapper/include/dummy.h deleted file mode 100644 index 71bfa56a9..000000000 --- a/SwiftPM-Wrap/GrowingAutotracker-Wrapper/include/dummy.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. - -// Prevent a missing umbrella header warning. diff --git a/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/dummy.m b/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/dummy.m deleted file mode 100644 index c675faf71..000000000 --- a/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/dummy.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. diff --git a/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/include/dummy.h b/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/include/dummy.h deleted file mode 100644 index 71bfa56a9..000000000 --- a/SwiftPM-Wrap/GrowingTracker-NoIDFA-Wrapper/include/dummy.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. - -// Prevent a missing umbrella header warning. diff --git a/SwiftPM-Wrap/GrowingTracker-Wrapper/dummy.m b/SwiftPM-Wrap/GrowingTracker-Wrapper/dummy.m deleted file mode 100644 index c675faf71..000000000 --- a/SwiftPM-Wrap/GrowingTracker-Wrapper/dummy.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. diff --git a/SwiftPM-Wrap/GrowingTracker-Wrapper/include/dummy.h b/SwiftPM-Wrap/GrowingTracker-Wrapper/include/dummy.h deleted file mode 100644 index 71bfa56a9..000000000 --- a/SwiftPM-Wrap/GrowingTracker-Wrapper/include/dummy.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// dummy.h -// GrowingAnalytics -// -// Created by YoloMao on 2022/3/28. -// Copyright (C) 2022 Beijing Yishu Technology Co., Ltd. -// -// 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. - -// Prevent a missing umbrella header warning.