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
f960725e
Commit
f960725e
authored
Nov 16, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 释放问题
parent
581988a9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
23 deletions
+60
-23
project.pbxproj
GYDemo/GYDemo.xcodeproj/project.pbxproj
+3
-3
IOSADManager.h
GYDemo/GYDemo/SCAds/IOSADManager.h
+2
-0
IOSADManager.m
GYDemo/GYDemo/SCAds/IOSADManager.m
+29
-4
AddCSJADManager.m
GYDemo/GYDemo/SCAds/platform/AddCSJADManager.m
+22
-12
AddGDTADManager.m
GYDemo/GYDemo/SCAds/platform/AddGDTADManager.m
+2
-2
AddRuiShiADManager.m
GYDemo/GYDemo/SCAds/platform/AddRuiShiADManager.m
+1
-1
AddSigmobADManager.m
GYDemo/GYDemo/SCAds/platform/AddSigmobADManager.m
+1
-1
No files found.
GYDemo/GYDemo.xcodeproj/project.pbxproj
View file @
f960725e
...
...
@@ -281,14 +281,14 @@
64F89670255FABB800AF9AD7
/* platform */
=
{
isa
=
PBXGroup
;
children
=
(
64F89671255FABB800AF9AD7
/* AddCSJADManager.h */
,
64F89675255FABB800AF9AD7
/* AddCSJADManager.m */
,
64F89674255FABB800AF9AD7
/* AddGDTADManager.h */
,
64F89678255FABB800AF9AD7
/* AddGDTADManager.m */
,
64F89672255FABB800AF9AD7
/* AddRuiShiADManager.h */
,
64F89673255FABB800AF9AD7
/* AddSigmobADManager.m */
,
64F89671255FABB800AF9AD7
/* AddCSJADManager.h */
,
64F89675255FABB800AF9AD7
/* AddCSJADManager.m */
,
64F89676255FABB800AF9AD7
/* AddRuiShiADManager.m */
,
64F89677255FABB800AF9AD7
/* AddSigmobADManager.h */
,
64F89673255FABB800AF9AD7
/* AddSigmobADManager.m */
,
);
path
=
platform
;
sourceTree
=
"<group>"
;
...
...
GYDemo/GYDemo/SCAds/IOSADManager.h
View file @
f960725e
...
...
@@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
retain
)
NSString
*
advertisingSpace
;
// 当前广告位 出入后会在广告展示 结束后上报
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
currentData
;
// 当前广告对象
/// 单利
+
(
IOSADManager
*
)
shareADManager
;
...
...
GYDemo/GYDemo/SCAds/IOSADManager.m
View file @
f960725e
...
...
@@ -38,7 +38,9 @@ static IOSADManager * manager = nil;
}
return
manager
;
}
-
(
void
)
dealloc
{
NSLog
(
@">>>>>>>%@ -- dealloc"
,
self
);
}
// 视频数据
...
...
@@ -258,6 +260,7 @@ static IOSADManager * manager = nil;
AddCSJADManager
*
csjAd
=
[[
AddCSJADManager
alloc
]
init
];
weakSelf
.
csjAd
=
csjAd
;
[
weakSelf
.
loadADDataArray
addObject
:
csjAd
];
NSLog
(
@">>>>>>>%@ alloc codeid = %@"
,
csjAd
,
loadADModel
.
codeId
);
csjAd
.
loadSuccessCallbackBlock
=
^
(
GYAdsTrackModel
*
_Nonnull
model
,
BOOL
success
)
{
[
weakSelf
blockResultLoadWithData
:
model
andSuccess
:
success
];
...
...
@@ -279,6 +282,7 @@ static IOSADManager * manager = nil;
AddGDTADManager
*
csjAd
=
[[
AddGDTADManager
alloc
]
init
];
self
.
gdtAd
=
csjAd
;
[
self
.
loadADDataArray
addObject
:
csjAd
];
NSLog
(
@">>>>>>>%@ alloc codeid = %@"
,
csjAd
,
loadADModel
.
codeId
);
csjAd
.
loadSuccessCallbackBlock
=
^
(
GYAdsTrackModel
*
_Nonnull
model
,
BOOL
success
)
{
...
...
@@ -300,6 +304,7 @@ static IOSADManager * manager = nil;
AddSigmobADManager
*
csjAd
=
[[
AddSigmobADManager
alloc
]
init
];
self
.
sigmobAd
=
csjAd
;
[
self
.
loadADDataArray
addObject
:
csjAd
];
NSLog
(
@">>>>>>>%@ alloc codeid = %@"
,
csjAd
,
loadADModel
.
codeId
);
csjAd
.
loadSuccessCallbackBlock
=
^
(
GYAdsTrackModel
*
_Nonnull
model
,
BOOL
success
)
{
...
...
@@ -322,6 +327,7 @@ static IOSADManager * manager = nil;
AddRuiShiADManager
*
csjAd
=
[[
AddRuiShiADManager
alloc
]
init
];
self
.
ruishiAd
=
csjAd
;
[
self
.
loadADDataArray
addObject
:
csjAd
];
NSLog
(
@">>>>>>>%@ alloc codeid = %@"
,
csjAd
,
loadADModel
.
codeId
);
csjAd
.
loadSuccessCallbackBlock
=
^
(
GYAdsTrackModel
*
_Nonnull
model
,
BOOL
success
)
{
...
...
@@ -703,9 +709,19 @@ static IOSADManager * manager = nil;
}
else
{
[
self
trackingADWith
:
model
.
pullfail_tracking
.
firstObject
];
NSLog
(
@">>>>>>> 缓存 失败 平台 = %@ ID = %@ type= %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
slotName
);
[
self
.
loadADDataArray
removeObject
:
self
.
loadADDataArray
.
firstObject
];
for
(
int
i
=
0
;
i
<
self
.
loadADDataArray
.
count
;
i
++
)
{
IOSADManager
*
adManager
=
[
self
.
loadADDataArray
objectAtIndex
:
i
];
if
([
adManager
.
currentData
isEqual
:
model
]
)
{
[
self
.
loadADDataArray
removeObject
:
adManager
];
continue
;;
}
}
}
}
...
...
@@ -721,6 +737,8 @@ static IOSADManager * manager = nil;
}
else
{
NSLog
(
@">>>>>>> 展示 失败 平台 = %@ ID = %@ %@ type = %@ <<<<<<<<<"
,
model
.
adPlatform
,
model
.
codeId
,
model
.
ADError
,
model
.
slotName
);
[
self
trackingADWith
:
model
.
showfail_tracking
.
firstObject
];
MBProgressHUD
*
hud
=
[
MBProgressHUD
showMessage
:
@"请稍等..."
];
hud
.
minShowTime
=
3
;
}
...
...
@@ -784,7 +802,14 @@ static IOSADManager * manager = nil;
}
[
self
.
loadADDataArray
removeObject
:
self
.
loadADDataArray
.
firstObject
];
for
(
int
i
=
0
;
i
<
self
.
loadADDataArray
.
count
;
i
++
)
{
IOSADManager
*
adManager
=
[
self
.
loadADDataArray
objectAtIndex
:
i
];
if
([
adManager
.
currentData
isEqual
:
model
]
)
{
[
self
.
loadADDataArray
removeObject
:
adManager
];
continue
;;
}
}
}
...
...
GYDemo/GYDemo/SCAds/platform/AddCSJADManager.m
View file @
f960725e
...
...
@@ -11,7 +11,7 @@
@interface
AddCSJADManager
()
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
currentData
;
//
@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property
(
nonatomic
,
copy
)
NSString
*
clk_tracking
;
//防止多次上报点击
...
...
@@ -20,6 +20,9 @@
@implementation
AddCSJADManager
-
(
void
)
loadAdWithData
:(
GYAdsTrackModel
*
)
loadADModel
withADType
:(
eADType
)
AdType
{
self
.
currentData
=
loadADModel
;
...
...
@@ -43,11 +46,11 @@
}
else
if
(
AdType
==
ADType_Video
){
//视频
GYAdsTrackModel
*
oldData
=
[
IOSADManager
shareADManager
].
cachevideo
.
firstObject
;
if
([
oldData
.
adPlatform
isEqualToString
:
@"chuanshanjia"
])
{
self
.
loadSuccessCallbackBlock
(
self
.
currentData
,
NO
);
return
;
}
//
GYAdsTrackModel * oldData = [IOSADManager shareADManager].cachevideo.firstObject;
//
if ([oldData.adPlatform isEqualToString: @"chuanshanjia"]) {
//
self.loadSuccessCallbackBlock(self.currentData, NO);
//
return;
//
}
BURewardedVideoModel
*
rewardedModel
=
[[
BURewardedVideoModel
alloc
]
init
];
rewardedModel
.
userId
=
USERID
;
...
...
@@ -83,13 +86,13 @@
}
else
if
(
adType
==
ADType_Video
){
//视频
if
(
weakSelf
.
rewardedAd
.
isAdValid
)
{
if
([
weakSelf
.
rewardedAd
showAdFromRootViewController
:
[(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
getTopViewController
]
])
{
if
([
weakSelf
.
rewardedAd
showAdFromRootViewController
:
self
.
currentVC
])
{
}
else
{
weakSelf
.
showSuccessCallbackBlock
(
showData
,
NO
);
}
}
else
{
if
([
weakSelf
.
rewardedAd
showAdFromRootViewController
:
[(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
getTopViewController
]
])
{
if
([
weakSelf
.
rewardedAd
showAdFromRootViewController
:
self
.
currentVC
])
{
}
else
{
weakSelf
.
showSuccessCallbackBlock
(
showData
,
NO
);
...
...
@@ -139,7 +142,6 @@
*/
-
(
void
)
splashAdWillVisible
:
(
BUSplashAdView
*
)
splashAd
;{
self
.
showSuccessCallbackBlock
(
self
.
currentData
,
YES
);
// [[CGUserManager shared] addLocCollection:@"splash_display" value:@"splash_display_success"];
// NSString * clkTracking = self.currentData.imp_tracking[0];
...
...
@@ -187,6 +189,8 @@
-
(
void
)
splashAdWillClose
:
(
BUSplashAdView
*
)
splashAd
;{
self
.
splashAd_CSJ
.
hidden
=
YES
;
[
self
.
splashAd_CSJ
removeFromSuperview
];
self
.
showSuccessCallbackBlock
(
self
.
currentData
,
YES
);
}
/**
...
...
@@ -379,16 +383,22 @@
* This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated
*/
-
(
void
)
nativeExpressAdViewRenderSuccess
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
;{
if
(
self
.
currentData
.
loadADType
!=
ADType_BigImage
)
{
self
.
showSuccessCallbackBlock
(
self
.
currentData
,
YES
);
}
}
/**
* This method is called when a nativeExpressAdView failed to render
*/
-
(
void
)
nativeExpressAdViewRenderFail
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
error
:
(
NSError
*
_Nullable
)
error
;{
if
(
self
.
currentData
.
loadADType
!=
ADType_BigImage
)
{
self
.
showSuccessCallbackBlock
(
self
.
currentData
,
NO
);
self
.
currentData
.
ADError
=
error
;
}
}
/**
...
...
GYDemo/GYDemo/SCAds/platform/AddGDTADManager.m
View file @
f960725e
...
...
@@ -10,7 +10,7 @@
@interface
AddGDTADManager
()
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
currentData
;
//
@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property
(
nonatomic
,
copy
)
NSString
*
clk_tracking
;
//防止多次上报点击
...
...
@@ -80,7 +80,7 @@
}
else
if
(
adType
==
ADType_Video
){
//视频
// if (weakSelf.rewardVideoAd.isAdValid && [weakSelf.rewardVideoAd eCPM] > 0) {
if
(
weakSelf
.
rewardVideoAd
.
isAdValid
)
{
if
([
weakSelf
.
rewardVideoAd
showAdFromRootViewController
:
[(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
getTopViewController
]
])
{
if
([
weakSelf
.
rewardVideoAd
showAdFromRootViewController
:
self
.
currentVC
])
{
}
else
{
weakSelf
.
showSuccessCallbackBlock
(
showData
,
NO
);
...
...
GYDemo/GYDemo/SCAds/platform/AddRuiShiADManager.m
View file @
f960725e
...
...
@@ -8,7 +8,7 @@
#import "AddRuiShiADManager.h"
@interface
AddRuiShiADManager
()
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
currentData
;
//
@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property
(
nonatomic
,
copy
)
NSString
*
clk_tracking
;
//防止多次上报点击
...
...
GYDemo/GYDemo/SCAds/platform/AddSigmobADManager.m
View file @
f960725e
...
...
@@ -9,7 +9,7 @@
@interface
AddSigmobADManager
()
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
currentData
;
//
@property (nonatomic ,retain) GYAdsTrackModel * currentData;
@property
(
nonatomic
,
copy
)
NSString
*
clk_tracking
;
//防止多次上报点击
...
...
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