【埋点】H5 界面展示和点击事件都没有上报

This commit is contained in:
renhaoting 2026-01-22 13:46:06 +08:00
parent 5f7131e00c
commit 19f1dbe676
3 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@ google-services.json
# Android Profiling # Android Profiling
*.hprof *.hprof
/.kotlin/sessions/kotlin-compiler-2258332710725417628.salive

View File

@ -39,10 +39,12 @@ class GameCenterActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(),
override val mViewModel: ViewModel by viewModels() override val mViewModel: ViewModel by viewModels()
override fun inflateViewBinding(inflater: LayoutInflater) = ViewBinding.inflate(inflater) override fun inflateViewBinding(inflater: LayoutInflater) = ViewBinding.inflate(inflater)
override var mEnableBannerAd = false override var mEnableBannerAd = false
private var mHasSendStatistic: Boolean = false
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
override fun ViewBinding.initViews() { override fun ViewBinding.initViews() {
showLoading(false)
with(binding) { with(binding) {
titlebar.setBackIconColor(R.color.black) titlebar.setBackIconColor(R.color.black)
@ -62,6 +64,16 @@ class GameCenterActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(),
webView.addJavascriptInterface(WebAppInterface(this@GameCenterActivity, webView), "com.viddin.videos.free") webView.addJavascriptInterface(WebAppInterface(this@GameCenterActivity, webView), "com.viddin.videos.free")
webViewClient = object : WebViewClient() { webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
if (!mHasSendStatistic) {
StatisticUtil.reportEvents(StatisticUtil.KEY_H5_Show)
mHasSendStatistic = true
}
hideLoading()
}
override fun shouldOverrideUrlLoading( override fun shouldOverrideUrlLoading(
view: WebView?, view: WebView?,
request: WebResourceRequest request: WebResourceRequest
@ -97,9 +109,6 @@ class GameCenterActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(),
loadGameCenterWeb() loadGameCenterWeb()
} }
StatisticUtil.reportEvents(StatisticUtil.KEY_H5_Show)
} }

View File

@ -58,6 +58,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
if (taskStateBeanInSp == null || taskStateBeanInSp.boxList.isNullOrEmpty() || isAllBoxExpiredOrFinished(taskStateBeanInSp)) { if (taskStateBeanInSp == null || taskStateBeanInSp.boxList.isNullOrEmpty() || isAllBoxExpiredOrFinished(taskStateBeanInSp)) {
mStateBean = generateStateBeanFromConfig() mStateBean = generateStateBeanFromConfig()
saveState2Sp() saveState2Sp()
sendEnterNewSubBoxEvent(0)
} else { } else {
mStateBean = taskStateBeanInSp mStateBean = taskStateBeanInSp
calculateCurrentOngoingBox() calculateCurrentOngoingBox()
@ -77,7 +78,6 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
task.reward_type, task.reward_value, task.is_one_time, task.status, task.reward_type, task.reward_value, task.is_one_time, task.status,
boxSubTaskStateList, DateUtil.getCurTimeMs())) boxSubTaskStateList, DateUtil.getCurTimeMs()))
} }
sendEnterNewSubBoxEvent(0)
return TaskStateBoxRoot(boxStateList) return TaskStateBoxRoot(boxStateList)
} }