【埋点】H5 界面展示和点击事件都没有上报
This commit is contained in:
parent
5f7131e00c
commit
19f1dbe676
|
|
@ -33,3 +33,4 @@ google-services.json
|
|||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
/.kotlin/sessions/kotlin-compiler-2258332710725417628.salive
|
||||
|
|
|
|||
|
|
@ -39,10 +39,12 @@ class GameCenterActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(),
|
|||
override val mViewModel: ViewModel by viewModels()
|
||||
override fun inflateViewBinding(inflater: LayoutInflater) = ViewBinding.inflate(inflater)
|
||||
override var mEnableBannerAd = false
|
||||
private var mHasSendStatistic: Boolean = false
|
||||
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
override fun ViewBinding.initViews() {
|
||||
|
||||
showLoading(false)
|
||||
|
||||
with(binding) {
|
||||
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")
|
||||
|
||||
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(
|
||||
view: WebView?,
|
||||
request: WebResourceRequest
|
||||
|
|
@ -97,9 +109,6 @@ class GameCenterActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(),
|
|||
|
||||
loadGameCenterWeb()
|
||||
}
|
||||
|
||||
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_H5_Show)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
|||
if (taskStateBeanInSp == null || taskStateBeanInSp.boxList.isNullOrEmpty() || isAllBoxExpiredOrFinished(taskStateBeanInSp)) {
|
||||
mStateBean = generateStateBeanFromConfig()
|
||||
saveState2Sp()
|
||||
sendEnterNewSubBoxEvent(0)
|
||||
} else {
|
||||
mStateBean = taskStateBeanInSp
|
||||
calculateCurrentOngoingBox()
|
||||
|
|
@ -77,7 +78,6 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
|||
task.reward_type, task.reward_value, task.is_one_time, task.status,
|
||||
boxSubTaskStateList, DateUtil.getCurTimeMs()))
|
||||
}
|
||||
sendEnterNewSubBoxEvent(0)
|
||||
return TaskStateBoxRoot(boxStateList)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue