Commit 8137276c authored by 乔金柱's avatar 乔金柱

Merge branch 'jz/master' into 'master'

获取idfa 钥匙串

See merge request !72
parents 0418bbd6 83909d1a
...@@ -441,6 +441,7 @@ ...@@ -441,6 +441,7 @@
"${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework", "${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework",
"${BUILT_PRODUCTS_DIR}/GMPhobos/GMPhobos.framework", "${BUILT_PRODUCTS_DIR}/GMPhobos/GMPhobos.framework",
"${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
"${BUILT_PRODUCTS_DIR}/SAMKeychain/SAMKeychain.framework",
"${BUILT_PRODUCTS_DIR}/TMCache/TMCache.framework", "${BUILT_PRODUCTS_DIR}/TMCache/TMCache.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
...@@ -449,6 +450,7 @@ ...@@ -449,6 +450,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMCache.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMCache.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMPhobos.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GMPhobos.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SAMKeychain.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TMCache.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TMCache.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSUserTrackingUsageDescription</key>
<string>申请使用idfa</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
......
...@@ -52,6 +52,22 @@ NSString *const MockCityId = @"beijing"; ...@@ -52,6 +52,22 @@ NSString *const MockCityId = @"beijing";
_tableView.dataSource = self; _tableView.dataSource = self;
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
// [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);
// }];
} }
......
...@@ -4,11 +4,13 @@ PODS: ...@@ -4,11 +4,13 @@ PODS:
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- GMCache (1.0.1): - GMCache (1.0.1):
- TMCache (= 2.1.0) - TMCache (= 2.1.0)
- GMPhobos (3.0.0): - GMPhobos (3.0.1):
- FMDB - FMDB
- GMCache - GMCache
- MJExtension - MJExtension
- SAMKeychain
- MJExtension (3.2.1) - MJExtension (3.2.1)
- SAMKeychain (1.5.3)
- TMCache (2.1.0) - TMCache (2.1.0)
DEPENDENCIES: DEPENDENCIES:
...@@ -20,6 +22,7 @@ SPEC REPOS: ...@@ -20,6 +22,7 @@ SPEC REPOS:
https://github.com/CocoaPods/Specs.git: https://github.com/CocoaPods/Specs.git:
- FMDB - FMDB
- MJExtension - MJExtension
- SAMKeychain
- TMCache - TMCache
EXTERNAL SOURCES: EXTERNAL SOURCES:
...@@ -29,8 +32,9 @@ EXTERNAL SOURCES: ...@@ -29,8 +32,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GMCache: b78d8e46db864405e91d226ce640cc80d966c611 GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMPhobos: 77ef31a7d5d8e183f40b022d613d5fefc4f9b981 GMPhobos: 5218b3f57cc68aab78e6fc309c58a2290d625698
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545 MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: ea0fac2144ac80baf8f21576cde49526c19991ad PODFILE CHECKSUM: ea0fac2144ac80baf8f21576cde49526c19991ad
......
...@@ -28,6 +28,7 @@ Pod::Spec.new do |s| ...@@ -28,6 +28,7 @@ Pod::Spec.new do |s|
s.dependency 'MJExtension' s.dependency 'MJExtension'
s.dependency 'FMDB' s.dependency 'FMDB'
s.library = 'z' s.library = 'z'
s.dependency 'SAMKeychain'
# s.resource = 'GMPhobos/*.xcdatamodeld' # s.resource = 'GMPhobos/*.xcdatamodeld'
end end
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import <mach/mach_time.h> #import <mach/mach_time.h>
#import "PhobosDataManager.h" #import "PhobosDataManager.h"
#import "PhobosSendManager.h" #import "PhobosSendManager.h"
#import "PhobosDevice.h"
static NewPhobos *_sharedClient; static NewPhobos *_sharedClient;
...@@ -111,8 +112,9 @@ static NewPhobos *_sharedClient; ...@@ -111,8 +112,9 @@ static NewPhobos *_sharedClient;
@"phone_operator": PhobosSafeString([PhobosUtil getTelephonyInfo]), @"phone_operator": PhobosSafeString([PhobosUtil getTelephonyInfo]),
@"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]), @"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]),
@"run_time": PhobosSafeString([PhobosUtil deviceRunTime]), @"run_time": PhobosSafeString([PhobosUtil deviceRunTime]),
@"uuid": PhobosSafeString([PhobosUtil deviceId]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]), @"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"build_version_release": PhobosSafeString([[UIDevice currentDevice] systemVersion]),
}; };
[NewPhobos track:@"device_opened" attributes:dict sendNow:YES]; [NewPhobos track:@"device_opened" attributes:dict sendNow:YES];
} }
...@@ -210,7 +212,8 @@ static NewPhobos *_sharedClient; ...@@ -210,7 +212,8 @@ static NewPhobos *_sharedClient;
@"phone_operator": [PhobosUtil getTelephonyInfo], @"phone_operator": [PhobosUtil getTelephonyInfo],
@"total_memory": [PhobosUtil getTotalMemorySize], @"total_memory": [PhobosUtil getTotalMemorySize],
@"run_time": [PhobosUtil deviceRunTime], @"run_time": [PhobosUtil deviceRunTime],
@"uuid": [PhobosUtil deviceId], @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"build_version_release": [[UIDevice currentDevice] systemVersion], @"build_version_release": [[UIDevice currentDevice] systemVersion],
}; };
[NewPhobos trackSessionOverWithAttributes:dict]; [NewPhobos trackSessionOverWithAttributes:dict];
...@@ -320,9 +323,10 @@ static NewPhobos *_sharedClient; ...@@ -320,9 +323,10 @@ static NewPhobos *_sharedClient;
NSString *currentTime = [PhobosUtil currentTime]; NSString *currentTime = [PhobosUtil currentTime];
NSMutableDictionary *deviceParams = [NSMutableDictionary new]; NSMutableDictionary *deviceParams = [NSMutableDictionary new];
[deviceParams setValue:PhobosSafeString([[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]) forKey:@"idfa"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"];
[deviceParams setValue:PhobosSafeString([[[UIDevice currentDevice] identifierForVendor] UUIDString]) forKey:@"idfv"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"];
[deviceParams setValue:PhobosSafeString([PhobosUtil deviceId]) 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"];
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "UIResponder+PhobosPV.h" #import "UIResponder+PhobosPV.h"
#import "PhobosUtil.h" #import "PhobosUtil.h"
#import "PhobosCustomVisibleController.h" #import "PhobosCustomVisibleController.h"
#import "PhobosDevice.h"
#import <GMCache/GMCache.h> #import <GMCache/GMCache.h>
#import <mach/mach_time.h> #import <mach/mach_time.h>
...@@ -98,14 +99,17 @@ static OldPhobos *sharedClient = nil; ...@@ -98,14 +99,17 @@ static OldPhobos *sharedClient = nil;
- (void)handleEventDeviceOpened{ - (void)handleEventDeviceOpened{
/** 每次打开APP埋点 **/ /** 每次打开APP埋点 **/
// [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"];
// [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"];
// [deviceParams setValue:PhobosSafeString([PhobosDevice getDEVICEID]) forKey:@"device_id"];
NSDictionary *dict = @{@"build_cpu_abi": PhobosSafeString([PhobosUtil currentDeviceCPUType]), NSDictionary *dict = @{@"build_cpu_abi": PhobosSafeString([PhobosUtil currentDeviceCPUType]),
@"cpu_count": PhobosSafeString([PhobosUtil currentDeviceCPUCount]), @"cpu_count": PhobosSafeString([PhobosUtil currentDeviceCPUCount]),
@"mac_address": PhobosSafeString([PhobosUtil getMacAddress]), @"mac_address": PhobosSafeString([PhobosUtil getMacAddress]),
@"phone_operator": PhobosSafeString([PhobosUtil getTelephonyInfo]), @"phone_operator": PhobosSafeString([PhobosUtil getTelephonyInfo]),
@"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]), @"total_memory": PhobosSafeString([PhobosUtil getTotalMemorySize]),
@"run_time": PhobosSafeString([PhobosUtil deviceRunTime]), @"run_time": PhobosSafeString([PhobosUtil deviceRunTime]),
@"uuid": PhobosSafeString([PhobosUtil deviceId]), @"uuid": PhobosSafeString([PhobosDevice getDEVICEID]),
@"uqid": PhobosSafeString([PhobosDevice getUQID]),
@"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];
...@@ -206,7 +210,8 @@ static OldPhobos *sharedClient = nil; ...@@ -206,7 +210,8 @@ static OldPhobos *sharedClient = nil;
@"phone_operator": [PhobosUtil getTelephonyInfo], @"phone_operator": [PhobosUtil getTelephonyInfo],
@"total_memory": [PhobosUtil getTotalMemorySize], @"total_memory": [PhobosUtil getTotalMemorySize],
@"run_time": [PhobosUtil deviceRunTime], @"run_time": [PhobosUtil deviceRunTime],
@"uuid": [PhobosUtil deviceId], @"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];
...@@ -424,9 +429,10 @@ static OldPhobos *sharedClient = nil; ...@@ -424,9 +429,10 @@ static OldPhobos *sharedClient = nil;
@try { @try {
NSString *currentTime = [PhobosUtil currentTime]; NSString *currentTime = [PhobosUtil currentTime];
NSMutableDictionary *deviceParams = [NSMutableDictionary new]; NSMutableDictionary *deviceParams = [NSMutableDictionary new];
[deviceParams setValue:PhobosSafeString([[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]) forKey:@"idfa"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFA]) forKey:@"idfa"];
[deviceParams setValue:PhobosSafeString([[[UIDevice currentDevice] identifierForVendor] UUIDString]) forKey:@"idfv"]; [deviceParams setValue:PhobosSafeString([PhobosDevice getIDFV]) forKey:@"idfv"];
[deviceParams setValue:PhobosSafeString([PhobosUtil deviceId]) 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
......
//
// PhobosDevice.h
// GMPhobos
//
// Created by Q14 on 2020/9/22.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
@interface PhobosDevice : NSObject
/// 获取IDFA,同步获取 从钥匙串中获取
+ (NSString *)getIDFA;
/// 获取IDFA,异步获取IDFA 适配 ATTrackingManager的时候再打开
//+ (void)getIDFAString:(PhobosGetIDFACompleteBlock)completeBlock;
/// 获取IDFV
+ (NSString *)getIDFV;
/// 获取DEVICEID,先获取idfa 获取不到会获取钥匙串中idfv 如果没有用idfv 生成
+ (NSString *)getDEVICEID;
/// 获取UQID,同步获取取出的是默认第一次的idfv 如果没有用idfv 生成
+ (NSString *)getUQID;
@end
NS_ASSUME_NONNULL_END
//
// PhobosDevice.m
// GMPhobos
//
// Created by Q14 on 2020/9/22.
//
#import "PhobosDevice.h"
#import <AdSupport/ASIdentifierManager.h>
#import <SAMKeychain/SAMKeychain.h>
//#import <AppTrackingTransparency/AppTrackingTransparency.h>
//钥匙串账户
NSString *const keyChainAccount = @"com.wanmeizhensuo.ZhengXing.phobos.keychain";
//钥匙串账户 表示device_id
NSString *const DEVICEID = @"device_id";
//钥匙串账户 表示idfa
NSString *const IDFA = @"idfa";
// 默认获取不到的idfa
NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
@implementation PhobosDevice
#pragma mark - getIDFA
//同步获取IDFA 直接从钥匙串中获取 适配ATTrackingManagerAuthorization可使用下面方法
+ (NSString *)getIDFA {
//直接从钥匙串中获取
NSString *keyChainIDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString;
if ([self checkIdfaIsNull:keyChainIDFA]) {
//如果为空从钥匙串中取获取
keyChainIDFA = [self getKeyChainService:IDFA account:keyChainAccount];
} else {
//如果获取到存储到钥匙串中
[self saveKeyChainWithValue:keyChainIDFA service:IDFA account:keyChainAccount];
}
if (!keyChainIDFA) {
keyChainIDFA = defaultIDFA;
}
return keyChainIDFA;
}
/** iOS 14 适配 ATTrackingManagerAuthorizationStatus
//同步获取IDFA 直接从钥匙串中获取
+ (NSString *)getIDFA {
//直接从钥匙串中获取
NSString *keyChainIDFA = [self getKeyChainService:IDFA account:keyChainAccount];
//判断获取的钥匙串是否为空
if ([self checkIdfaIsNull:keyChainIDFA]) {
if (@available(iOS 14, *)) {
// 如果是iOS14 未从钥匙串中获取到idfa直接按默认的
keyChainIDFA = defaultIDFA;
} else {
keyChainIDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString;
if ([self checkIdfaIsNull:keyChainIDFA]) {
[self saveKeyChainWithValue:keyChainIDFA service:IDFA account:keyChainAccount];
}
}
}
return keyChainIDFA;
}
//同步获取IDFA
+ (void)getIDFAString:(PhobosGetIDFACompleteBlock)completeBlock {
if (@available(iOS 14, *)) {
__block NSString *idfaString = @"";
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
BOOL isAuthor = NO;
if (status == ATTrackingManagerAuthorizationStatusAuthorized) {
isAuthor = YES;
idfaString = [[ASIdentifierManager sharedManager] advertisingIdentifier].UUIDString;
}
if (![self checkIdfaIsNull:idfaString]) {
[self saveKeyChainWithValue:idfaString service:IDFA account:keyChainAccount];
}
completeBlock(@{@"idfa": idfaString, @"is_author": @(isAuthor)});
}];
} else {
// 使用原方式访问IDFA
NSString *idfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
BOOL isAuthor = NO;
if (![self checkIdfaIsNull:idfaString]) {
isAuthor = YES;
[self saveKeyChainWithValue:idfaString service:IDFA account:keyChainAccount];
}
completeBlock(@{@"idfa": idfaString, @"is_author": @(isAuthor)});
}
}
*/
#pragma mark - 对IDFA判空处理
//检查idfa 是否为空
+ (BOOL)checkIdfaIsNull:(NSString *)idfa {
return !idfa || [idfa isEqualToString:@"00000000-0000-0000-0000-000000000000"];
}
#pragma mark - getIDFV
+ (NSString *)getIDFV {
return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
}
#pragma mark - 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];
if ([self checkIdfaIsNull:deviceId]) {
deviceId = [self getIDFV];
[self saveKeyChainWithValue:deviceId service:DEVICEID account:keyChainAccount];
}
return deviceId;
}
#pragma mark - 钥匙串封装
+ (void)saveKeyChainWithValue:(NSString *)value service:(NSString *)service account:(NSString *)account {
[SAMKeychain setPassword:value forService:service account:account];
[SAMKeychain setAccessibilityType:kSecAttrAccessibleAlwaysThisDeviceOnly];
}
//根据 service 与账户keyChain 获取存储的值
+ (NSString *)getKeyChainService:(NSString *)service account:(NSString *)account {
return [SAMKeychain passwordForService:service account:account];
}
@end
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
typedef void (^SendDataSuccessBlock)(NSInteger code); typedef void (^SendDataSuccessBlock)(NSInteger code);
@interface PhobosUtil : NSObject @interface PhobosUtil : NSObject
/** /**
...@@ -52,7 +53,7 @@ typedef void (^SendDataSuccessBlock)(NSInteger code); ...@@ -52,7 +53,7 @@ typedef void (^SendDataSuccessBlock)(NSInteger code);
+ (NSString *)getAppVersion; + (NSString *)getAppVersion;
+ (BOOL)isNonEmpty:(NSString *)string; + (BOOL)isNonEmpty:(NSString *)string;
+ (NSData *)encodeJSON:(id)obj; + (NSData *)encodeJSON:(id)obj;
+ (NSString *)deviceId; //+ (NSString *)deviceId;
/** 获取手机型号 */ /** 获取手机型号 */
+ (NSString *)platform; + (NSString *)platform;
/** /**
...@@ -107,5 +108,4 @@ typedef void (^SendDataSuccessBlock)(NSInteger code); ...@@ -107,5 +108,4 @@ typedef void (^SendDataSuccessBlock)(NSInteger code);
* @since 5.9.3 * @since 5.9.3
*/ */
+ (NSString *)convertToJsonString:(id)object; + (NSString *)convertToJsonString:(id)object;
@end @end
...@@ -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