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
2c3ffd58
Commit
2c3ffd58
authored
Nov 12, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改缓存 不连贯的bug
parent
60fcc8e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
IOSADManager.m
GYDemo/GYDemo/SCAds/IOSADManager.m
+22
-10
No files found.
GYDemo/GYDemo/SCAds/IOSADManager.m
View file @
2c3ffd58
...
...
@@ -212,7 +212,7 @@ static IOSADManager * manager = nil;
}
else
{
time
=
5
;
}
// 去加载
// 去加载
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
time
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
self
.
csjAd
=
nil
;
AddCSJADManager
*
csjAd
=
[[
AddCSJADManager
alloc
]
init
];
...
...
@@ -301,12 +301,17 @@ static IOSADManager * manager = nil;
}
else
{
[
adData
.
backups
removeObject
:
adData
.
backups
.
firstObject
];
}
if
(
adData
.
backups
.
count
)
{
[
self
loadAdWithData
:
adData
.
backups
.
firstObject
withADType
:
AdType
];
}
else
{
[
self
.
videoModels
removeObject
:
self
.
videoModels
.
firstObject
];
if
(
self
.
videoModels
.
count
)
{
[
self
loadAdWithData
:
self
.
videoModels
.
firstObject
withADType
:
AdType
];
}
else
{
[
self
requestVideoAD
];
}
}
}
else
if
(
AdType
==
ADType_OpenScreen
){
...
...
@@ -363,10 +368,12 @@ static IOSADManager * manager = nil;
}
else
if
([
showData
.
adPlatform
isEqualToString
:
@"ruishi"
]){
[
self
.
ruishiAd
showAdWithData
:
showData
withADType
:
adType
];
}
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
if
(
self
.
videoModels
.
count
==
1
)
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
requestVideoAD
];
});
}
...
...
@@ -478,12 +485,18 @@ static IOSADManager * manager = nil;
[
models
addObject
:
model
];
}
//添加至 备用数据
[
weakSelf
.
videoModels
removeAllObjects
];
[
weakSelf
.
videoModels
addObjectsFromArray
:
models
];
//有缓存
if
(
weakSelf
.
cachevideo
.
count
<=
1
&&
models
.
count
)
{
if
(
weakSelf
.
cachevideo
.
count
==
0
&&
weakSelf
.
videoModels
>
0
)
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
.
firstObject
withADType
:
ADType_Video
];
}
else
{
if
(
weakSelf
.
videoModels
.
count
>=
2
)
{
[
weakSelf
loadAdWithData
:
weakSelf
.
videoModels
[
1
]
withADType
:
ADType_Video
];
}
else
{
NSLog
(
@">>>>weakSelf.cachevideo == %lu"
,(
unsigned
long
)
weakSelf
.
videoModels
.
count
);
}
}
}
else
{
[[
CGUserManager
shared
]
addLocCollection
:
@"reward_request"
value
:
@"reward_request_failed"
];
...
...
@@ -559,12 +572,11 @@ static IOSADManager * manager = nil;
}
if
(
model
.
loadADType
==
ADType_Video
){
[
weakSelf
clearCache
:
model
];
weakSelf
.
adShowBlock
(
success
);
if
(
success
)
{
[[
CGNetworkTools
shared
]
postWithAction
:
adsEndReport
parameters
:@{}
success
:^
(
id
_Nonnull
response
)
{
}
failure
:^
(
NSError
*
_Nonnull
error
)
{
}];
}
else
{
...
...
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