-
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.
Merge pull request #165 from pknu-wap/release
Release 1.0.1v
- Loading branch information
Showing
63 changed files
with
535 additions
and
299 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
pull_request: | ||
branches: | ||
- develop | ||
- release | ||
- main | ||
types: | ||
- opened | ||
|
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,8 +1,9 @@ | ||
name: Released-App-Distribution | ||
|
||
on: | ||
push: | ||
push: | ||
branches: | ||
- 'release' | ||
- release | ||
|
||
jobs: | ||
build: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,29 @@ | ||
plugins { | ||
id("com.wap.wapp.library") | ||
id("com.wap.wapp.hilt") | ||
id("com.wap.wapp.compose") | ||
} | ||
|
||
android { | ||
namespace = "com.wap.wapp.core.analytics" | ||
|
||
defaultConfig { | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro", | ||
) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(platform(libs.firebase.bom)) | ||
implementation(libs.firebase.analytics) | ||
} |
Empty file.
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
16 changes: 16 additions & 0 deletions
16
core/analytics/src/main/java/com/wap/wapp/core/analytics/AnalyticsEvent.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,16 @@ | ||
package com.wap.wapp.core.analytics | ||
|
||
data class AnalyticsEvent( | ||
val type: String, | ||
val extras: List<Param> = emptyList(), | ||
) { | ||
data class Param( | ||
val key: String, | ||
val value: String, | ||
) | ||
|
||
companion object { | ||
const val SCREEN_VIEW = "screen_view" // TYPE | ||
const val SCREEN_NAME = "screen_name" // EXTRA_KEY | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core/analytics/src/main/java/com/wap/wapp/core/analytics/AnalyticsHelper.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,5 @@ | ||
package com.wap.wapp.core.analytics | ||
|
||
interface AnalyticsHelper { | ||
fun logEvent(event: AnalyticsEvent) | ||
} |
21 changes: 21 additions & 0 deletions
21
core/analytics/src/main/java/com/wap/wapp/core/analytics/AnalyticsHelperImpl.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,21 @@ | ||
package com.wap.wapp.core.analytics | ||
|
||
import com.google.firebase.analytics.FirebaseAnalytics | ||
import com.google.firebase.analytics.ktx.logEvent | ||
import javax.inject.Inject | ||
|
||
class AnalyticsHelperImpl @Inject constructor( | ||
private val firebaseAnalytics: FirebaseAnalytics, | ||
) : AnalyticsHelper { | ||
override fun logEvent(event: AnalyticsEvent) { | ||
firebaseAnalytics.logEvent(event.type) { | ||
for (extra in event.extras) { | ||
// Key, Value Max Length에 따른 slicing | ||
param( | ||
key = extra.key.take(40), | ||
value = extra.value.take(100), | ||
) | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
core/analytics/src/main/java/com/wap/wapp/core/analytics/LocalAnalyticsHelper.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,7 @@ | ||
package com.wap.wapp.core.analytics | ||
|
||
import androidx.compose.runtime.staticCompositionLocalOf | ||
|
||
val LocalAnalyticsHelper = staticCompositionLocalOf<AnalyticsHelper> { | ||
error("Any AnalyticsHelper Did Not Provided") | ||
} |
29 changes: 29 additions & 0 deletions
29
core/analytics/src/main/java/com/wap/wapp/core/analytics/di/AnalyticsModule.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,29 @@ | ||
package com.wap.wapp.core.analytics.di | ||
|
||
import com.google.firebase.analytics.FirebaseAnalytics | ||
import com.google.firebase.analytics.ktx.analytics | ||
import com.google.firebase.ktx.Firebase | ||
import com.wap.wapp.core.analytics.AnalyticsHelper | ||
import com.wap.wapp.core.analytics.AnalyticsHelperImpl | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class AnalyticsModule { | ||
@Binds | ||
@Singleton | ||
abstract fun bindsAnalyticsHelper(analyticsHelperImpl: AnalyticsHelperImpl): AnalyticsHelper | ||
|
||
companion object { | ||
@Provides | ||
@Singleton | ||
fun provideFirebaseAnalytics(): FirebaseAnalytics { | ||
return Firebase.analytics | ||
} | ||
} | ||
} |
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
39 changes: 39 additions & 0 deletions
39
core/common/src/main/java/com/wap/wapp/core/commmon/extensions/AnalyticsExtensions.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,39 @@ | ||
package com.wap.wapp.core.commmon.extensions | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import com.wap.wapp.core.analytics.AnalyticsEvent | ||
import com.wap.wapp.core.analytics.AnalyticsEvent.Param | ||
import com.wap.wapp.core.analytics.AnalyticsHelper | ||
import com.wap.wapp.core.analytics.LocalAnalyticsHelper | ||
|
||
fun AnalyticsHelper.logScreenView(screenName: String) { | ||
logEvent( | ||
AnalyticsEvent( | ||
type = AnalyticsEvent.SCREEN_VIEW, | ||
extras = listOf( | ||
Param(AnalyticsEvent.SCREEN_NAME, screenName), | ||
), | ||
), | ||
) | ||
} | ||
|
||
fun AnalyticsHelper.logUserSignedIn(userId: String, userName: String) { | ||
logEvent( | ||
AnalyticsEvent( | ||
type = "signed_in", | ||
extras = listOf( | ||
Param("user_id", userId), | ||
Param("user_name", userName), | ||
), | ||
), | ||
) | ||
} | ||
|
||
@Composable | ||
fun TrackScreenViewEvent( | ||
screenName: String, | ||
analyticsHelper: AnalyticsHelper = LocalAnalyticsHelper.current, | ||
) = LaunchedEffect(Unit) { | ||
analyticsHelper.logScreenView(screenName) | ||
} |
Oops, something went wrong.