埋点: 推送权限
This commit is contained in:
parent
3285bd7b06
commit
074a3374df
|
|
@ -0,0 +1,67 @@
|
|||
package com.gamedog.statisticreporter
|
||||
|
||||
import com.gamedog.statisticreporter.firbase.FireBaseManager
|
||||
import com.gamedog.statisticreporter.shushu.ShushuManager
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
object StatisticUtil {
|
||||
|
||||
private val mBgScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
||||
|
||||
const val KEY_Loading_Start: String = "Loading_Start"
|
||||
const val KEY_Loading_End: String = "Loading_End"
|
||||
const val KEY_Home_Show: String = "Home_Show"
|
||||
const val KEY_Guide: String = "Guide"
|
||||
const val KEY_RV_Button_Show: String = "RV_Button_Show"
|
||||
const val KEY_RV_Button_Click_Game: String = "RV_Button_Click_Game"
|
||||
const val KEY_Video_Play_Start: String = "Video_Play_Start"
|
||||
const val KEY_Video_Play_End: String = "Video_Play_End"
|
||||
const val KEY_Welfare_Show: String = "Welfare_Show"
|
||||
const val KEY_Chest_Claim_Click: String = "Chest_Claim_Click"
|
||||
const val KEY_Welfare_Task_Click: String = "Welfare_Task_Click"
|
||||
const val KEY_H5_Button_Click: String = "H5_Button_Click"
|
||||
const val KEY_H5_Show: String = "H5_Show"
|
||||
const val KEY_lottery_Button_Click: String = "lottery_Button_Click"
|
||||
const val KEY_lottery_Show: String = "lottery_Show"
|
||||
const val KEY_Daily_Task_Complete: String = "Daily_Task_Complete"
|
||||
const val KEY_Daily_Sign: String = "Daily_Sign"
|
||||
const val KEY_Withdraw_Click: String = "Withdraw_Click"
|
||||
const val KEY_Withdrawal_Show: String = "Withdrawal_Show"
|
||||
const val KEY_Withdrawal_finsh: String = "Withdrawal_finsh"
|
||||
const val KEY_Withdrawal_Info: String = "Withdrawal_Info"
|
||||
const val KEY_Withdrawal_Apply: String = "Withdrawal_Apply"
|
||||
const val KEY_Withdrawal_Reason: String = "Withdrawal_Reason"
|
||||
const val KEY_Push_Request_Show: String = "Push_Request_Show"
|
||||
const val KEY_Push_Request_Result: String = "Push_Request_Result"
|
||||
const val KEY_Push_Show: String = "Push_Show"
|
||||
const val KEY_Push_Click: String = "Push_Click"
|
||||
const val KEY_Push_EnterGame: String = "Push_EnterGame"
|
||||
const val KEY_adjust_init: String = "adjust_init"
|
||||
const val KEY_adjust_get_success: String = "adjust_get_success"
|
||||
const val ad_click: String = "ad_click"
|
||||
const val KEY_ad_close: String = "ad_close"
|
||||
const val KEY_ad_start_load: String = "ad_start_load"
|
||||
const val KEY_ad_loaded: String = "ad_loaded"
|
||||
const val KEY_ad_load_fail: String = "ad_load_fail"
|
||||
const val KEY_ad_show_fail: String = "ad_show_fail"
|
||||
const val KEY_ad_position: String = "ad_position"
|
||||
const val KEY_ad_impression: String = "ad_impression"
|
||||
|
||||
|
||||
fun reportEvents(eventKey: String, eventData: Map<String, Any>? = null) {
|
||||
mBgScope.launch {
|
||||
FireBaseManager.instance().reportEvent(eventKey, eventData)
|
||||
ShushuManager.instance().reportEvent(eventKey, eventData)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package com.gamedog.statisticreporter
|
||||
|
||||
class test {
|
||||
}
|
||||
|
|
@ -35,33 +35,22 @@ object StatisticUtil {
|
|||
const val KEY_Withdrawal_Apply: String = "Withdrawal_Apply"
|
||||
const val KEY_Withdrawal_Reason: String = "Withdrawal_Reason"
|
||||
const val KEY_Push_Request_Show: String = "Push_Request_Show"
|
||||
const val KEY_xxx: String = "xxx"
|
||||
const val KEY_Push_Request_Result: String = "Push_Request_Result"
|
||||
const val KEY_Push_Show: String = "Push_Show"
|
||||
const val KEY_Push_Click: String = "Push_Click"
|
||||
const val KEY_Push_EnterGame: String = "Push_EnterGame"
|
||||
const val KEY_adjust_init: String = "adjust_init"
|
||||
const val KEY_adjust_get_success: String = "adjust_get_success"
|
||||
const val ad_click: String = "ad_click"
|
||||
const val KEY_ad_close: String = "ad_close"
|
||||
const val KEY_ad_start_load: String = "ad_start_load"
|
||||
const val KEY_ad_loaded: String = "ad_loaded"
|
||||
const val KEY_ad_load_fail: String = "ad_load_fail"
|
||||
const val KEY_ad_show_fail: String = "ad_show_fail"
|
||||
const val KEY_ad_position: String = "ad_position"
|
||||
const val KEY_ad_impression: String = "ad_impression"
|
||||
|
||||
|
||||
/*Video_Like_Click
|
||||
Video_Share_Click*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*Push_Request_Result
|
||||
Push_Show
|
||||
Push_Click
|
||||
Push_EnterGame
|
||||
adjust_init
|
||||
adjust_get_success
|
||||
ad_click
|
||||
ad_close
|
||||
ad_start_load
|
||||
ad_loaded
|
||||
ad_load_fail
|
||||
ad_show_fail
|
||||
ad_position
|
||||
ad_impression
|
||||
*/
|
||||
|
||||
fun reportEvents(eventKey: String, eventData: Map<String, Any>? = null) {
|
||||
mBgScope.launch {
|
||||
FireBaseManager.instance().reportEvent(eventKey, eventData)
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ dependencies {
|
|||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(project(":core:architecture"))
|
||||
implementation(project(":StatisticReporter"))
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.test.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import androidx.core.content.ContextCompat
|
|||
import com.ama.core.architecture.BaseApp
|
||||
import com.ama.core.architecture.util.DateUtil
|
||||
import com.ama.core.architecture.util.permission.PermissionUtil
|
||||
import com.gamedog.statisticreporter.StatisticUtil
|
||||
import com.remax.base.ext.canSendNotification
|
||||
import com.remax.base.report.DataReportManager
|
||||
import com.remax.notification.NotifyConst
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import androidx.core.app.NotificationCompat
|
|||
import androidx.core.app.NotificationManagerCompat
|
||||
import com.ama.core.architecture.BaseApp
|
||||
import com.ama.core.architecture.util.permission.PermissionUtil
|
||||
import com.gamedog.statisticreporter.StatisticUtil
|
||||
import com.remax.notification.NotifyConst
|
||||
import com.remax.notification.R
|
||||
|
||||
|
|
@ -457,15 +458,19 @@ class NotificationUtil private constructor() {
|
|||
channelName: String,
|
||||
importance: Int = NotificationManager.IMPORTANCE_DEFAULT) {
|
||||
if (!isNotificationsEnabled()) {
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Push_Show)
|
||||
PermissionUtil.checkPermission(Manifest.permission.POST_NOTIFICATIONS, object : PermissionUtil.ICallback() {
|
||||
override fun onAllGranted() {
|
||||
doShowNotification(notificationId, notification, channelName, importance)
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Push_Request_Result, mapOf("Push_Result" to 1))
|
||||
}
|
||||
|
||||
override fun onPartialGranted() {
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Push_Request_Result, mapOf("Push_Result" to 0))
|
||||
}
|
||||
|
||||
override fun onAllRejected() {
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Push_Request_Result, mapOf("Push_Result" to 0))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue