先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
120 lines
2.8 KiB
Objective-C
120 lines
2.8 KiB
Objective-C
#import "ThinkingAnalyticsSDKPrivate.h"
|
|
#import "TDLogging.h"
|
|
|
|
@implementation LightThinkingAnalyticsSDK
|
|
|
|
- (instancetype)initWithAPPID:(NSString *)appID withServerURL:(NSString *)serverURL withConfig:(TDConfig *)config {
|
|
if (self = [self initLight:appID withServerURL:serverURL withConfig:config]) {
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)login:(NSString *)accountId {
|
|
if ([self hasDisabled])
|
|
return;
|
|
|
|
if (![accountId isKindOfClass:[NSString class]] || accountId.length == 0) {
|
|
TDLogError(@"accountId invald", accountId);
|
|
return;
|
|
}
|
|
|
|
@synchronized (self.accountId) {
|
|
self.accountId = accountId;
|
|
}
|
|
}
|
|
|
|
- (void)logout {
|
|
if ([self hasDisabled])
|
|
return;
|
|
|
|
@synchronized (self.accountId) {
|
|
self.accountId = nil;
|
|
};
|
|
}
|
|
|
|
- (void)identify:(NSString *)distinctId {
|
|
if ([self hasDisabled])
|
|
return;
|
|
|
|
if (![distinctId isKindOfClass:[NSString class]] || distinctId.length == 0) {
|
|
TDLogError(@"identify cannot null");
|
|
return;
|
|
}
|
|
|
|
@synchronized (self.identifyId) {
|
|
self.identifyId = distinctId;
|
|
};
|
|
}
|
|
|
|
- (NSString *)getDistinctId {
|
|
return [self.identifyId copy];
|
|
}
|
|
|
|
- (void)enableAutoTrack:(ThinkingAnalyticsAutoTrackEventType)eventType {
|
|
return;
|
|
}
|
|
|
|
- (void)flush {
|
|
return;
|
|
}
|
|
|
|
#pragma mark - EnableTracking
|
|
- (void)enableTracking:(BOOL)enabled {
|
|
TDLogDebug(@"%@light instance: enableTracking...", self);
|
|
self.isEnabled = enabled;
|
|
}
|
|
|
|
- (void)optOutTracking {
|
|
TDLogDebug(@"%@light instance: optOutTracking...", self);
|
|
self.isEnabled = NO;
|
|
}
|
|
|
|
- (void)optOutTrackingAndDeleteUser {
|
|
TDLogDebug(@"%@light instance: optOutTrackingAndDeleteUser...", self);
|
|
self.isEnabled = NO;
|
|
}
|
|
|
|
- (void)optInTracking {
|
|
TDLogDebug(@"%@light instance: optInTracking...", self);
|
|
self.isEnabled = YES;
|
|
}
|
|
|
|
|
|
|
|
- (void)setTrackStatus: (TATrackStatus)status {
|
|
switch (status) {
|
|
|
|
case TATrackStatusPause: {
|
|
TDLogDebug(@"%@light instance - switchTrackStatus: TATrackStatusStop...", self);
|
|
self.isEnabled = NO;
|
|
break;
|
|
}
|
|
|
|
case TATrackStatusStop: {
|
|
TDLogDebug(@"%@light instance - switchTrackStatus: TATrackStatusStopAndClean...", self);
|
|
self.isEnabled = NO;
|
|
break;
|
|
}
|
|
|
|
case TATrackStatusSaveOnly: {
|
|
TDLogDebug(@"%@light instance - switchTrackStatus: TATrackStatusPausePost...", self);
|
|
self.trackPause = YES;
|
|
break;
|
|
}
|
|
|
|
case TATrackStatusNormal: {
|
|
TDLogDebug(@"%@light instance - switchTrackStatus: TATrackStatusRestartAll...", self);
|
|
self.trackPause = NO;
|
|
self.isEnabled = YES;
|
|
[self flush];
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
@end
|