Commit 141d78de authored by jz's avatar jz

埋点数据增加 uqid

parent 2a14bd2d
...@@ -53,9 +53,21 @@ NSString *const MockCityId = @"beijing"; ...@@ -53,9 +53,21 @@ NSString *const MockCityId = @"beijing";
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
[PhobosUtil getIDFAString:^(NSString *idfa) { [PhobosDevice getIDFAString:^(NSDictionary *idfaDict) {
NSLog(@"%@",idfaDict);
}]; }];
NSLog(@"getIDFA%@\n",[PhobosDevice getIDFA]) ;
;
NSLog(@"getDEVICEID=====%@\n",[PhobosDevice getDEVICEID]) ;
;
NSLog(@"getIDFV%@\n", [PhobosDevice getIDFV]) ;
[PhobosDevice getIDFAString:^(NSDictionary *idfaDict) {
NSLog(@"%@",idfaDict);
}];
} }
......
...@@ -113,9 +113,8 @@ static NewPhobos *_sharedClient; ...@@ -113,9 +113,8 @@ static NewPhobos *_sharedClient;
@"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]), @"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]),
@"run_time": PhobosSafeString([PhobosUtil deviceRunTime]), @"run_time": PhobosSafeString([PhobosUtil deviceRunTime]),
@"uuid": PhobosSafeString([PhobosDevice getDEVICEID]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"idfa": PhobosSafeString([PhobosDevice getIDFA]), @"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"idfv": PhobosSafeString([PhobosDevice getIDFV]), @"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]),
@"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]),
}; };
[NewPhobos track:@"device_opened" attributes:dict sendNow:YES]; [NewPhobos track:@"device_opened" attributes:dict sendNow:YES];
} }
...@@ -214,8 +213,7 @@ static NewPhobos *_sharedClient; ...@@ -214,8 +213,7 @@ static NewPhobos *_sharedClient;
@"total_memory": [PhobosUtil getTotalMemorySize], @"total_memory": [PhobosUtil getTotalMemorySize],
@"run_time": [PhobosUtil deviceRunTime], @"run_time": [PhobosUtil deviceRunTime],
@"uuid": PhobosSafeString([PhobosDevice getDEVICEID]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"idfa": PhobosSafeString([PhobosDevice getIDFA]), @"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"idfv": PhobosSafeString([PhobosDevice getIDFV]),
@"build_version_release": [[UIDevice currentDevice] systemVersion], @"build_version_release": [[UIDevice currentDevice] systemVersion],
}; };
[NewPhobos trackSessionOverWithAttributes:dict]; [NewPhobos trackSessionOverWithAttributes:dict];
...@@ -328,6 +326,7 @@ static NewPhobos *_sharedClient; ...@@ -328,6 +326,7 @@ static NewPhobos *_sharedClient;
[deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getDEVICEID]) forKey:@"device_id"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getDEVICEID]) forKey:@"device_id"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getUQID]) forKey:@"uqid"];
[deviceParams setValue:@"ios" forKey:@"device_type"]; [deviceParams setValue:@"ios" forKey:@"device_type"];
[deviceParams setValue:@"Apple" forKey:@"manufacturer"]; [deviceParams setValue:@"Apple" forKey:@"manufacturer"];
[deviceParams setValue:@(self.gps.coordinate.latitude) forKey:@"lat"]; [deviceParams setValue:@(self.gps.coordinate.latitude) forKey:@"lat"];
......
...@@ -109,6 +109,7 @@ static OldPhobos *sharedClient = nil; ...@@ -109,6 +109,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]), @"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]),
@"run_time": PhobosSafeString([PhobosUtil deviceRunTime]), @"run_time": PhobosSafeString([PhobosUtil deviceRunTime]),
@"uuid": PhobosSafeString([PhobosDevice getDEVICEID]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"idfa": PhobosSafeString([PhobosDevice getIDFA]), @"idfa": PhobosSafeString([PhobosDevice getIDFA]),
@"idfv": PhobosSafeString([PhobosDevice getIDFV]), @"idfv": PhobosSafeString([PhobosDevice getIDFV]),
@"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]), @"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]),
...@@ -212,6 +213,7 @@ static OldPhobos *sharedClient = nil; ...@@ -212,6 +213,7 @@ static OldPhobos *sharedClient = nil;
@"total_memory": [PhobosUtil getTotalMemorySize], @"total_memory": [PhobosUtil getTotalMemorySize],
@"run_time": [PhobosUtil deviceRunTime], @"run_time": [PhobosUtil deviceRunTime],
@"uuid": [PhobosDevice getDEVICEID], @"uuid": [PhobosDevice getDEVICEID],
@"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"build_version_release": [[UIDevice currentDevice] systemVersion], @"build_version_release": [[UIDevice currentDevice] systemVersion],
}; };
[OldPhobos track:@"on_app_session_over" attributes:dict]; [OldPhobos track:@"on_app_session_over" attributes:dict];
...@@ -432,6 +434,7 @@ static OldPhobos *sharedClient = nil; ...@@ -432,6 +434,7 @@ static OldPhobos *sharedClient = nil;
[deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getDEVICEID]) forKey:@"device_id"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getDEVICEID]) forKey:@"device_id"];
[deviceParams setValue:PhobosSafeString([PhobosDevice getUQID]) forKey:@"uqid"];
[deviceParams setValue:@"ios" forKey:@"device_type"]; [deviceParams setValue:@"ios" forKey:@"device_type"];
[deviceParams setValue:@"Apple" forKey:@"manufacturer"]; [deviceParams setValue:@"Apple" forKey:@"manufacturer"];
[deviceParams setValue:@(self.gps.coordinate.latitude) forKey:@"lat"]; [deviceParams setValue:@(self.gps.coordinate.latitude) forKey:@"lat"];
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "PhobosPVProtocol.h" #import "PhobosPVProtocol.h"
#import "PhobosConfig.h" #import "PhobosConfig.h"
#import "PhobosDevice.h"
#import <CoreLocation/CLLocation.h> #import <CoreLocation/CLLocation.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict); typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
@interface PhobosDevice : NSObject @interface PhobosDevice : NSObject
...@@ -21,9 +22,13 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict); ...@@ -21,9 +22,13 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
/// 获取IDFV /// 获取IDFV
+ (NSString *)getIDFV; + (NSString *)getIDFV;
/// 获取DEVICEID,同步获取 取出的是默认第一次的idfv /// 获取DEVICEID,先获取idfa 获取不到会获取钥匙串中idfv 如果没有用idfv 生成
+ (NSString *)getDEVICEID; + (NSString *)getDEVICEID;
/// 获取UQID,同步获取取出的是默认第一次的idfv 如果没有用idfv 生成
+ (NSString *)getUQID;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -84,9 +84,16 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000"; ...@@ -84,9 +84,16 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
return [[[UIDevice currentDevice] identifierForVendor] UUIDString]; return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} }
#pragma mark - getDEVICEID #pragma mark - getDEVICEID
+ (NSString *)getDEVICEID { + (NSString *)getDEVICEID {
NSString *idfa = [self getIDFA];
if (![self checkIdfaIsNull:idfa]) {
idfa = [self getUQID];
}
return idfa;
}
+ (NSString *)getUQID {
NSString *deviceId = [self getKeyChainService:DEVICEID account:keyChainAccount]; NSString *deviceId = [self getKeyChainService:DEVICEID account:keyChainAccount];
if ([self checkIdfaIsNull:deviceId]) { if ([self checkIdfaIsNull:deviceId]) {
deviceId = [self getIDFV]; deviceId = [self getIDFV];
......
...@@ -227,16 +227,6 @@ ...@@ -227,16 +227,6 @@
return [str length] > 0; return [str length] > 0;
} }
//+ (NSString *)deviceId {
// NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
// NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
//
// if (idfa != nil && ![idfa isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
// return idfa;
// }
//
// return idfv;
//}
+ (NSString *)getIPAddress:(BOOL)preferIPv4 { + (NSString *)getIPAddress:(BOOL)preferIPv4 {
NSArray *searchArray = preferIPv4 ? NSArray *searchArray = preferIPv4 ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment