Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
feat: Firebase Analytics 이벤트 계측 확장 (Phase 1/2/3, 64개)#377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package com.runnect.runnect.presentation.draw | ||
| import kotlin.math.roundToInt | ||
| import android.content.Intent | ||
| import android.graphics.Bitmap | ||
| import android.graphics.Color | ||
| @@ -49,6 +50,7 @@ import com.runnect.runnect.presentation.state.UiState | ||
| import com.runnect.runnect.util.DepartureSetMode | ||
| import com.runnect.runnect.util.analytics.Analytics | ||
| import com.runnect.runnect.util.analytics.EventName | ||
| import com.runnect.runnect.util.analytics.EventName.Param | ||
| import com.runnect.runnect.util.custom.dialog.RequireLoginDialogFragment | ||
| import com.runnect.runnect.util.extension.PermissionUtil | ||
| import com.runnect.runnect.util.extension.hideKeyboard | ||
| @@ -110,6 +112,7 @@ class DrawActivity : BindingActivity<ActivityDrawBinding>(R.layout.activity_draw | ||
| binding.model = viewModel | ||
| binding.lifecycleOwner = this | ||
| Analytics.logEvent(EventName.VIEW_COURSE_DRAWING) | ||
| initMapView() | ||
| getSearchIntent() | ||
| addObserver() | ||
| @@ -492,6 +495,14 @@ class DrawActivity : BindingActivity<ActivityDrawBinding>(R.layout.activity_draw | ||
| UiState.Loading -> showLoadingBar() | ||
| UiState.Success -> { | ||
| hideLoadingBar() | ||
| val distanceM = ((viewModel.distanceSum.value ?: 0f) * 1000f).roundToInt() | ||
| Analytics.logEvent( | ||
| EventName.ACTION_COURSE_DRAWING_COMPLETE, | ||
| Param.COURSE_ID to viewModel.uploadCourseId, | ||
| Param.DISTANCE_M to distanceM, | ||
| Param.POINT_COUNT to touchList.size, | ||
| Param.DEPARTURE_NAME to viewModel.departureName | ||
| ) | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| notifyCreateFinish() | ||
| } | ||
| @@ -552,6 +563,12 @@ class DrawActivity : BindingActivity<ActivityDrawBinding>(R.layout.activity_draw | ||
| dialog.dismiss() | ||
| } | ||
| } | ||
| val resultDistanceM = ((viewModel.distanceSum.value ?: 0f) * 1000f).roundToInt() | ||
| Analytics.logEvent( | ||
| EventName.VIEW_COURSE_COMPLETE_RESULT, | ||
| Param.COURSE_ID to viewModel.uploadCourseId, | ||
| Param.DISTANCE_M to resultDistanceM | ||
| ) | ||
| dialog.show() | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -13,8 +13,10 @@ import com.runnect.runnect.databinding.ActivityLoginBinding | ||
| import com.runnect.runnect.presentation.MainActivity | ||
| import com.runnect.runnect.presentation.state.UiState | ||
| import com.runnect.runnect.util.analytics.Analytics | ||
| import com.runnect.runnect.util.analytics.EventName | ||
| import com.runnect.runnect.util.analytics.EventName.EVENT_CLICK_VISITOR | ||
| import com.runnect.runnect.util.analytics.EventName.EVENT_VIEW_SOCIAL_LOGIN | ||
| import com.runnect.runnect.util.analytics.EventName.Param | ||
| import com.runnect.runnect.util.extension.showSnackbar | ||
| import com.runnect.runnect.util.extension.showToast | ||
| import com.runnect.runnect.util.preference.AuthUtil.getAccessToken | ||
| @@ -106,19 +108,37 @@ class LoginActivity : | ||
| } | ||
| } | ||
| viewModel.errorMessage.observe(this) { | ||
| val method = if (::socialLogin.isInitialized && socialLogin is GoogleLogin) "google" else "kakao" | ||
| Analytics.logEvent( | ||
| EventName.ACTION_LOGIN_FAIL, | ||
| Param.METHOD to method, | ||
| Param.ERROR_CODE to "LOGIN_FAIL" | ||
| ) | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| showSnackbar(binding.root, it) | ||
| Timber.tag(ContentValues.TAG).d("로그인 통신 실패: $it") | ||
| } | ||
| } | ||
| private fun handleSuccessfulLogin() { | ||
| val method = if (::socialLogin.isInitialized && socialLogin is GoogleLogin) "google" else "kakao" | ||
| Analytics.logEvent( | ||
| EventName.ACTION_LOGIN_SUCCESS, | ||
| Param.METHOD to method, | ||
| Param.IS_NEW_USER to false | ||
| ) | ||
| saveSignTokenInfo() | ||
| moveToMain() | ||
| Toast.makeText(this@LoginActivity, MESSAGE_LOGIN_SUCCESS, Toast.LENGTH_SHORT).show() | ||
| binding.indeterminateBar.isVisible = false | ||
| } | ||
| private fun handleSuccessfulSignup() { | ||
| val method = if (::socialLogin.isInitialized && socialLogin is GoogleLogin) "google" else "kakao" | ||
| Analytics.logEvent( | ||
| EventName.ACTION_LOGIN_SUCCESS, | ||
| Param.METHOD to method, | ||
| Param.IS_NEW_USER to true | ||
| ) | ||
| saveSignTokenInfo() | ||
| moveToGiveNickName() | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.