Commit 2aac98e8 authored by jz's avatar jz

bugfix

parent 4a8352ef
...@@ -110,8 +110,6 @@ static OldPhobos *sharedClient = nil; ...@@ -110,8 +110,6 @@ static OldPhobos *sharedClient = nil;
@"run_time": PhobosSafeString([PhobosUtil deviceRunTime]), @"run_time": PhobosSafeString([PhobosUtil deviceRunTime]),
@"uuid": PhobosSafeString([PhobosDevice getDEVICEID]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"uqid": PhobosSafeString([PhobosDevice getUQID]), @"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"idfa": PhobosSafeString([PhobosDevice getIDFA]),
@"idfv": PhobosSafeString([PhobosDevice getIDFV]),
@"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]), @"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]),
}; };
[OldPhobos track:@"device_opened" attributes:dict sendNow:YES]; [OldPhobos track:@"device_opened" attributes:dict sendNow:YES];
......
...@@ -28,6 +28,7 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000"; ...@@ -28,6 +28,7 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
//直接从钥匙串中获取 //直接从钥匙串中获取
NSString *keyChainIDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString; NSString *keyChainIDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString;
if ([self checkIdfaIsNull:keyChainIDFA]) { if ([self checkIdfaIsNull:keyChainIDFA]) {
//如果为空从钥匙串中取获取
keyChainIDFA = [self getKeyChainService:IDFA account:keyChainAccount]; keyChainIDFA = [self getKeyChainService:IDFA account:keyChainAccount];
} else { } else {
//如果获取到存储到钥匙串中 //如果获取到存储到钥匙串中
...@@ -99,10 +100,11 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000"; ...@@ -99,10 +100,11 @@ 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]; NSString *idfa = [self getIDFA];
if (![self checkIdfaIsNull:idfa]) { if ([self checkIdfaIsNull:idfa]) {
idfa = [self getUQID]; idfa = [self getUQID];
} }
return idfa; return idfa;
...@@ -117,6 +119,7 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000"; ...@@ -117,6 +119,7 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
return deviceId; return deviceId;
} }
#pragma mark - 钥匙串封装 #pragma mark - 钥匙串封装
+ (void)saveKeyChainWithValue:(NSString *)value service:(NSString *)service account:(NSString *)account { + (void)saveKeyChainWithValue:(NSString *)value service:(NSString *)service account:(NSString *)account {
[SAMKeychain setPassword:value forService:service account:account]; [SAMKeychain setPassword:value forService:service account:account];
......
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