Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckFarm
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
LuckFarm
Commits
ed7779db
Commit
ed7779db
authored
Nov 13, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改缓存 特殊情况的 不连贯问题
parent
ba8ac267
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
IOSADManager.m
GYDemo/GYDemo/SCAds/IOSADManager.m
+15
-7
No files found.
GYDemo/GYDemo/SCAds/IOSADManager.m
View file @
ed7779db
...
@@ -311,7 +311,9 @@ static IOSADManager * manager = nil;
...
@@ -311,7 +311,9 @@ static IOSADManager * manager = nil;
}
else
{
}
else
{
if
(
AdType
==
ADType_Video
)
{
// 视频
if
(
AdType
==
ADType_Video
)
{
// 视频
GYAdsTrackModel
*
adData
=
self
.
videoModels
.
firstObject
;
GYAdsTrackModel
*
adData
=
loadADModel
;
NSLog
(
@">>>>>>> 缓存 失败 %@ 不支持"
,
adData
.
adPlatform
);
if
(
adData
.
firstFailure
==
NO
)
{
if
(
adData
.
firstFailure
==
NO
)
{
adData
.
firstFailure
=
YES
;
adData
.
firstFailure
=
YES
;
}
else
{
}
else
{
...
@@ -320,7 +322,7 @@ static IOSADManager * manager = nil;
...
@@ -320,7 +322,7 @@ static IOSADManager * manager = nil;
if
(
adData
.
backups
.
count
)
{
if
(
adData
.
backups
.
count
)
{
[
self
loadAdWithData
:
adData
.
backups
.
firstObject
withADType
:
AdType
];
[
self
loadAdWithData
:
adData
.
backups
.
firstObject
withADType
:
AdType
];
}
else
{
}
else
{
[
self
.
videoModels
removeObject
:
self
.
videoModels
.
firstObject
];
[
self
.
videoModels
removeObject
:
loadADModel
];
if
(
self
.
videoModels
.
count
)
{
if
(
self
.
videoModels
.
count
)
{
[
self
loadAdWithData
:
self
.
videoModels
.
firstObject
withADType
:
AdType
];
[
self
loadAdWithData
:
self
.
videoModels
.
firstObject
withADType
:
AdType
];
...
@@ -384,10 +386,13 @@ static IOSADManager * manager = nil;
...
@@ -384,10 +386,13 @@ static IOSADManager * manager = nil;
}
else
if
([
showData
.
adPlatform
isEqualToString
:
@"ruishi"
]){
}
else
if
([
showData
.
adPlatform
isEqualToString
:
@"ruishi"
]){
[
self
.
ruishiAd
showAdWithData
:
showData
withADType
:
adType
];
[
self
.
ruishiAd
showAdWithData
:
showData
withADType
:
adType
];
}
}
if
(
self
.
videoModels
.
count
<=
1
)
{
if
(
self
.
videoModels
.
count
<=
1
)
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
requestVideoAD
];
[
weakSelf
requestVideoAD
];
});
});
}
else
{
[
self
loadAdWithData
:
self
.
videoModels
[
1
]
withADType
:
ADType_Video
];
}
}
}
else
if
(
adType
==
ADType_BigImage
){
//大图
}
else
if
(
adType
==
ADType_BigImage
){
//大图
...
@@ -526,15 +531,18 @@ static IOSADManager * manager = nil;
...
@@ -526,15 +531,18 @@ static IOSADManager * manager = nil;
[
weakSelf
.
videoModels
addObjectsFromArray
:
models
];
[
weakSelf
.
videoModels
addObjectsFromArray
:
models
];
//有缓存
//有缓存
if
(
weakSelf
.
cachevideo
.
count
==
0
&&
weakSelf
.
videoModels
.
count
==
1
)
{
if
(
weakSelf
.
cachevideo
.
count
<=
1
)
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
.
firstObject
withADType
:
ADType_Video
];
if
(
weakSelf
.
videoModels
.
count
>
1
)
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
[
1
]
withADType
:
ADType_Video
];
}
else
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
.
firstObject
withADType
:
ADType_Video
];
}
}
else
{
}
else
{
if
(
weakSelf
.
videoModels
.
count
>=
2
)
{
if
(
weakSelf
.
videoModels
.
count
>=
2
)
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
[
1
]
withADType
:
ADType_Video
];
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
[
1
]
withADType
:
ADType_Video
];
}
else
{
}
else
{
NSLog
(
@">>>>weakSelf.cachevideo == %lu"
,(
unsigned
long
)
weakSelf
.
videoModels
.
count
);
NSLog
(
@">>>>weakSelf.cachevideo == %lu"
,(
unsigned
long
)
weakSelf
.
videoModels
.
count
);
}
}
}
}
}
else
{
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_request_failed"
];
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_request_failed"
];
...
@@ -616,11 +624,11 @@ static IOSADManager * manager = nil;
...
@@ -616,11 +624,11 @@ static IOSADManager * manager = nil;
-
(
void
)
blockResultShowWithData
:
(
GYAdsTrackModel
*
)
model
andSuccess
:
(
BOOL
)
success
;{
-
(
void
)
blockResultShowWithData
:
(
GYAdsTrackModel
*
)
model
andSuccess
:
(
BOOL
)
success
;{
WEAKSELF
;
WEAKSELF
;
if
(
success
)
{
//埋点
if
(
success
)
{
//埋点
NSLog
(
@">>>>>>>
缓存
成功 平台 = %@ ID = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
);
NSLog
(
@">>>>>>>
展示
成功 平台 = %@ ID = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
);
[
self
trackingADWith
:
model
.
imp_tracking
.
firstObject
];
[
self
trackingADWith
:
model
.
imp_tracking
.
firstObject
];
[
self
trackingADWith
:
model
.
playcomplete_trackings
.
firstObject
];
[
self
trackingADWith
:
model
.
playcomplete_trackings
.
firstObject
];
}
else
{
}
else
{
NSLog
(
@">>>>>>>
缓存
失败 平台 = %@ ID = %@ %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
ADError
);
NSLog
(
@">>>>>>>
展示
失败 平台 = %@ ID = %@ %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
ADError
);
[
self
trackingADWith
:
model
.
showfail_tracking
.
firstObject
];
[
self
trackingADWith
:
model
.
showfail_tracking
.
firstObject
];
}
}
...
...
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