Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
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
wanglei
Data Recovery White
Commits
f576c13a
Commit
f576c13a
authored
Jul 16, 2024
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改上报
parent
ed74f56a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
AdMaxEvent.kt
...src/main/java/com/base/datarecovery/ads/max/AdMaxEvent.kt
+7
-3
AdMaxInterstitialUtils.kt
...a/com/base/datarecovery/ads/max/AdMaxInterstitialUtils.kt
+10
-0
No files found.
app/src/main/java/com/base/datarecovery/ads/max/AdMaxEvent.kt
View file @
f576c13a
...
...
@@ -14,7 +14,7 @@ import com.google.firebase.ktx.Firebase
import
org.json.JSONObject
object
AdMaxEvent
{
fun
pullAd
(
ad
:
MaxAd
,
adUnit
:
String
,
error
:
String
?
=
null
,
reqId
:
String
?
=
null
)
{
fun
pullAd
(
ad
:
MaxAd
?,
adUnit
:
String
,
error
:
String
?
=
null
,
reqId
:
String
?
=
null
)
{
val
obj
=
JSONObject
()
obj
.
put
(
"UnitId"
,
ad
?.
adUnitId
)
obj
.
put
(
"ad_unit"
,
adUnit
)
...
...
@@ -37,6 +37,7 @@ object AdMaxEvent {
}
EventUtils
.
event
(
"ad_pull"
,
ext
=
obj
)
}
fun
clickAd
(
ad
:
MaxAd
?,
adUnit
:
String
)
{
val
obj
=
JSONObject
()
...
...
@@ -70,9 +71,11 @@ object AdMaxEvent {
EventUtils
.
event
(
"ad_show"
,
ext
=
obj
)
}
private
val
taichiPref
=
FacebookSdk
.
getApplicationContext
()
.
getSharedPreferences
(
"TaichiTroasCache"
,
0
)
private
val
taichiSharedPreferencesEditor
=
taichiPref
.
edit
()
class
EventOnPaidEventListener
:
MaxAdRevenueListener
{
override
fun
onAdRevenuePaid
(
ad
:
MaxAd
)
{
val
params
=
Bundle
()
...
...
@@ -103,7 +106,8 @@ object AdMaxEvent {
}
val
obj
=
JSONObject
()
val
revenue
=
ad
.
revenue
val
countryCode
=
AppLovinSdk
.
getInstance
(
BaseApplication
.
context
).
configuration
.
countryCode
val
countryCode
=
AppLovinSdk
.
getInstance
(
BaseApplication
.
context
).
configuration
.
countryCode
val
networkName
=
ad
.
networkName
val
adUnitId
=
ad
.
adUnitId
val
adFormat
=
ad
.
format
...
...
app/src/main/java/com/base/datarecovery/ads/max/AdMaxInterstitialUtils.kt
View file @
f576c13a
...
...
@@ -13,6 +13,7 @@ import com.base.datarecovery.utils.EventUtils
import
com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.view.CustomDialog
import
org.json.JSONObject
import
java.util.UUID
import
java.util.concurrent.TimeUnit
import
kotlin.math.min
import
kotlin.math.pow
...
...
@@ -31,6 +32,12 @@ object AdMaxInterstitialUtils {
private
fun
setListener
(
activity
:
Activity
)
{
if
(
interstitialAd
==
null
)
{
val
reqId
=
UUID
.
randomUUID
().
toString
()
val
obj
=
JSONObject
()
obj
.
put
(
"req_id"
,
reqId
)
obj
.
put
(
"ad_type"
,
"interAd"
)
EventUtils
.
event
(
"ad_pull_start"
,
ext
=
obj
)
interstitialAd
=
MaxInterstitialAd
(
ConfigHelper
.
interAdMaxId
,
activity
)
interstitialAd
?.
setListener
(
object
:
MaxAdListener
{
override
fun
onAdLoaded
(
p0
:
MaxAd
)
{
...
...
@@ -38,10 +45,12 @@ object AdMaxInterstitialUtils {
loadingListener
?.
invoke
()
interLoadTime
=
System
.
currentTimeMillis
()
retryAttempt
=
0
AdMaxEvent
.
pullAd
(
p0
,
"interAd"
,
reqId
=
reqId
)
}
override
fun
onAdLoadFailed
(
p0
:
String
,
p1
:
MaxError
)
{
LogEx
.
logDebug
(
TAG
,
"onAdLoadFailed"
)
AdMaxEvent
.
pullAd
(
null
,
"interAd"
,
reqId
=
reqId
)
AdDisplayUtils
.
getInstance
().
incrementAdRequestFailCount
()
retryAttempt
++
LogEx
.
logDebug
(
TAG
,
"onAdLoadFailed retryAttempt=$retryAttempt"
)
...
...
@@ -107,6 +116,7 @@ object AdMaxInterstitialUtils {
}
this
.
onHidden
=
onHidden
interstitialAd
?.
setRevenueListener
(
AdMaxEvent
.
EventOnPaidEventListener
())
if
(
interstitialAd
?.
isReady
==
true
)
{
LogEx
.
logDebug
(
TAG
,
"isReady=true"
)
interstitialAd
?.
showAd
()
...
...
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