From bffdc42eac2e02b7ac38106c8c36063998207da7 Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Thu, 21 Dec 2023 10:03:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=A5=9E=E7=AD=96=E5=9F=8B=E7=82=B9=E8=A1=A5?= =?UTF-8?q?=E5=85=85=20https://jira.shanqu.cc/browse/GHZS-4434?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gh/gamecenter/manager/UpdateManager.java | 26 +++++++++++++------ .../gamecenter/common/utils/SensorsBridge.kt | 19 +++++++++++--- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/manager/UpdateManager.java b/app/src/main/java/com/gh/gamecenter/manager/UpdateManager.java index d816a56c1c..b2dce6d6cd 100644 --- a/app/src/main/java/com/gh/gamecenter/manager/UpdateManager.java +++ b/app/src/main/java/com/gh/gamecenter/manager/UpdateManager.java @@ -329,8 +329,12 @@ public class UpdateManager { if (!isShowDownload) { DownloadManager.getInstance().removeObserver(dataWatcher); } - if (!dismissByTouchInside.get()) { - SensorsBridge.trackVersionUpdateDialogClick("关闭弹窗"); + if (!dismissByTouchInside.get() && appEntity != null) { + SensorsBridge.trackVersionUpdateDialogClick( + "关闭弹窗", + appEntity.getAlert(), + appEntity.isForce() ? "关闭且强退" : "仅关闭" + ); } }); Window window = updateDialog.getWindow(); @@ -393,14 +397,17 @@ public class UpdateManager { }); cancelUpdateTextView.setOnClickListener(v -> { + dismissByTouchInside.set(true); if (appEntity.isForce()) { - exitApp(); + String cancelText = cancelUpdateTextView.getText().toString(); + SensorsBridge.trackVersionUpdateDialogClick( + cancelText, + appEntity.getAlert(), + appEntity.isForce() ? "关闭且强退" : "仅关闭"); + AppExecutor.getUiExecutor().executeWithDelay(this::exitApp, 500L); } else { updateDialog.dismiss(); } - dismissByTouchInside.set(true); - String cancelText = cancelUpdateTextView.getText().toString(); - SensorsBridge.trackVersionUpdateDialogClick(cancelText); }); confirmTextView.setOnClickListener(v -> { @@ -422,7 +429,10 @@ public class UpdateManager { showDownloadDialog(md5); } String buttonName = confirmTextView.getText().toString(); - SensorsBridge.trackVersionUpdateDialogClick(buttonName); + SensorsBridge.trackVersionUpdateDialogClick( + buttonName, + appEntity.getAlert(), + appEntity.isForce() ? "关闭且强退" : "仅关闭"); }); if (appEntity.isForce()) { @@ -433,7 +443,7 @@ public class UpdateManager { updateDialog.setContentView(view); updateDialog.show(); - SensorsBridge.trackVersionUpdateDialogShow(); + SensorsBridge.trackVersionUpdateDialogShow(appEntity.getAlert(), appEntity.isForce() ? "关闭且强退" : "仅关闭"); DataLogUtils.uploadUpgradeLog(context, "notice"); //上传更新通知弹窗数据 } diff --git a/module_common/src/main/java/com/gh/gamecenter/common/utils/SensorsBridge.kt b/module_common/src/main/java/com/gh/gamecenter/common/utils/SensorsBridge.kt index aab1009b6f..833464cf02 100644 --- a/module_common/src/main/java/com/gh/gamecenter/common/utils/SensorsBridge.kt +++ b/module_common/src/main/java/com/gh/gamecenter/common/utils/SensorsBridge.kt @@ -57,6 +57,8 @@ object SensorsBridge { private const val KEY_SESSION_MESSAGE_TYPE = "session_message_type" private const val KEY_REMINDER_TYPE = "reminder_type" private const val KEY_MESSAGE_TYPE = "message_type" + private const val KEY_DIALOG_REMINDER_TIME = "dialog_reminder_time" + private const val KEY_DIALOG_CLOSE = "dialog_close" private const val EVENT_GAME_DETAIL_PAGE_TAB_SELECT = "GameDetailPageTabSelect" private const val EVENT_GAME_DETAIL_PAGE_TAG_CLICK = "GameDetailPageGameTagClick" @@ -1646,11 +1648,16 @@ object SensorsBridge { * 序号:88 * 事件ID:VersionUpdateDialogShow * 事件名称:版本更新弹窗展示事件 + * @param keyDialogReminderTime 对应后台设置的“弹窗提醒频次”选项,包括“仅一次、仅一次(第二次打开)、每天一次、每次打开” + * @param keyDialogClose 对应后台设置的“弹窗关闭”选项,包括“仅关闭、关闭且强退” * @see EVENT_VERSION_UPDATE_DIALOG_SHOW */ @JvmStatic - fun trackVersionUpdateDialogShow() { - val json = json {} + fun trackVersionUpdateDialogShow(keyDialogReminderTime: String?, keyDialogClose: String?) { + val json = json { + KEY_DIALOG_REMINDER_TIME to keyDialogReminderTime + KEY_DIALOG_CLOSE to keyDialogClose + } trackEvent(EVENT_VERSION_UPDATE_DIALOG_SHOW, json) } @@ -1660,14 +1667,20 @@ object SensorsBridge { * 事件ID:VersionUpdateDialogClick * 事件名称:版本更新弹窗点击事件 * @param buttonName 按钮名称 + * @param keyDialogReminderTime 对应后台设置的“弹窗提醒频次”选项,包括“仅一次、仅一次(第二次打开)、每天一次、每次打开” + * @param keyDialogClose 对应后台设置的“弹窗关闭”选项,包括“仅关闭、关闭且强退” * @see EVENT_VERSION_UPDATE_DIALOG_CLICK */ @JvmStatic fun trackVersionUpdateDialogClick( - buttonName: String + buttonName: String, + keyDialogReminderTime: String?, + keyDialogClose: String? ) { val json = json { KEY_BUTTON_NAME to buttonName + KEY_DIALOG_REMINDER_TIME to keyDialogReminderTime + KEY_DIALOG_CLOSE to keyDialogClose } trackEvent(EVENT_VERSION_UPDATE_DIALOG_CLICK, json)