Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_flowbox
Commits
7d00f0f5
Commit
7d00f0f5
authored
Jul 27, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
482672df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
44 deletions
+49
-44
PreCsjGroMoreVideoAdManager.java
...m/mints/flowbox/ad/video/PreCsjGroMoreVideoAdManager.java
+49
-44
No files found.
app/src/main/java/com/mints/flowbox/ad/video/PreCsjGroMoreVideoAdManager.java
View file @
7d00f0f5
...
...
@@ -46,6 +46,10 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
private
long
adLoadTime
=
0
;
// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private
long
adPreingTime
=
0
;
// 防止预加载超时 2分钟
private
String
adcode
=
""
;
private
String
ecpm
=
""
;
private
int
adSource
=
0
;
public
static
PreCsjGroMoreVideoAdManager
getInstance
()
{
if
(
_inst
==
null
)
{
_inst
=
new
PreCsjGroMoreVideoAdManager
();
...
...
@@ -138,13 +142,6 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
//该方法直接展示广告
//展示广告,并传入广告展示的场景
mttRewardAd
.
showRewardAd
(
this
.
activity
.
get
(),
mTTRewardedAdListener
);
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"adcode"
,
mttRewardAd
.
getAdNetworkRitId
());
vo
.
put
(
"ecpm"
,
mttRewardAd
.
getPreEcpm
());
vo
.
put
(
"adSource"
,
mttRewardAd
.
getAdNetworkPlatformId
());
vo
.
put
(
"carrierType"
,
carrierType
);
TrackManager
.
getInstance
().
reporGromeEcpm
(
vo
);
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
LogUtil
.
d
(
TAG
,
"5、展示广告时失败了,广告可能超时45分钟 onError "
);
...
...
@@ -235,6 +232,18 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 广告的展示回调 每个广告仅回调一次
*/
public
void
onRewardedAdShow
()
{
if
(
mttRewardAd
!=
null
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
adcode
=
mttRewardAd
.
getAdNetworkRitId
();
ecpm
=
mttRewardAd
.
getPreEcpm
();
adSource
=
mttRewardAd
.
getAdNetworkPlatformId
();
vo
.
put
(
"adcode"
,
adcode
);
vo
.
put
(
"ecpm"
,
ecpm
);
vo
.
put
(
"adSource"
,
adSource
);
vo
.
put
(
"carrierType"
,
carrierType
);
TrackManager
.
getInstance
().
reporGromeEcpm
(
vo
);
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
);
preLoadAd
(
activity
.
get
());
...
...
@@ -272,46 +281,42 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
HashMap
<
String
,
Object
>
voTemp
=
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_GROMORE
,
extraId
,
curCoin
);
if
(
mttRewardAd
!=
null
)
{
String
groAdsouce
=
String
.
valueOf
(
mttRewardAd
.
getAdNetworkPlatformId
());
switch
(
mttRewardAd
.
getAdNetworkPlatformId
())
{
case
1
:
groAdsouce
=
"CSJ"
;
break
;
case
3
:
groAdsouce
=
"YLH"
;
break
;
case
7
:
groAdsouce
=
"KS"
;
break
;
}
voTemp
.
put
(
"gromoreAdsource"
,
groAdsouce
);
voTemp
.
put
(
"ecpmId"
,
AppConfig
.
gromoreId
);
String
groAdsouce
=
String
.
valueOf
(
adSource
);
switch
(
adSource
)
{
case
1
:
groAdsouce
=
"CSJ"
;
break
;
case
3
:
groAdsouce
=
"YLH"
;
break
;
case
7
:
groAdsouce
=
"KS"
;
break
;
}
voTemp
.
put
(
"gromoreAdsource"
,
groAdsouce
);
voTemp
.
put
(
"ecpmId"
,
AppConfig
.
gromoreId
);
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
.
get
(),
voTemp
);
if
(
mttRewardAd
!=
null
)
{
/**
* SDK_NAME_NO_PERMISSION = -3; //无权限
* * SDK_NAME_NO_DATA = -2; //暂无数据
* * SDK_NAME_PANGLE = 1;
* * SDK_NAME_ADMOB = 2;
* * SDK_NAME_GDT = 3;
* * SDK_NAME_MT = 4;
* * SDK_NAME_UNITY = 5;
* * SDK_NAME_BAIDU = 6;
* * SDK_NAME_KS = 7;
* * SDK_NAME_SIGMOB = 8;
*/
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"adcode"
,
mttRewardAd
.
getAdNetworkRitId
());
vo
.
put
(
"ecpm"
,
mttRewardAd
.
getPreEcpm
());
vo
.
put
(
"adSource"
,
mttRewardAd
.
getAdNetworkPlatformId
());
vo
.
put
(
"adType"
,
Constant
.
GRO_MORE_ADTYPE2
);
vo
.
put
(
"ecpmId"
,
AppConfig
.
gromoreId
);
vo
.
put
(
"adid"
,
CsjGroMoreManager
.
INSTANCE
.
getAPP_IN_MAIN_AD_UNIT_VIDEO_ID
());
TrackManager
.
getInstance
().
cmtGroMoreInfo
(
vo
);
}
/**
* SDK_NAME_NO_PERMISSION = -3; //无权限
* * SDK_NAME_NO_DATA = -2; //暂无数据
* * SDK_NAME_PANGLE = 1;
* * SDK_NAME_ADMOB = 2;
* * SDK_NAME_GDT = 3;
* * SDK_NAME_MT = 4;
* * SDK_NAME_UNITY = 5;
* * SDK_NAME_BAIDU = 6;
* * SDK_NAME_KS = 7;
* * SDK_NAME_SIGMOB = 8;
*/
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"adcode"
,
adcode
);
vo
.
put
(
"ecpm"
,
ecpm
);
vo
.
put
(
"adSource"
,
adSource
);
vo
.
put
(
"adType"
,
Constant
.
GRO_MORE_ADTYPE2
);
vo
.
put
(
"ecpmId"
,
AppConfig
.
gromoreId
);
vo
.
put
(
"adid"
,
CsjGroMoreManager
.
INSTANCE
.
getAPP_IN_MAIN_AD_UNIT_VIDEO_ID
());
TrackManager
.
getInstance
().
cmtGroMoreInfo
(
vo
);
if
(
videoAdStatusListener
!=
null
)
{
videoAdStatusListener
.
adSuccess
();
...
...
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