-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat : Amplitude 연동, 분석하기 버튼 클릭 시마다 'analysis_button_clicked' 이벤트 발생
- Loading branch information
1 parent
75fb36f
commit 99f5178
Showing
11 changed files
with
57 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
core/common/src/main/java/com/teamwiney/core/common/di/AmplitudeProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.teamwiney.core.common.di | ||
|
||
import android.content.Context | ||
import com.amplitude.android.Amplitude | ||
import com.amplitude.android.Configuration | ||
import com.amplitude.android.DefaultTrackingOptions | ||
import com.amplitude.android.utilities.AndroidLoggerProvider | ||
import com.teamwiney.core.common.BuildConfig | ||
|
||
object AmplitudeProvider { | ||
private var amplitude: Amplitude? = null | ||
|
||
fun initialize(context: Context) { | ||
amplitude = Amplitude( | ||
Configuration( | ||
apiKey = BuildConfig.AMPLITUDE_API_KEY, | ||
context= context, | ||
defaultTracking = DefaultTrackingOptions.ALL, | ||
loggerProvider = AndroidLoggerProvider() | ||
) | ||
) | ||
} | ||
|
||
private fun getAmplitude(): Amplitude { | ||
return amplitude ?: throw IllegalStateException("Amplitude is not initialized") | ||
} | ||
|
||
fun trackEvent(eventName: String) { | ||
getAmplitude().track(eventName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Dec 04 01:21:47 KST 2023 | ||
#Fri Jun 28 17:02:01 KST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters