Ta android + ios
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b1919f01f251cc41860bb9f3da62aa9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TABaseEvent+H5.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/19.
|
||||
//
|
||||
|
||||
#import "TABaseEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TABaseEvent (H5)
|
||||
@property (nonatomic, copy) NSString *h5TimeString;
|
||||
@property (nonatomic, strong) NSNumber *h5ZoneOffSet;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f11317a372fa3bb43a976f24b4df418b
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// TABaseEvent+H5.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/19.
|
||||
//
|
||||
|
||||
#import "TABaseEvent+H5.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
static char TA_EVENT_H5_TIME_STRING;
|
||||
static char TA_EVENT_H5_ZONE_OFF_SET;
|
||||
|
||||
@implementation TABaseEvent (H5)
|
||||
|
||||
- (NSString *)h5TimeString {
|
||||
return objc_getAssociatedObject(self, &TA_EVENT_H5_TIME_STRING);
|
||||
}
|
||||
|
||||
- (void)setH5TimeString:(NSString *)h5TimeString {
|
||||
objc_setAssociatedObject(self, &TA_EVENT_H5_TIME_STRING, h5TimeString, OBJC_ASSOCIATION_COPY_NONATOMIC);
|
||||
}
|
||||
|
||||
- (NSNumber *)h5ZoneOffSet {
|
||||
return objc_getAssociatedObject(self, &TA_EVENT_H5_ZONE_OFF_SET);
|
||||
}
|
||||
|
||||
- (void)setH5ZoneOffSet:(NSNumber *)h5ZoneOffSet {
|
||||
objc_setAssociatedObject(self, &TA_EVENT_H5_ZONE_OFF_SET, h5ZoneOffSet, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f174d52f029e3624d9eccdf142c3384f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// TABaseEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "TAPropertyValidator.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NSString * kTAEventType;
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, TAEventType) {
|
||||
TAEventTypeNone = 0,
|
||||
TAEventTypeTrack = 1 << 0,
|
||||
TAEventTypeTrackFirst = 1 << 1,
|
||||
TAEventTypeTrackUpdate = 1 << 2,
|
||||
TAEventTypeTrackOverwrite = 1 << 3,
|
||||
TAEventTypeUserSet = 1 << 4,
|
||||
TAEventTypeUserUnset = 1 << 5,
|
||||
TAEventTypeUserAdd = 1 << 6,
|
||||
TAEventTypeUserDel = 1 << 7,
|
||||
TAEventTypeUserSetOnce = 1 << 8,
|
||||
TAEventTypeUserAppend = 1 << 9,
|
||||
TAEventTypeUserUniqueAppend = 1 << 10,
|
||||
TAEventTypeAll = 0xFFFFFFFF,
|
||||
};
|
||||
|
||||
//extern kTAEventType const kTAEventTypeTrack;
|
||||
//extern kTAEventType const kTAEventTypeTrackFirst;
|
||||
//extern kTAEventType const kTAEventTypeTrackUpdate;
|
||||
//extern kTAEventType const kTAEventTypeTrackOverwrite;
|
||||
//extern kTAEventType const kTAEventTypeUserSet;
|
||||
//extern kTAEventType const kTAEventTypeUserUnset;
|
||||
//extern kTAEventType const kTAEventTypeUserAdd;
|
||||
//extern kTAEventType const kTAEventTypeUserDel;
|
||||
//extern kTAEventType const kTAEventTypeUserSetOnce;
|
||||
//extern kTAEventType const kTAEventTypeUserAppend;
|
||||
//extern kTAEventType const kTAEventTypeUserUniqueAppend;
|
||||
|
||||
typedef NS_OPTIONS(NSInteger, TAEventTimeValueType) {
|
||||
TAEventTimeValueTypeNone = 0,
|
||||
TAEventTimeValueTypeTimeOnly = 1 << 0,
|
||||
TAEventTimeValueTypeTimeAndZone = 1 << 1,
|
||||
};
|
||||
|
||||
@interface TABaseEvent : NSObject<TAEventPropertyValidating>
|
||||
@property (nonatomic, assign) TAEventType eventType;
|
||||
@property (nonatomic, copy) NSString *uuid;
|
||||
@property (nonatomic, copy) NSString *accountId;
|
||||
@property (nonatomic, copy) NSString *distinctId;
|
||||
@property (nonatomic, strong) NSDate *time;
|
||||
@property (nonatomic, strong) NSTimeZone *timeZone;
|
||||
@property (nonatomic, strong, readonly) NSDateFormatter *timeFormatter;
|
||||
|
||||
@property (nonatomic, assign) TAEventTimeValueType timeValueType;
|
||||
@property (nonatomic, strong) NSMutableDictionary *properties;
|
||||
|
||||
@property (nonatomic, assign) BOOL immediately;
|
||||
|
||||
@property (atomic, assign, getter=isTrackPause) BOOL trackPause;
|
||||
|
||||
@property (nonatomic, assign) BOOL isEnabled;
|
||||
|
||||
@property (atomic, assign) BOOL isOptOut;
|
||||
|
||||
- (instancetype)initWithType:(TAEventType)type;
|
||||
|
||||
- (void)validateWithError:(NSError **)error;
|
||||
|
||||
- (NSMutableDictionary *)jsonObject;
|
||||
|
||||
- (NSMutableDictionary *)formatDateWithDict:(NSDictionary *)dict;
|
||||
|
||||
- (NSString *)eventTypeString;
|
||||
|
||||
+ (TAEventType)typeWithTypeString:(NSString *)typeString;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3420f9b2d086c2546b50b97d7dff67c7
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,215 @@
|
||||
//
|
||||
// TABaseEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TABaseEvent.h"
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDLogging.h>)
|
||||
#import <ThinkingSDK/TDLogging.h>
|
||||
#else
|
||||
#import "TDLogging.h"
|
||||
#endif
|
||||
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
kTAEventType const kTAEventTypeTrack = @"track";
|
||||
kTAEventType const kTAEventTypeTrackFirst = @"track_first";
|
||||
kTAEventType const kTAEventTypeTrackUpdate = @"track_update";
|
||||
kTAEventType const kTAEventTypeTrackOverwrite = @"track_overwrite";
|
||||
kTAEventType const kTAEventTypeUserSet = @"user_set";
|
||||
kTAEventType const kTAEventTypeUserUnset = @"user_unset";
|
||||
kTAEventType const kTAEventTypeUserAdd = @"user_add";
|
||||
kTAEventType const kTAEventTypeUserDel = @"user_del";
|
||||
kTAEventType const kTAEventTypeUserSetOnce = @"user_setOnce";
|
||||
kTAEventType const kTAEventTypeUserAppend = @"user_append";
|
||||
kTAEventType const kTAEventTypeUserUniqueAppend = @"user_uniq_append";
|
||||
|
||||
@interface TABaseEvent ()
|
||||
@property (nonatomic, strong) NSDateFormatter *timeFormatter;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TABaseEvent
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
|
||||
_time = [NSDate date];
|
||||
self.timeValueType = TAEventTimeValueTypeNone;
|
||||
self.uuid = [NSUUID UUID].UUIDString;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithType:(TAEventType)type {
|
||||
if (self = [self init]) {
|
||||
self.eventType = type;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)jsonObject {
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
dict[@"#time"] = self.time;
|
||||
dict[@"#uuid"] = self.uuid;
|
||||
dict[@"#type"] = [self eventTypeString];
|
||||
if (self.accountId) {
|
||||
dict[@"#account_id"] = self.accountId;
|
||||
}
|
||||
if (self.distinctId) {
|
||||
dict[@"#distinct_id"] = self.distinctId;
|
||||
}
|
||||
dict[@"properties"] = self.properties;
|
||||
return dict;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)formatDateWithDict:(NSDictionary *)dict {
|
||||
if (dict == nil || ![dict isKindOfClass:NSDictionary.class]) {
|
||||
return nil;
|
||||
}
|
||||
NSMutableDictionary *mutableDict = nil;
|
||||
if ([dict isKindOfClass:NSMutableDictionary.class]) {
|
||||
mutableDict = (NSMutableDictionary *)dict;
|
||||
} else {
|
||||
mutableDict = [dict mutableCopy];
|
||||
}
|
||||
|
||||
NSArray<NSString *> *keys = dict.allKeys;
|
||||
for (NSInteger i = 0; i < keys.count; i++) {
|
||||
id value = dict[keys[i]];
|
||||
if ([value isKindOfClass:NSDate.class]) {
|
||||
NSString *newValue = [self.timeFormatter stringFromDate:(NSDate *)value];
|
||||
mutableDict[keys[i]] = newValue;
|
||||
} else if ([value isKindOfClass:NSDictionary.class]) {
|
||||
NSDictionary *newValue = [self formatDateWithDict:value];
|
||||
mutableDict[keys[i]] = newValue;
|
||||
}
|
||||
}
|
||||
return mutableDict;
|
||||
}
|
||||
|
||||
- (NSString *)eventTypeString {
|
||||
switch (self.eventType) {
|
||||
case TAEventTypeTrack: {
|
||||
return TD_EVENT_TYPE_TRACK;
|
||||
} break;
|
||||
case TAEventTypeTrackFirst: {
|
||||
|
||||
return TD_EVENT_TYPE_TRACK;
|
||||
} break;
|
||||
case TAEventTypeTrackUpdate: {
|
||||
return TD_EVENT_TYPE_TRACK_UPDATE;
|
||||
} break;
|
||||
case TAEventTypeTrackOverwrite: {
|
||||
return TD_EVENT_TYPE_TRACK_OVERWRITE;
|
||||
} break;
|
||||
case TAEventTypeUserAdd: {
|
||||
return TD_EVENT_TYPE_USER_ADD;
|
||||
} break;
|
||||
case TAEventTypeUserSet: {
|
||||
return TD_EVENT_TYPE_USER_SET;
|
||||
} break;
|
||||
case TAEventTypeUserUnset: {
|
||||
return TD_EVENT_TYPE_USER_UNSET;
|
||||
} break;
|
||||
case TAEventTypeUserAppend: {
|
||||
return TD_EVENT_TYPE_USER_APPEND;
|
||||
} break;
|
||||
case TAEventTypeUserUniqueAppend: {
|
||||
return TD_EVENT_TYPE_USER_UNIQ_APPEND;
|
||||
} break;
|
||||
case TAEventTypeUserDel: {
|
||||
return TD_EVENT_TYPE_USER_DEL;
|
||||
} break;
|
||||
case TAEventTypeUserSetOnce: {
|
||||
return TD_EVENT_TYPE_USER_SETONCE;
|
||||
} break;
|
||||
|
||||
default:
|
||||
return nil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+ (TAEventType)typeWithTypeString:(NSString *)typeString {
|
||||
if ([typeString isEqualToString:TD_EVENT_TYPE_TRACK]) {
|
||||
return TAEventTypeTrack;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_TRACK_FIRST]) {
|
||||
return TAEventTypeTrack;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_TRACK_UPDATE]) {
|
||||
return TAEventTypeTrackUpdate;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_TRACK_OVERWRITE]) {
|
||||
return TAEventTypeTrackOverwrite;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_ADD]) {
|
||||
return TAEventTypeUserAdd;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_DEL]) {
|
||||
return TAEventTypeUserDel;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_SET]) {
|
||||
return TAEventTypeUserSet;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_UNSET]) {
|
||||
return TAEventTypeUserUnset;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_APPEND]) {
|
||||
return TAEventTypeUserAppend;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_UNIQ_APPEND]) {
|
||||
return TAEventTypeUserUniqueAppend;
|
||||
} else if ([typeString isEqualToString:TD_EVENT_TYPE_USER_SETONCE]) {
|
||||
return TAEventTypeUserSetOnce;
|
||||
}
|
||||
return TAEventTypeNone;
|
||||
}
|
||||
|
||||
//MARK: - Private
|
||||
|
||||
//MARK: - Delegate
|
||||
|
||||
- (void)ta_validateKey:(NSString *)key value:(id)value error:(NSError *__autoreleasing _Nullable *)error {
|
||||
|
||||
}
|
||||
|
||||
//MARK: - Setter & Getter
|
||||
|
||||
- (NSMutableDictionary *)properties {
|
||||
if (!_properties) {
|
||||
_properties = [NSMutableDictionary dictionary];
|
||||
}
|
||||
return _properties;
|
||||
}
|
||||
|
||||
- (void)setTimeZone:(NSTimeZone *)timeZone {
|
||||
_timeZone = timeZone;
|
||||
|
||||
|
||||
self.timeFormatter.timeZone = timeZone ?: [NSTimeZone localTimeZone];
|
||||
}
|
||||
|
||||
- (NSDateFormatter *)timeFormatter {
|
||||
if (!_timeFormatter) {
|
||||
_timeFormatter = [[NSDateFormatter alloc] init];
|
||||
_timeFormatter.dateFormat = kDefaultTimeFormat;
|
||||
_timeFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||
_timeFormatter.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
|
||||
|
||||
_timeFormatter.timeZone = [NSTimeZone localTimeZone];
|
||||
}
|
||||
return _timeFormatter;
|
||||
}
|
||||
|
||||
- (void)setTime:(NSDate *)time {
|
||||
|
||||
if (time) {
|
||||
[self willChangeValueForKey:@"time"];
|
||||
_time = time;
|
||||
[self didChangeValueForKey:@"time"];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 264d7dc6cbe59cd40b05b87c88789d50
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// TATrackEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TABaseEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@interface TATrackEvent : TABaseEvent
|
||||
/// eventName
|
||||
@property (nonatomic, copy) NSString *eventName;
|
||||
/// Cumulative front activity time
|
||||
@property (nonatomic, assign) NSTimeInterval foregroundDuration;
|
||||
/// Cumulative background time
|
||||
@property (nonatomic, assign) NSTimeInterval backgroundDuration;
|
||||
|
||||
/// Record the boot time node when the event occurred. Used to count the cumulative time of events
|
||||
@property (nonatomic, assign) NSTimeInterval systemUpTime;
|
||||
|
||||
/// Used to record dynamic public properties, dynamic public properties need to be obtained in the current thread where the event occurs
|
||||
@property (nonatomic, strong) NSDictionary *dynamicSuperProperties;
|
||||
|
||||
/// Used to document static public properties
|
||||
@property (nonatomic, strong) NSDictionary *superProperties;
|
||||
|
||||
- (instancetype)initWithName:(NSString *)eventName;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 348008e8bc508b5428b825f9975547ec
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// TATrackEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackEvent.h"
|
||||
#import "TDPresetProperties.h"
|
||||
#import "TDPresetProperties+TDDisProperties.h"
|
||||
#import "NSDate+TAFormat.h"
|
||||
#import "TDDeviceInfo.h"
|
||||
|
||||
@implementation TATrackEvent
|
||||
|
||||
- (instancetype)initWithName:(NSString *)eventName {
|
||||
if (self = [self init]) {
|
||||
self.eventName = eventName;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.eventType = TAEventTypeTrack;
|
||||
self.systemUpTime = [TDDeviceInfo uptime];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
|
||||
[TAPropertyValidator validateEventOrPropertyName:self.eventName withError:error];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)jsonObject {
|
||||
NSMutableDictionary *dict = [super jsonObject];
|
||||
|
||||
dict[@"#event_name"] = self.eventName;
|
||||
|
||||
if (![TDPresetProperties disableDuration]) {
|
||||
if (self.foregroundDuration > 0) {
|
||||
self.properties[@"#duration"] = @([NSString stringWithFormat:@"%.3f", self.foregroundDuration].floatValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (![TDPresetProperties disableBackgroundDuration]) {
|
||||
if (self.backgroundDuration > 0) {
|
||||
self.properties[@"#background_duration"] = @([NSString stringWithFormat:@"%.3f", self.backgroundDuration].floatValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (self.timeValueType != TAEventTimeValueTypeTimeOnly) {
|
||||
if (![TDPresetProperties disableZoneOffset]) {
|
||||
self.properties[@"#zone_offset"] = @([self timeZoneOffset]);
|
||||
}
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
- (double)timeZoneOffset {
|
||||
NSTimeZone *tz = self.timeZone ?: [NSTimeZone localTimeZone];
|
||||
return [[NSDate date] ta_timeZoneOffset:tz];
|
||||
}
|
||||
|
||||
//MARK: - Delegate
|
||||
|
||||
- (void)ta_validateKey:(NSString *)key value:(id)value error:(NSError *__autoreleasing _Nullable *)error {
|
||||
[TAPropertyValidator validateNormalTrackEventPropertyKey:key value:value error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 632dc32424717974a807dc4adb9fcf41
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TATrackFirstEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TATrackFirstEvent : TATrackEvent
|
||||
|
||||
@property (nonatomic, copy) NSString *firstCheckId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf92f2d9fb4cde247948818a8f9c9cc5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// TATrackFirstEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackFirstEvent.h"
|
||||
#import "TDDeviceInfo.h"
|
||||
|
||||
@implementation TATrackFirstEvent
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.eventType = TAEventTypeTrackFirst;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
[super validateWithError:error];
|
||||
if (*error) {
|
||||
return;
|
||||
}
|
||||
if (self.firstCheckId.length <= 0) {
|
||||
NSString *errorMsg = @"property 'firstCheckId' cannot be empty which in FirstEvent";
|
||||
*error = TAPropertyError(100010, errorMsg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)jsonObject {
|
||||
NSMutableDictionary *dict = [super jsonObject];
|
||||
|
||||
dict[@"#first_check_id"] = self.firstCheckId ?: [TDDeviceInfo sharedManager].deviceId;
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd17e1c9dfb23764c8c6516849e8c5f4
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TATrackOverwriteEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TATrackOverwriteEvent : TATrackEvent
|
||||
|
||||
@property (nonatomic, copy) NSString *eventId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6e101892176f7941a1b09ff739b227c
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// TATrackOverwriteEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackOverwriteEvent.h"
|
||||
|
||||
@implementation TATrackOverwriteEvent
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.eventType = TAEventTypeTrackOverwrite;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)jsonObject {
|
||||
NSMutableDictionary *dict = [super jsonObject];
|
||||
|
||||
dict[@"#event_id"] = self.eventId;
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
[super validateWithError:error];
|
||||
if (*error) {
|
||||
return;
|
||||
}
|
||||
if (self.eventId.length <= 0) {
|
||||
NSString *errorMsg = @"property 'eventId' cannot be empty which in OverwriteEvent";
|
||||
*error = TAPropertyError(100011, errorMsg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9533786078363fa428dc28c33206f5b2
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TATrackUpdateEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TATrackUpdateEvent : TATrackEvent
|
||||
|
||||
@property (nonatomic, copy) NSString *eventId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8212c727ff3ae14fb32e3996cc02f01
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// TATrackUpdateEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TATrackUpdateEvent.h"
|
||||
|
||||
@implementation TATrackUpdateEvent
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.eventType = TAEventTypeTrackUpdate;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *)jsonObject {
|
||||
NSMutableDictionary *dict = [super jsonObject];
|
||||
|
||||
dict[@"#event_id"] = self.eventId;
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
[super validateWithError:error];
|
||||
if (*error) {
|
||||
return;
|
||||
}
|
||||
if (self.eventId.length <= 0) {
|
||||
NSString *errorMsg = @"property 'eventId' cannot be empty which in UpdateEvent";
|
||||
*error = TAPropertyError(100012, errorMsg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 473fc011a28100a44bc92ba0a638b227
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDUpdateEventModel.h>)
|
||||
#import <ThinkingSDK/TDUpdateEventModel.h>
|
||||
#else
|
||||
#import "TDUpdateEventModel.h"
|
||||
#endif
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDOverwriteEventModel.h>)
|
||||
#import <ThinkingSDK/TDOverwriteEventModel.h>
|
||||
#else
|
||||
#import "TDOverwriteEventModel.h"
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f8cc57729aa4ec4eaaae6d8ed602249
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_OPTIONS(NSInteger, TimeValueType) {
|
||||
TDTimeValueTypeNone = 0,
|
||||
TDTimeValueTypeTimeOnly = 1 << 0,
|
||||
TDTimeValueTypeAll = 1 << 1,
|
||||
};
|
||||
|
||||
typedef NSString *kEDEventTypeName;
|
||||
|
||||
FOUNDATION_EXTERN kEDEventTypeName const TD_EVENT_TYPE_TRACK_FIRST;
|
||||
FOUNDATION_EXTERN kEDEventTypeName const TD_EVENT_TYPE_TRACK_UPDATE;
|
||||
FOUNDATION_EXTERN kEDEventTypeName const TD_EVENT_TYPE_TRACK_OVERWRITE;
|
||||
|
||||
@interface TDEventModel : NSObject
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *eventName;
|
||||
@property (nonatomic, copy, readonly) kEDEventTypeName eventType; // Default is TD_EVENT_TYPE_TRACK
|
||||
|
||||
@property (nonatomic, strong) NSDictionary *properties;
|
||||
|
||||
- (void)configTime:(NSDate *)time timeZone:(NSTimeZone * _Nullable)timeZone;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3e64bb60e0cf8f4e9c76c4e2e3266d8
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
#import "TDEventModel.h"
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
kEDEventTypeName const TD_EVENT_TYPE_TRACK_FIRST = @"track_first";
|
||||
kEDEventTypeName const TD_EVENT_TYPE_TRACK_UPDATE = @"track_update";
|
||||
kEDEventTypeName const TD_EVENT_TYPE_TRACK_OVERWRITE = @"track_overwrite";
|
||||
|
||||
@interface TDEventModel ()
|
||||
|
||||
@property (nonatomic, copy) NSString *eventName;
|
||||
@property (nonatomic, copy) kEDEventTypeName eventType;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TDEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName {
|
||||
return [self initWithEventName:eventName eventType:TD_EVENT_TYPE_TRACK];
|
||||
}
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName eventType:(kEDEventTypeName)eventType {
|
||||
if (self = [[[TDEventModel class] alloc] init]) {
|
||||
self.persist = YES;
|
||||
self.eventName = eventName ?: @"";
|
||||
self.eventType = eventType ?: @"";
|
||||
if ([self.eventType isEqualToString:TD_EVENT_TYPE_TRACK_FIRST]) {
|
||||
_extraID = [TDDeviceInfo sharedManager].deviceId ?: @"";
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Public
|
||||
|
||||
- (void)configTime:(NSDate *)time timeZone:(NSTimeZone *)timeZone {
|
||||
if (!time || ![time isKindOfClass:[NSDate class]]) {
|
||||
self.timeValueType = TDTimeValueTypeNone;
|
||||
} else {
|
||||
self.time = time;
|
||||
self.timeZone = timeZone;
|
||||
|
||||
NSDateFormatter *timeFormatter = [[NSDateFormatter alloc] init];
|
||||
timeFormatter.dateFormat = kDefaultTimeFormat;
|
||||
timeFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
|
||||
timeFormatter.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
|
||||
if (timeZone && [timeZone isKindOfClass:[NSTimeZone class]]) {
|
||||
self.timeValueType = TDTimeValueTypeAll;
|
||||
timeFormatter.timeZone = timeZone;
|
||||
} else {
|
||||
self.timeValueType = TDTimeValueTypeTimeOnly;
|
||||
timeFormatter.timeZone = [NSTimeZone localTimeZone];
|
||||
}
|
||||
self.timeString = [timeFormatter stringFromDate:time];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Setter
|
||||
|
||||
- (void)setExtraID:(NSString *)extraID {
|
||||
if (extraID.length > 0) {
|
||||
_extraID = extraID;
|
||||
} else {
|
||||
if ([self.eventType isEqualToString:TD_EVENT_TYPE_TRACK_FIRST]) {
|
||||
TDLogError(@"Invalid firstCheckId. Use device Id");
|
||||
} else {
|
||||
TDLogError(@"Invalid eventId");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89bc3274598fdcc4594b2a8dc286c530
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDEventModel.h>)
|
||||
#import <ThinkingSDK/TDEventModel.h>
|
||||
#else
|
||||
#import "TDEventModel.h"
|
||||
#endif
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TDFirstEventModel : TDEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString * _Nullable)eventName;
|
||||
|
||||
- (instancetype)initWithEventName:(NSString * _Nullable)eventName firstCheckID:(NSString *)firstCheckID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73d5531a42705ed4ba226579bd7a98b1
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
#import "TDFirstEventModel.h"
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
@implementation TDFirstEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName {
|
||||
return [self initWithEventName:eventName eventType:TD_EVENT_TYPE_TRACK_FIRST];
|
||||
}
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName firstCheckID:(NSString *)firstCheckID {
|
||||
if (self = [self initWithEventName:eventName eventType:TD_EVENT_TYPE_TRACK_FIRST]) {
|
||||
self.extraID = firstCheckID;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0692a1a2fa244c488a7169860f116ba
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// TDOverwriteEventModel.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDEventModel.h>)
|
||||
#import <ThinkingSDK/TDEventModel.h>
|
||||
#else
|
||||
#import "TDEventModel.h"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TDOverwriteEventModel : TDEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName eventID:(NSString *)eventID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 182d74d42aab04e4481e2f85b6dd21b3
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// TDOverwriteEventModel.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TDOverwriteEventModel.h"
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
@implementation TDOverwriteEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName eventID:(NSString *)eventID {
|
||||
if (self = [self initWithEventName:eventName eventType:TD_EVENT_TYPE_TRACK_OVERWRITE]) {
|
||||
self.extraID = eventID;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d2e30d9eb2468e46b0a2bec2943ca37
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// TDUpdateEventModel.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDEventModel.h>)
|
||||
#import <ThinkingSDK/TDEventModel.h>
|
||||
#else
|
||||
#import "TDEventModel.h"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TDUpdateEventModel : TDEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName eventID:(NSString *)eventID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbc2e721110e8d4458e16a8fa6abe060
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// TDUpdateEventModel.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TDUpdateEventModel.h"
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
@implementation TDUpdateEventModel
|
||||
|
||||
- (instancetype)initWithEventName:(NSString *)eventName eventID:(NSString *)eventID {
|
||||
if (self = [self initWithEventName:eventName eventType:TD_EVENT_TYPE_TRACK_UPDATE]) {
|
||||
self.extraID = eventID;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a4c872a829d6024fb4a734c8ef5a8ed
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e7eea08e7b68714a8325f2273b99e2b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEvent.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TABaseEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEvent : TABaseEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bb3fb96980c85a41be6e9150daad0d3
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// TAUserEvent.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
@implementation TAUserEvent
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.timeValueType = TAEventTimeValueTypeNone;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
//MARK: - Delegate
|
||||
|
||||
- (void)ta_validateKey:(NSString *)key value:(id)value error:(NSError *__autoreleasing _Nullable *)error {
|
||||
[TAPropertyValidator validateBaseEventPropertyKey:key value:value error:error];
|
||||
}
|
||||
|
||||
//MARK: - Setter & Getter
|
||||
|
||||
- (void)setTime:(NSDate *)time {
|
||||
[super setTime:time];
|
||||
|
||||
self.timeValueType = time == nil ? TAEventTimeValueTypeNone : TAEventTimeValueTypeTimeOnly;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b2091d83c9e46d48b5ecbcc1303bafb
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventAdd.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventAdd : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63b7ac8601a8a024cadf13867461fea2
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// TAUserEventAdd.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventAdd.h"
|
||||
|
||||
@implementation TAUserEventAdd
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserAdd;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)validateWithError:(NSError *__autoreleasing _Nullable *)error {
|
||||
|
||||
}
|
||||
|
||||
//MARK: - Delegate
|
||||
|
||||
- (void)ta_validateKey:(NSString *)key value:(id)value error:(NSError *__autoreleasing _Nullable *)error {
|
||||
[super ta_validateKey:key value:value error:error];
|
||||
if (*error) {
|
||||
return;
|
||||
}
|
||||
if (![value isKindOfClass:NSNumber.class]) {
|
||||
NSString *errMsg = [NSString stringWithFormat:@"Property value must be type NSNumber. got: %@ %@. ", [value class], value];
|
||||
*error = TAPropertyError(10008, errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f189f76c1bda181468232e42d0167df9
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventAppend.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventAppend : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d49e66ef3c986cc4bbeeb74546f4efff
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// TAUserEventAppend.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventAppend.h"
|
||||
|
||||
@implementation TAUserEventAppend
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserAppend;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
//MARK: - Delegate
|
||||
|
||||
- (void)ta_validateKey:(NSString *)key value:(id)value error:(NSError *__autoreleasing _Nullable *)error {
|
||||
[super ta_validateKey:key value:value error:error];
|
||||
if (*error) {
|
||||
return;
|
||||
}
|
||||
if (![value isKindOfClass:NSArray.class]) {
|
||||
NSString *errMsg = [NSString stringWithFormat:@"Property value must be type NSArray. got: %@ %@. ", [value class], value];
|
||||
*error = TAPropertyError(10009, errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e81e2c06e182e724797941a1649ebfc9
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventDelete.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventDelete : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34371ed8d8bc1d046a8d9ce530e7cc5b
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserEventDelete.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventDelete.h"
|
||||
|
||||
@implementation TAUserEventDelete
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserDel;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1c8b11b1d25e694daba78204879133f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventSet.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventSet : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fb292f74faffd04aacdd6d6c8fb573d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserEventSet.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventSet.h"
|
||||
|
||||
@implementation TAUserEventSet
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserSet;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce3f089d0844ad64abe613ad1c9611e5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventSetOnce.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventSetOnce : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c45394852951ac34893a0a996450fb7d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserEventSetOnce.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventSetOnce.h"
|
||||
|
||||
@implementation TAUserEventSetOnce
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserSetOnce;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c47de666b1b16a418729c90dc5176d5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventUniqueAppend.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventAppend.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventUniqueAppend : TAUserEventAppend
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e0bc42d52b244149b55cc9aa04c0e87
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserEventUniqueAppend.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventUniqueAppend.h"
|
||||
|
||||
@implementation TAUserEventUniqueAppend
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserUniqueAppend;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 961c617f5bbdd1341a9a4f34ffd3761d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TAUserEventUnset.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAUserEventUnset : TAUserEvent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a78029a6eae2e9e479722e1ec2da88a0
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserEventUnset.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#import "TAUserEventUnset.h"
|
||||
|
||||
@implementation TAUserEventUnset
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
self.eventType = TAEventTypeUserUnset;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adade9d1d8d6f19418abf8b1ba48c9f6
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TAUserPropertyHeader.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/7/1.
|
||||
//
|
||||
|
||||
#ifndef TAUserPropertyHeader_h
|
||||
#define TAUserPropertyHeader_h
|
||||
|
||||
#import "TAUserEventSet.h"
|
||||
#import "TAUserEventSetOnce.h"
|
||||
#import "TAUserEventUnset.h"
|
||||
#import "TAUserEventAdd.h"
|
||||
#import "TAUserEventDelete.h"
|
||||
#import "TAUserEventAppend.h"
|
||||
#import "TAUserEventUniqueAppend.h"
|
||||
|
||||
#endif /* TAUserPropertyHeader_h */
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f4c8873703dea740ae30f3254501278
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1254ce5bba99c1d45b1845450e781116
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f80018b6b2b62a46afd80f5d35584b9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// TDPresetProperties+TDDisProperties.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by wwango on 2021/12/7.
|
||||
// 不能使用的
|
||||
|
||||
#if __has_include(<ThinkingSDK/TDPresetProperties.h>)
|
||||
#import <ThinkingSDK/TDPresetProperties.h>
|
||||
#else
|
||||
#import "TDPresetProperties.h"
|
||||
#endif
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TDPresetProperties (TDDisProperties)
|
||||
|
||||
// - 禁用功能并过滤字段拼接
|
||||
|
||||
@property(class, nonatomic, readonly) BOOL disableOpsReceiptProperties;
|
||||
@property(class, nonatomic, readonly) BOOL disableStartReason;
|
||||
@property(class, nonatomic, readonly) BOOL disableDisk;
|
||||
@property(class, nonatomic, readonly) BOOL disableRAM;
|
||||
@property(class, nonatomic, readonly) BOOL disableFPS;
|
||||
@property(class, nonatomic, readonly) BOOL disableSimulator;
|
||||
@property(class, nonatomic, readonly) BOOL disableAppVersion;
|
||||
@property(class, nonatomic, readonly) BOOL disableOsVersion;
|
||||
@property(class, nonatomic, readonly) BOOL disableManufacturer;
|
||||
@property(class, nonatomic, readonly) BOOL disableDeviceModel;
|
||||
@property(class, nonatomic, readonly) BOOL disableScreenHeight;
|
||||
@property(class, nonatomic, readonly) BOOL disableScreenWidth;
|
||||
@property(class, nonatomic, readonly) BOOL disableCarrier;
|
||||
@property(class, nonatomic, readonly) BOOL disableDeviceId;
|
||||
@property(class, nonatomic, readonly) BOOL disableSystemLanguage;
|
||||
@property(class, nonatomic, readonly) BOOL disableLib;
|
||||
@property(class, nonatomic, readonly) BOOL disableLibVersion;
|
||||
@property(class, nonatomic, readonly) BOOL disableBundleId;
|
||||
@property(class, nonatomic, readonly) BOOL disableOs;
|
||||
@property(class, nonatomic, readonly) BOOL disableInstallTime;
|
||||
@property(class, nonatomic, readonly) BOOL disableDeviceType;
|
||||
@property(class, nonatomic, readonly) BOOL disableSessionID;
|
||||
@property(class, nonatomic, readonly) BOOL disableCalibratedTime;
|
||||
|
||||
|
||||
// - 只过滤字段
|
||||
@property(class, nonatomic, readonly) BOOL disableNetworkType;
|
||||
@property(class, nonatomic, readonly) BOOL disableZoneOffset;
|
||||
@property(class, nonatomic, readonly) BOOL disableDuration;
|
||||
@property(class, nonatomic, readonly) BOOL disableBackgroundDuration;
|
||||
@property(class, nonatomic, readonly) BOOL disableAppCrashedReason;
|
||||
@property(class, nonatomic, readonly) BOOL disableResumeFromBackground;
|
||||
@property(class, nonatomic, readonly) BOOL disableElementId;
|
||||
@property(class, nonatomic, readonly) BOOL disableElementType;
|
||||
@property(class, nonatomic, readonly) BOOL disableElementContent;
|
||||
@property(class, nonatomic, readonly) BOOL disableElementPosition;
|
||||
@property(class, nonatomic, readonly) BOOL disableElementSelector;
|
||||
@property(class, nonatomic, readonly) BOOL disableScreenName;
|
||||
@property(class, nonatomic, readonly) BOOL disableTitle;
|
||||
@property(class, nonatomic, readonly) BOOL disableUrl;
|
||||
@property(class, nonatomic, readonly) BOOL disableReferrer;
|
||||
|
||||
|
||||
/// 需要过滤的预置属性
|
||||
+ (NSArray*)disPresetProperties;
|
||||
|
||||
/// 过滤预置属性
|
||||
/// @param dataDic 外层property
|
||||
+ (void)handleFilterDisPresetProperties:(NSMutableDictionary *)dataDic;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa7b9fe20e8169b47a9c2c70b2ddcc6f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,342 @@
|
||||
//
|
||||
// TDPresetProperties+TDDisProperties.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by wwango on 2021/12/7.
|
||||
//
|
||||
|
||||
#import "TDPresetProperties+TDDisProperties.h"
|
||||
|
||||
static BOOL _td_disableOpsReceiptProperties;
|
||||
static BOOL _td_disableStartReason;
|
||||
static BOOL _td_disableDisk;
|
||||
static BOOL _td_disableRAM;
|
||||
static BOOL _td_disableFPS;
|
||||
static BOOL _td_disableSimulator;
|
||||
static BOOL _td_disableAppVersion;
|
||||
static BOOL _td_disableOsVersion;
|
||||
static BOOL _td_disableManufacturer;
|
||||
static BOOL _td_disableDeviceModel;
|
||||
static BOOL _td_disableScreenHeight;
|
||||
static BOOL _td_disableScreenWidth;
|
||||
static BOOL _td_disableCarrier;
|
||||
static BOOL _td_disableDeviceId;
|
||||
static BOOL _td_disableSystemLanguage;
|
||||
static BOOL _td_disableLib;
|
||||
static BOOL _td_disableLibVersion;
|
||||
static BOOL _td_disableBundleId;
|
||||
static BOOL _td_disableOs;
|
||||
static BOOL _td_disableInstallTime;
|
||||
static BOOL _td_disableDeviceType;
|
||||
static BOOL _td_disableSessionID;
|
||||
static BOOL _td_disableCalibratedTime;
|
||||
|
||||
static BOOL _td_disableNetworkType;
|
||||
static BOOL _td_disableZoneOffset;
|
||||
static BOOL _td_disableDuration;
|
||||
static BOOL _td_disableBackgroundDuration;
|
||||
static BOOL _td_disableAppCrashedReason;
|
||||
static BOOL _td_disableResumeFromBackground;
|
||||
static BOOL _td_disableElementId;
|
||||
static BOOL _td_disableElementType;
|
||||
static BOOL _td_disableElementContent;
|
||||
static BOOL _td_disableElementPosition;
|
||||
static BOOL _td_disableElementSelector;
|
||||
static BOOL _td_disableScreenName;
|
||||
static BOOL _td_disableTitle;
|
||||
static BOOL _td_disableUrl;
|
||||
static BOOL _td_disableReferrer;
|
||||
|
||||
|
||||
// 推送事件名
|
||||
static const NSString *kTDPushInfo = @"ops_push_click";
|
||||
|
||||
// - 禁用功能并过滤字段拼接
|
||||
static const NSString *kTDStartReason = @"#start_reason";
|
||||
static const NSString *kTDPerformanceRAM = @"#ram";
|
||||
static const NSString *kTDPerformanceDISK = @"#disk";
|
||||
static const NSString *kTDPerformanceSIM = @"#simulator";
|
||||
static const NSString *kTDPerformanceFPS = @"#fps";
|
||||
static const NSString *kTDPresentAppVersion = @"#app_version";
|
||||
static const NSString *kTDPresentOsVersion = @"#os_version";
|
||||
static const NSString *kTDPresentManufacturer = @"#manufacturer";
|
||||
static const NSString *kTDPresentDeviceModel = @"#device_model";
|
||||
static const NSString *kTDPresentScreenHeight = @"#screen_height";
|
||||
static const NSString *kTDPresentScreenWidth = @"#screen_width";
|
||||
static const NSString *kTDPresentCarrier = @"#carrier";
|
||||
static const NSString *kTDPresentDeviceId = @"#device_id";
|
||||
static const NSString *kTDPresentSystemLanguage = @"#system_language";
|
||||
static const NSString *kTDPresentLib = @"#lib";
|
||||
static const NSString *kTDPresentLibVersion = @"#lib_version";
|
||||
static const NSString *kTDPresentOs = @"#os";
|
||||
static const NSString *kTDPresentBundleId = @"#bundle_id";
|
||||
static const NSString *kTDPresentInstallTime = @"#install_time";
|
||||
static const NSString *kTDPresentDeviceType = @"#device_type";
|
||||
static const NSString *kTDPresentSessionID = @"#session_id";
|
||||
static const NSString *kTDPresentCalibratedTime = @"#time_calibration";
|
||||
|
||||
|
||||
// - 只过滤字段
|
||||
static const NSString *kTDPresentNETWORKTYPE = @"#network_type";
|
||||
static const NSString *kTDPresentZONEOFFSET = @"#zone_offset";
|
||||
static const NSString *kTDPresentDURATION = @"#duration";
|
||||
static const NSString *kTDPresentBACKGROUNDDURATION = @"#background_duration";
|
||||
static const NSString *kTDPresentCRASHREASON = @"#app_crashed_reason";
|
||||
static const NSString *kTDPresentRESUMEFROMBACKGROUND = @"#resume_from_background";
|
||||
static const NSString *kTDPresentELEMENTID = @"#element_id";
|
||||
static const NSString *kTDPresentELEMENTTYPE = @"#element_type";
|
||||
static const NSString *kTDPresentELEMENTCONTENT = @"#element_content";
|
||||
static const NSString *kTDPresentELEMENTPOSITION = @"#element_position";
|
||||
static const NSString *kTDPresentELEMENTSELECTOR = @"#element_selector";
|
||||
static const NSString *kTDPresentSCREENNAME = @"#screen_name";
|
||||
static const NSString *kTDPresentTITLE = @"#title";
|
||||
static const NSString *kTDPresentURL = @"#url";
|
||||
static const NSString *kTDPresentREFERRER = @"#referrer";
|
||||
static const NSString *kTDPresentOpsReceiptProperties = @"#ops_receipt_properties";
|
||||
|
||||
|
||||
|
||||
#define TD_MAIM_INFO_PLIST_DISPRESTPRO_KEY @"TDDisPresetProperties"
|
||||
|
||||
@implementation TDPresetProperties (TDDisProperties)
|
||||
|
||||
static NSMutableArray *__td_disPresetProperties;
|
||||
|
||||
+ (NSArray*)disPresetProperties {
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
||||
NSArray *disPresetProperties = (NSArray *)[[[NSBundle mainBundle] infoDictionary] objectForKey:TD_MAIM_INFO_PLIST_DISPRESTPRO_KEY];
|
||||
|
||||
if (disPresetProperties && disPresetProperties.count) {
|
||||
__td_disPresetProperties = [NSMutableArray arrayWithArray:disPresetProperties];
|
||||
|
||||
if ([__td_disPresetProperties containsObject:kTDPresentZONEOFFSET]) {
|
||||
[__td_disPresetProperties removeObject:kTDPresentZONEOFFSET];
|
||||
}
|
||||
|
||||
_td_disableStartReason = [__td_disPresetProperties containsObject:kTDStartReason];
|
||||
_td_disableDisk = [__td_disPresetProperties containsObject:kTDPerformanceDISK];
|
||||
_td_disableRAM = [__td_disPresetProperties containsObject:kTDPerformanceRAM];
|
||||
_td_disableFPS = [__td_disPresetProperties containsObject:kTDPerformanceFPS];
|
||||
_td_disableSimulator = [__td_disPresetProperties containsObject:kTDPerformanceSIM];
|
||||
|
||||
_td_disableAppVersion = [__td_disPresetProperties containsObject:kTDPresentAppVersion];
|
||||
_td_disableOsVersion = [__td_disPresetProperties containsObject:kTDPresentOsVersion];
|
||||
_td_disableManufacturer = [__td_disPresetProperties containsObject:kTDPresentManufacturer];
|
||||
_td_disableDeviceModel = [__td_disPresetProperties containsObject:kTDPresentDeviceModel];
|
||||
_td_disableScreenHeight = [__td_disPresetProperties containsObject:kTDPresentScreenHeight];
|
||||
_td_disableScreenWidth = [__td_disPresetProperties containsObject:kTDPresentScreenWidth];
|
||||
_td_disableCarrier = [__td_disPresetProperties containsObject:kTDPresentCarrier];
|
||||
_td_disableDeviceId = [__td_disPresetProperties containsObject:kTDPresentDeviceId];
|
||||
_td_disableSystemLanguage = [__td_disPresetProperties containsObject:kTDPresentSystemLanguage];
|
||||
_td_disableLib = [__td_disPresetProperties containsObject:kTDPresentLib];
|
||||
_td_disableLibVersion = [__td_disPresetProperties containsObject:kTDPresentLibVersion];
|
||||
_td_disableBundleId = [__td_disPresetProperties containsObject:kTDPresentBundleId];
|
||||
_td_disableOs = [__td_disPresetProperties containsObject:kTDPresentOs];
|
||||
_td_disableInstallTime = [__td_disPresetProperties containsObject:kTDPresentInstallTime];
|
||||
_td_disableDeviceType = [__td_disPresetProperties containsObject:kTDPresentDeviceType];
|
||||
//_td_disableSessionID = [__td_disPresetProperties containsObject:kTDPresentSessionID];
|
||||
//_td_disableCalibratedTime = [__td_disPresetProperties containsObject:kTDPresentCalibratedTime];
|
||||
_td_disableSessionID = YES;
|
||||
_td_disableCalibratedTime = YES;
|
||||
|
||||
|
||||
_td_disableNetworkType = [__td_disPresetProperties containsObject:kTDPresentNETWORKTYPE];
|
||||
_td_disableZoneOffset = [__td_disPresetProperties containsObject:kTDPresentZONEOFFSET];
|
||||
_td_disableDuration = [__td_disPresetProperties containsObject:kTDPresentDURATION];
|
||||
_td_disableBackgroundDuration = [__td_disPresetProperties containsObject:kTDPresentBACKGROUNDDURATION];
|
||||
_td_disableAppCrashedReason = [__td_disPresetProperties containsObject:kTDPresentCRASHREASON];
|
||||
_td_disableResumeFromBackground = [__td_disPresetProperties containsObject:kTDPresentRESUMEFROMBACKGROUND];
|
||||
_td_disableElementId = [__td_disPresetProperties containsObject:kTDPresentELEMENTID];
|
||||
_td_disableElementType = [__td_disPresetProperties containsObject:kTDPresentELEMENTTYPE];
|
||||
_td_disableElementContent = [__td_disPresetProperties containsObject:kTDPresentELEMENTCONTENT];
|
||||
_td_disableElementPosition = [__td_disPresetProperties containsObject:kTDPresentELEMENTPOSITION];
|
||||
_td_disableElementSelector = [__td_disPresetProperties containsObject:kTDPresentELEMENTSELECTOR];
|
||||
_td_disableScreenName = [__td_disPresetProperties containsObject:kTDPresentSCREENNAME];
|
||||
_td_disableTitle = [__td_disPresetProperties containsObject:kTDPresentTITLE];
|
||||
_td_disableUrl = [__td_disPresetProperties containsObject:kTDPresentURL];
|
||||
_td_disableReferrer = [__td_disPresetProperties containsObject:kTDPresentREFERRER];
|
||||
_td_disableOpsReceiptProperties = [__td_disPresetProperties containsObject:kTDPresentOpsReceiptProperties];
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
return __td_disPresetProperties;
|
||||
}
|
||||
|
||||
|
||||
+ (void)handleFilterDisPresetProperties:(NSMutableDictionary *)dataDic
|
||||
{
|
||||
if (!__td_disPresetProperties || !__td_disPresetProperties.count) {
|
||||
return ;
|
||||
}
|
||||
NSArray *propertykeys = dataDic.allKeys;
|
||||
NSArray *registerkeys = [TDPresetProperties disPresetProperties];
|
||||
NSMutableSet *set1 = [NSMutableSet setWithArray:propertykeys];
|
||||
NSMutableSet *set2 = [NSMutableSet setWithArray:registerkeys];
|
||||
[set1 intersectSet:set2];// 求交集
|
||||
if (!set1.allObjects.count) {
|
||||
return ;
|
||||
}
|
||||
[dataDic removeObjectsForKeys:set1.allObjects];
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
+ (BOOL)disableOpsReceiptProperties {
|
||||
return _td_disableOpsReceiptProperties;
|
||||
}
|
||||
|
||||
+ (BOOL)disableStartReason {
|
||||
return _td_disableStartReason;
|
||||
}
|
||||
|
||||
+ (BOOL)disableDisk {
|
||||
return _td_disableDisk;
|
||||
}
|
||||
|
||||
+ (BOOL)disableRAM {
|
||||
return _td_disableRAM;
|
||||
}
|
||||
|
||||
+ (BOOL)disableFPS {
|
||||
return _td_disableFPS;
|
||||
}
|
||||
|
||||
+ (BOOL)disableSimulator {
|
||||
return _td_disableSimulator;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+ (BOOL)disableAppVersion {
|
||||
return _td_disableAppVersion;
|
||||
}
|
||||
|
||||
+ (BOOL)disableOsVersion {
|
||||
return _td_disableOsVersion;
|
||||
}
|
||||
|
||||
+ (BOOL)disableManufacturer {
|
||||
return _td_disableManufacturer;
|
||||
}
|
||||
|
||||
+ (BOOL)disableDeviceId {
|
||||
return _td_disableDeviceId;
|
||||
}
|
||||
|
||||
+ (BOOL)disableDeviceModel {
|
||||
return _td_disableDeviceModel;
|
||||
}
|
||||
|
||||
+ (BOOL)disableScreenHeight {
|
||||
return _td_disableScreenHeight;
|
||||
}
|
||||
|
||||
+ (BOOL)disableScreenWidth {
|
||||
return _td_disableScreenWidth;
|
||||
}
|
||||
|
||||
+ (BOOL)disableCarrier {
|
||||
return _td_disableCarrier;
|
||||
}
|
||||
|
||||
+ (BOOL)disableSystemLanguage {
|
||||
return _td_disableSystemLanguage;
|
||||
}
|
||||
|
||||
+ (BOOL)disableLib {
|
||||
return _td_disableLib;
|
||||
}
|
||||
|
||||
+ (BOOL)disableLibVersion {
|
||||
return _td_disableLibVersion;
|
||||
}
|
||||
|
||||
+ (BOOL)disableOs {
|
||||
return _td_disableOs;
|
||||
}
|
||||
|
||||
+ (BOOL)disableBundleId {
|
||||
return _td_disableBundleId;
|
||||
}
|
||||
|
||||
+ (BOOL)disableInstallTime {
|
||||
return _td_disableInstallTime;
|
||||
}
|
||||
|
||||
+ (BOOL)disableDeviceType {
|
||||
return _td_disableDeviceType;
|
||||
}
|
||||
|
||||
+ (BOOL)disableNetworkType {
|
||||
return _td_disableNetworkType;
|
||||
}
|
||||
|
||||
+ (BOOL)disableZoneOffset {
|
||||
return _td_disableZoneOffset;
|
||||
}
|
||||
|
||||
+ (BOOL)disableDuration {
|
||||
return _td_disableDuration;
|
||||
}
|
||||
|
||||
+ (BOOL)disableBackgroundDuration {
|
||||
return _td_disableBackgroundDuration;
|
||||
}
|
||||
|
||||
+ (BOOL)disableAppCrashedReason {
|
||||
return _td_disableAppCrashedReason;
|
||||
}
|
||||
|
||||
+ (BOOL)disableResumeFromBackground {
|
||||
return _td_disableResumeFromBackground;
|
||||
}
|
||||
|
||||
+ (BOOL)disableElementId {
|
||||
return _td_disableElementId;
|
||||
}
|
||||
|
||||
+ (BOOL)disableElementType {
|
||||
return _td_disableElementType;
|
||||
}
|
||||
|
||||
+ (BOOL)disableElementContent {
|
||||
return _td_disableElementContent;
|
||||
}
|
||||
|
||||
+ (BOOL)disableElementPosition {
|
||||
return _td_disableElementPosition;
|
||||
}
|
||||
|
||||
+ (BOOL)disableElementSelector {
|
||||
return _td_disableElementSelector;
|
||||
}
|
||||
|
||||
+ (BOOL)disableScreenName {
|
||||
return _td_disableScreenName;
|
||||
}
|
||||
|
||||
+ (BOOL)disableTitle {
|
||||
return _td_disableTitle;
|
||||
}
|
||||
|
||||
+ (BOOL)disableUrl {
|
||||
return _td_disableUrl;
|
||||
}
|
||||
|
||||
+ (BOOL)disableReferrer {
|
||||
return _td_disableReferrer;
|
||||
}
|
||||
|
||||
+ (BOOL)disableSessionID {
|
||||
return _td_disableSessionID;
|
||||
}
|
||||
|
||||
+ (BOOL)disableCalibratedTime {
|
||||
return _td_disableCalibratedTime;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e86fd2feb4c097446a73f152c1db5837
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// TDPresetProperties.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by huangdiao on 2021/5/25.
|
||||
// Copyright © 2021 thinkingdata. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TDPresetProperties : NSObject
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *bundle_id;
|
||||
@property (nonatomic, copy, readonly) NSString *carrier;
|
||||
@property (nonatomic, copy, readonly) NSString *device_id;
|
||||
@property (nonatomic, copy, readonly) NSString *device_model;
|
||||
@property (nonatomic, copy, readonly) NSString *manufacturer;
|
||||
@property (nonatomic, copy, readonly) NSString *network_type;
|
||||
@property (nonatomic, copy, readonly) NSString *os;
|
||||
@property (nonatomic, copy, readonly) NSString *os_version;
|
||||
@property (nonatomic, copy, readonly) NSNumber *screen_height;
|
||||
@property (nonatomic, copy, readonly) NSNumber *screen_width;
|
||||
@property (nonatomic, copy, readonly) NSString *system_language;
|
||||
@property (nonatomic, copy, readonly) NSNumber *zone_offset;
|
||||
@property (nonatomic, copy, readonly) NSString *install_time;
|
||||
|
||||
/**
|
||||
* The key of the returned event preset property starts with "#", and it is not recommended to use it directly as the property of the event
|
||||
*/
|
||||
- (NSDictionary *)toEventPresetProperties;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be2a7a171219eae44818a7bd33a279b3
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// TDPresetProperties.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by huangdiao on 2021/5/25.
|
||||
// Copyright © 2021 thinkingdata. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TDPresetProperties.h"
|
||||
#import "TDPresetProperties+TDDisProperties.h"
|
||||
|
||||
@interface TDPresetProperties ()
|
||||
|
||||
@property (nonatomic, copy, readwrite) NSString *bundle_id;
|
||||
@property (nonatomic, copy, readwrite) NSString *carrier;
|
||||
@property (nonatomic, copy, readwrite) NSString *device_id;
|
||||
@property (nonatomic, copy, readwrite) NSString *device_model;
|
||||
@property (nonatomic, copy, readwrite) NSString *manufacturer;
|
||||
@property (nonatomic, copy, readwrite) NSString *network_type;
|
||||
@property (nonatomic, copy, readwrite) NSString *os;
|
||||
@property (nonatomic, copy, readwrite) NSString *os_version;
|
||||
@property (nonatomic, copy, readwrite) NSNumber *screen_height;
|
||||
@property (nonatomic, copy, readwrite) NSNumber *screen_width;
|
||||
@property (nonatomic, copy, readwrite) NSString *system_language;
|
||||
@property (nonatomic, copy, readwrite) NSNumber *zone_offset;
|
||||
@property (nonatomic, copy, readwrite) NSString *install_time;
|
||||
|
||||
@property (nonatomic, copy) NSDictionary *presetProperties;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TDPresetProperties
|
||||
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self updateValuesWithDictionary:dict];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)updateValuesWithDictionary:(NSDictionary *)dict {
|
||||
_bundle_id = dict[@"#bundle_id"]?:@"";
|
||||
_carrier = dict[@"#carrier"]?:@"";
|
||||
_device_id = dict[@"#device_id"]?:@"";
|
||||
_device_model = dict[@"#device_model"]?:@"";
|
||||
_manufacturer = dict[@"#manufacturer"]?:@"";
|
||||
_network_type = dict[@"#network_type"]?:@"";
|
||||
_os = dict[@"#os"]?:@"";
|
||||
_os_version = dict[@"#os_version"]?:@"";
|
||||
_screen_height = dict[@"#screen_height"]?:@(0);
|
||||
_screen_width = dict[@"#screen_width"]?:@(0);
|
||||
_system_language = dict[@"#system_language"]?:@"";
|
||||
_zone_offset = dict[@"#zone_offset"]?:@(0);
|
||||
_install_time = dict[@"#install_time"]?:@"";
|
||||
|
||||
_presetProperties = [NSDictionary dictionaryWithDictionary:dict];
|
||||
|
||||
NSMutableDictionary *updateProperties = [_presetProperties mutableCopy];
|
||||
NSArray *propertykeys = updateProperties.allKeys;
|
||||
NSArray *registerkeys = [TDPresetProperties disPresetProperties];
|
||||
NSMutableSet *set1 = [NSMutableSet setWithArray:propertykeys];
|
||||
NSMutableSet *set2 = [NSMutableSet setWithArray:registerkeys];
|
||||
[set1 intersectSet:set2];
|
||||
if (set1.allObjects.count) {
|
||||
[updateProperties removeObjectsForKeys:set1.allObjects];
|
||||
}
|
||||
|
||||
if ([updateProperties.allKeys containsObject:@"#lib"]) {
|
||||
[updateProperties removeObjectForKey:@"#lib"];
|
||||
}
|
||||
if ([updateProperties.allKeys containsObject:@"#lib_version"]) {
|
||||
[updateProperties removeObjectForKey:@"#lib_version"];
|
||||
}
|
||||
if ([updateProperties.allKeys containsObject:@"#time_calibration"]) {
|
||||
[updateProperties removeObjectForKey:@"#time_calibration"];
|
||||
}
|
||||
|
||||
_presetProperties = updateProperties;
|
||||
}
|
||||
|
||||
- (NSDictionary *)toEventPresetProperties {
|
||||
return [_presetProperties copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63af3e2b94b0a3f428bf23cb7e8a8f68
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8956e17887d5e364d87791db095f5edf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// TAPresetPropertyPlugin.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
#import "TAPropertyPluginManager.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TAPresetPropertyPlugin : NSObject<TAPropertyPluginProtocol>
|
||||
|
||||
@property(nonatomic, copy)NSString *instanceToken;
|
||||
|
||||
@property (nonatomic, strong) NSTimeZone *defaultTimeZone;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 000e3e0ae2b22e24c8f5a87332343565
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// TAPresetPropertyPlugin.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TAPresetPropertyPlugin.h"
|
||||
#import "TDPresetProperties.h"
|
||||
#import "TDPresetProperties+TDDisProperties.h"
|
||||
#import "TDDeviceInfo.h"
|
||||
#import "TAReachability.h"
|
||||
#import "NSDate+TAFormat.h"
|
||||
|
||||
@interface TAPresetPropertyPlugin ()
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, id> *properties;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TAPresetPropertyPlugin
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.properties = [NSMutableDictionary dictionary];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)start {
|
||||
if (![TDPresetProperties disableAppVersion]) {
|
||||
self.properties[@"#app_version"] = [TDDeviceInfo sharedManager].appVersion;
|
||||
}
|
||||
if (![TDPresetProperties disableBundleId]) {
|
||||
self.properties[@"#bundle_id"] = [TDDeviceInfo bundleId];
|
||||
}
|
||||
|
||||
if (![TDPresetProperties disableInstallTime]) {
|
||||
NSString *timeString = [[TDDeviceInfo td_getInstallTime] ta_formatWithTimeZone:self.defaultTimeZone formatString: @"yyyy-MM-dd HH:mm:ss.SSS"];
|
||||
if (timeString && [timeString isKindOfClass:[NSString class]] && timeString.length){
|
||||
self.properties[@"#install_time"] = timeString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)asyncGetPropertyCompletion:(TAPropertyPluginCompletion)completion {
|
||||
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
|
||||
|
||||
[mutableDict addEntriesFromDictionary:[[TDDeviceInfo sharedManager] getAutomaticData]];
|
||||
|
||||
if (![TDPresetProperties disableNetworkType]) {
|
||||
mutableDict[@"#network_type"] = [[TAReachability shareInstance] networkState];
|
||||
}
|
||||
|
||||
if (completion) {
|
||||
completion(mutableDict);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d82a3ca4f3430e48ba011b309387866
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// TAPropertyPluginManager.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "TABaseEvent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^TAPropertyPluginCompletion)(NSDictionary<NSString *, id> *properties);
|
||||
|
||||
@protocol TAPropertyPluginProtocol <NSObject>
|
||||
|
||||
@property(nonatomic, copy)NSString *instanceToken;
|
||||
|
||||
- (NSDictionary<NSString *, id> *)properties;
|
||||
|
||||
@optional
|
||||
|
||||
- (void)start;
|
||||
|
||||
- (TAEventType)eventTypeFilter;
|
||||
|
||||
- (void)asyncGetPropertyCompletion:(TAPropertyPluginCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface TAPropertyPluginManager : NSObject
|
||||
|
||||
- (void)registerPropertyPlugin:(id<TAPropertyPluginProtocol>)plugin;
|
||||
|
||||
- (NSMutableDictionary<NSString *, id> *)currentPropertiesForPluginClasses:(NSArray<Class> *)classes;
|
||||
|
||||
- (NSMutableDictionary<NSString *, id> *)propertiesWithEventType:(TAEventType)type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b18a39c791368ed428e8fbc76a89de00
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// TAPropertyPluginManager.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Yangxiongon 2022/6/12.
|
||||
//
|
||||
|
||||
#import "TAPropertyPluginManager.h"
|
||||
|
||||
@interface TAPropertyPluginManager ()
|
||||
@property (nonatomic, strong) NSMutableArray<id<TAPropertyPluginProtocol>> *plugins;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation TAPropertyPluginManager
|
||||
|
||||
//MARK: - Public Methods
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.plugins = [NSMutableArray array];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)registerPropertyPlugin:(id<TAPropertyPluginProtocol>)plugin {
|
||||
BOOL isResponds = [plugin respondsToSelector:@selector(properties)];
|
||||
NSAssert(isResponds, @"properties plugin must implement `- properties` method!");
|
||||
if (!isResponds) {
|
||||
return;
|
||||
}
|
||||
|
||||
// delete old plugin
|
||||
for (id<TAPropertyPluginProtocol> object in self.plugins) {
|
||||
if (object.class == plugin.class) {
|
||||
[self.plugins removeObject:object];
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self.plugins addObject:plugin];
|
||||
|
||||
|
||||
if ([plugin respondsToSelector:@selector(start)]) {
|
||||
[plugin start];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *,id> *)currentPropertiesForPluginClasses:(NSArray<Class> *)classes {
|
||||
NSArray *plugins = [self.plugins copy];
|
||||
NSMutableArray<id<TAPropertyPluginProtocol>> *matchResult = [NSMutableArray array];
|
||||
|
||||
for (id<TAPropertyPluginProtocol> obj in plugins) {
|
||||
|
||||
for (Class cla in classes) {
|
||||
if ([obj isKindOfClass:cla]) {
|
||||
[matchResult addObject:obj];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSMutableDictionary *pluginProperties = [self propertiesWithPlugins:matchResult];
|
||||
|
||||
return pluginProperties;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *,id> *)propertiesWithEventType:(TAEventType)type {
|
||||
|
||||
NSArray *plugins = [self.plugins copy];
|
||||
NSMutableArray<id<TAPropertyPluginProtocol>> *matchResult = [NSMutableArray array];
|
||||
for (id<TAPropertyPluginProtocol> obj in plugins) {
|
||||
if ([self isMatchedWithPlugin:obj eventType:type]) {
|
||||
[matchResult addObject:obj];
|
||||
}
|
||||
}
|
||||
return [self propertiesWithPlugins:matchResult];
|
||||
}
|
||||
|
||||
//MARK: - Private Methods
|
||||
|
||||
- (NSMutableDictionary *)propertiesWithPlugins:(NSArray<id<TAPropertyPluginProtocol>> *)plugins {
|
||||
NSMutableDictionary *properties = [NSMutableDictionary dictionary];
|
||||
|
||||
dispatch_semaphore_t semaphore;
|
||||
for (id<TAPropertyPluginProtocol> plugin in plugins) {
|
||||
if ([plugin respondsToSelector:@selector(asyncGetPropertyCompletion:)]) {
|
||||
|
||||
semaphore = dispatch_semaphore_create(0);
|
||||
[plugin asyncGetPropertyCompletion:^(NSDictionary<NSString *,id> * _Nonnull dict) {
|
||||
[properties addEntriesFromDictionary:dict];
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
}];
|
||||
}
|
||||
|
||||
NSDictionary *pluginProperties = [plugin respondsToSelector:@selector(properties)] ? plugin.properties : nil;
|
||||
if (pluginProperties) {
|
||||
[properties addEntriesFromDictionary:pluginProperties];
|
||||
}
|
||||
if (semaphore) {
|
||||
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)));
|
||||
}
|
||||
|
||||
semaphore = nil;
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
- (BOOL)isMatchedWithPlugin:(id<TAPropertyPluginProtocol>)plugin eventType:(TAEventType)type {
|
||||
TAEventType eventTypeFilter;
|
||||
|
||||
if (![plugin respondsToSelector:@selector(eventTypeFilter)]) {
|
||||
// If the plug-in does not implement the type filtering method, it will only be added for track type data by default, including the first event, updateable event, and rewritable event. In addition to user attribute events
|
||||
eventTypeFilter = TAEventTypeTrack | TAEventTypeTrackFirst | TAEventTypeTrackUpdate | TAEventTypeTrackOverwrite;
|
||||
} else {
|
||||
eventTypeFilter = plugin.eventTypeFilter;
|
||||
}
|
||||
|
||||
if ((eventTypeFilter & type) == type) {
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c111649cbe2bc7147ae29d6d1c34414c
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// TASessionIdManager.h
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Charles on 6.12.22.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TASessionIdManager : NSObject
|
||||
|
||||
+ (instancetype)shareInstance;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,33 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dbe7ef45b4d88747904e89fa268be52
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
AddToEmbeddedBinaries: false
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// TASessionIdManager.m
|
||||
// ThinkingSDK
|
||||
//
|
||||
// Created by Charles on 6.12.22.
|
||||
//
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
#import "TASessionIdManager.h"
|
||||
#import "TAAppLifeCycle.h"
|
||||
#import "TDAppState.h"
|
||||
#import "ThinkingAnalyticsSDKPrivate.h"
|
||||
|
||||
@implementation TASessionIdManager
|
||||
|
||||
+ (instancetype)shareInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static id instance = nil;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[[self class] alloc] init];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self registerAppLifeCycleListener];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)registerAppLifeCycleListener {
|
||||
if ([TDAppState runningInAppExtension]) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
|
||||
#if TARGET_OS_IOS
|
||||
|
||||
[notificationCenter addObserver:self selector:@selector(appStateWillChangeNotification:) name:kTAAppLifeCycleStateWillChangeNotification object:nil];
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
- (void)appStateWillChangeNotification:(NSNotification *)notification {
|
||||
TAAppLifeCycleState newState = [[notification.userInfo objectForKey:kTAAppLifeCycleNewStateKey] integerValue];
|
||||
TAAppLifeCycleState oldState = [[notification.userInfo objectForKey:kTAAppLifeCycleOldStateKey] integerValue];
|
||||
|
||||
if (oldState == TAAppLifeCycleStateInit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newState == TAAppLifeCycleStateStart) {
|
||||
@synchronized ([self class]) {
|
||||
[self updateSessionId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateSessionId {
|
||||
// NSMutableDictionary *dic = [ThinkingAnalyticsSDK _getAllInstances];
|
||||
// for (NSString *instanceToken in dic.allKeys) {
|
||||
// ThinkingAnalyticsSDK *instance = dic[instanceToken];
|
||||
// if ([instance isKindOfClass:[ThinkingAnalyticsSDK class]]) {
|
||||
// [instance.sessionidPlugin updateSessionId];
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user