feat: 网游登录插件-埋点补充—客户端 https://jira.shanqu.cc/browse/GHZSCY-6271
This commit is contained in:
@ -10,6 +10,7 @@ import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.ImageUtils
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.common.utils.viewModelProvider
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
@ -88,6 +89,11 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
gameId = gameId,
|
||||
gameName = gameName
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"LoginAuthorizationPageShow",
|
||||
"authority_object",
|
||||
if (mContent == TYPE_PLUGIN) "网游插件" else "其他"
|
||||
)
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
@ -156,6 +162,11 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
gameName = gameName,
|
||||
buttonType = BUTTON_TYPE_CONFIRM
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"LoginAuthorizationClick",
|
||||
"authority_object",
|
||||
if (mContent == TYPE_PLUGIN) "网游插件" else "其他"
|
||||
)
|
||||
checkLogin {
|
||||
authorization()
|
||||
}
|
||||
@ -185,10 +196,12 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
private fun authorization() {
|
||||
val remotePkgName = mRemotePkgName
|
||||
if (remotePkgName == null) {
|
||||
logAuthResult(false)
|
||||
finish()
|
||||
return
|
||||
}
|
||||
if (mToken.isEmpty()) {
|
||||
logAuthResult(false)
|
||||
toast("授权失败")
|
||||
return
|
||||
}
|
||||
@ -205,10 +218,21 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
intent.putExtra(EntranceConsts.KEY_USER_NAME, username)
|
||||
intent.putExtra(EntranceConsts.KEY_USER_AVATAR, userAvatar)
|
||||
sendBroadcast(intent)
|
||||
logAuthResult(true)
|
||||
backToLaunchApp()
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun logAuthResult(isSuccess: Boolean) {
|
||||
SensorsBridge.trackEvent(
|
||||
"LoginAuthorizationResult",
|
||||
"authority_object",
|
||||
if (mContent == TYPE_PLUGIN) "网游插件" else "其他",
|
||||
"authorization_result",
|
||||
if (isSuccess) "成功" else "失败"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转回授权app
|
||||
*/
|
||||
@ -239,6 +263,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
companion object {
|
||||
private const val BUTTON_TYPE_CONFIRM = "确定"
|
||||
private const val BUTTON_TYPE_BACK = "返回"
|
||||
private const val TYPE_PLUGIN = "plugin"
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user