Skip to content

Commit 3bbcb9b

Browse files
committed
Refac iad v3 logic
1 parent 43cae88 commit 3bbcb9b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Adjust/ADJAdditions/UIDevice+ADJAdditions.m

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,19 @@ - (void) adjSetIad:(ADJActivityHandler *) activityHandler
167167
if (ADClientSharedClientInstance == nil) {
168168
return;
169169
}
170-
BOOL iadv3Succes = NO;
171-
if (triesV3Left > 0) {
172-
// [[ADClient sharedClient] requestAttributionDetailsWithBlock:...]
173-
iadv3Succes = [self adjSetIadWithDetails:activityHandler
170+
171+
// if no tries for iad v3 left -> iad v2
172+
if (triesV3Left == 0) {
173+
[self adjSetIadWithDates:activityHandler ADClientSharedClientInstance:ADClientSharedClientInstance];
174+
return;
175+
}
176+
177+
BOOL isIadV3Avaliable = [self adjSetIadWithDetails:activityHandler
174178
ADClientSharedClientInstance:ADClientSharedClientInstance
175179
retriesLeft:(triesV3Left - 1)];
176-
}
177-
if (!iadv3Succes) {
178-
// [[ADClient sharedClient] lookupAdConversionDetails:...]
180+
181+
// if no tries for iad v3 left -> iad v2
182+
if (!isIadV3Avaliable) {
179183
[self adjSetIadWithDates:activityHandler ADClientSharedClientInstance:ADClientSharedClientInstance];
180184
}
181185
#pragma clang diagnostic pop

0 commit comments

Comments
 (0)