Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
c8f1b034
Commit
c8f1b034
authored
Sep 22, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upate
parent
141d78de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
PhobosDevice.h
GMPhobos/Classes/PhobosDevice.h
+2
-2
PhobosDevice.m
GMPhobos/Classes/PhobosDevice.m
+16
-1
No files found.
GMPhobos/Classes/PhobosDevice.h
View file @
c8f1b034
...
...
@@ -16,8 +16,8 @@ typedef void (^PhobosGetIDFACompleteBlock)(NSDictionary *dict);
/// 获取IDFA,同步获取 从钥匙串中获取
+
(
NSString
*
)
getIDFA
;
/// 获取IDFA,异步获取IDFA
+
(
void
)
getIDFAString
:(
PhobosGetIDFACompleteBlock
)
completeBlock
;
/// 获取IDFA,异步获取IDFA
适配 ATTrackingManager的时候再打开
//
+ (void)getIDFAString:(PhobosGetIDFACompleteBlock)completeBlock;
/// 获取IDFV
+
(
NSString
*
)
getIDFV
;
...
...
GMPhobos/Classes/PhobosDevice.m
View file @
c8f1b034
...
...
@@ -23,7 +23,21 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
#pragma mark - getIDFA
//同步获取IDFA 直接从钥匙串中获取
//同步获取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
];
}
return
keyChainIDFA
;
}
/** iOS 14 适配 ATTrackingManagerAuthorizationStatus
//同步获取IDFA 直接从钥匙串中获取
+ (NSString *)getIDFA {
//直接从钥匙串中获取
NSString *keyChainIDFA = [self getKeyChainService:IDFA account:keyChainAccount];
...
...
@@ -71,6 +85,7 @@ NSString *defaultIDFA = @"00000000-0000-0000-0000-000000000000";
completeBlock(@{@"idfa": idfaString, @"is_author": @(isAuthor)});
}
}
*/
#pragma mark - 对IDFA判空处理
//检查idfa 是否为空
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment