Skip to content
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

[feature/amplitude] Amplitude 데이터 기록하기 #181

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/develop_PR_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ jobs:
KEY_ALIAS: ${{ secrets.SENTRY_DSN }}
KEY_PASSWORD: ${{ secrets.SENTRY_DSN }}
STORE_PASSWORD: ${{ secrets.SENTRY_DSN }}
AMPLITUDE_KEY: ${{ secrets.SENTRY_DSN }}
run: |
echo sentryDsn=\"$SENTRY_DSN\" >> ./local.properties
echo kakaoApiKey=$KAKAO_API_KEY >> ./local.properties
echo pophoryBaseUrl=$POPHORY_BASE_URL >> ./local.properties
echo keyAlias=$KEY_ALIAS >> ./local.properties
echo keyPassword=KEY_PASSWORD >> ./local.properties
echo storePassword=$STORE_PASSWORD >> ./local.properties
echo amplitudeKey=$AMPLITUDE_KEY >> ./local.properties

- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation(libs.coil.core)
implementation(libs.bundles.retrofit)
implementation(libs.kakao.login)
implementation(libs.amplitude.android)

debugImplementation(libs.bundles.flipper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ internal fun Project.configureAndroidCommonPlugin() {
defaultConfig {
val kakaoApiKey = properties["kakaoApiKey"] as? String ?: ""
val pophoryBaseUrl = properties["pophoryBaseUrl"] as? String ?: ""
val amplitudeKey = properties["amplitudeKey"] as? String ?: ""

manifestPlaceholders["sentryDsn"] = properties["sentryDsn"] as String
manifestPlaceholders["kakaoApiKey"] = properties["kakaoApiKey"] as String
manifestPlaceholders["pophoryBaseUrl"] = properties["pophoryBaseUrl"] as String

buildConfigField("String", "KAKAO_API_KEY", "\"${kakaoApiKey}\"")
buildConfigField("String", "POPHORY_BASE_URL", "\"${pophoryBaseUrl}\"")
buildConfigField("String", "AMPLITUDE_KEY", "\"${amplitudeKey}\"")
}
buildFeatures.apply {
viewBinding = true
Expand Down
1 change: 1 addition & 0 deletions core/analytics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
12 changes: 12 additions & 0 deletions core/analytics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
pophory("feature")
}

android {
namespace = "com.teampophory.pophory.analytics"
}

dependencies {
implementation(libs.amplitude.android)
}
Empty file.
2 changes: 2 additions & 0 deletions core/analytics/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.teampophory.pophory.analytics

interface Analytics {
fun trackEvent(
name: String,
args: Map<String, *>? = null,
)
}
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dot-indicator = "5.0"
kakao = "2.15.0"
splash-screen = "1.0.1"
javax-inject = "1"
amplitude = "2.39.2"


[libraries]
Expand Down Expand Up @@ -191,6 +192,8 @@ javax-inject = { group = "javax.inject", name = "javax.inject", version.ref = "j

sentry = { module = "io.sentry:sentry", version.ref = "sentry-android" }

amplitude-android = { module = "com.amplitude:analytics-android", version.ref = "amplitude" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rootProject.name = "pophory"
include(":app")
include(":bottomnavigation")
include(":core:common")
include(":core:analytics")
include(":core:designsystem")
include(":domain:auth")
include(":data:auth")
Expand Down