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

[feat] 클러스터링 활성화/비활성화 메뉴 옵션 추가, 푸시 알림을 클릭했을 때 화면 이동 되지 않는 문제 해결 #268

Merged
merged 9 commits into from
Sep 29, 2024
50 changes: 48 additions & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class com.unifest.android.feature.map.model.** { *; }

-keep class com.unifest.android.feature.map.model.** { *; }
-keep class *.** { *; }
-dontwarn com.unifest.android.core.common.ErrorHandlerActions
-dontwarn com.unifest.android.core.common.HandleExceptionKt
-dontwarn com.unifest.android.core.common.ObserveEventKt
Expand All @@ -35,6 +35,9 @@
-dontwarn com.unifest.android.core.data.datasource.RemoteConfigDataSourceImpl
-dontwarn com.unifest.android.core.data.di.FirebaseModule_ProvideMessagingFactory
-dontwarn com.unifest.android.core.data.di.FirebaseModule_ProvideRemoteConfigFactory
-dontwarn com.unifest.android.core.data.di.HiltWrapper_DataSourceModule
-dontwarn com.unifest.android.core.data.di.HiltWrapper_FirebaseModule
-dontwarn com.unifest.android.core.data.di.HiltWrapper_RepositoryModule
-dontwarn com.unifest.android.core.data.repository.BoothRepository
-dontwarn com.unifest.android.core.data.repository.BoothRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.FestivalRepository
Expand All @@ -49,22 +52,31 @@
-dontwarn com.unifest.android.core.data.repository.OnboardingRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.RemoteConfigRepository
-dontwarn com.unifest.android.core.data.repository.RemoteConfigRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.SettingRepository
-dontwarn com.unifest.android.core.data.repository.SettingRepositoryImpl
-dontwarn com.unifest.android.core.data.repository.WaitingRepository
-dontwarn com.unifest.android.core.data.repository.WaitingRepositoryImpl
-dontwarn com.unifest.android.core.database.LikedBoothDao
-dontwarn com.unifest.android.core.database.LikedFestivalDao
-dontwarn com.unifest.android.core.database.di.DaoModule
-dontwarn com.unifest.android.core.database.di.DaoModule_ProvideLikedBoothDaoFactory
-dontwarn com.unifest.android.core.database.di.DaoModule_ProvideLikedFestivalDaoFactory
-dontwarn com.unifest.android.core.database.di.DatabaseModule
-dontwarn com.unifest.android.core.database.di.DatabaseModule_ProvideLikedBoothDatabaseFactory
-dontwarn com.unifest.android.core.database.di.DatabaseModule_ProvideLikedFestivalDatabaseFactory
-dontwarn com.unifest.android.core.datastore.OnboardingDataSource
-dontwarn com.unifest.android.core.datastore.OnboardingDataSourceImpl
-dontwarn com.unifest.android.core.datastore.RecentLikedFestivalDataSource
-dontwarn com.unifest.android.core.datastore.RecentLikedFestivalDataSourceImpl
-dontwarn com.unifest.android.core.datastore.SettingDataSource
-dontwarn com.unifest.android.core.datastore.SettingDataSourceImpl
-dontwarn com.unifest.android.core.datastore.TokenDataSource
-dontwarn com.unifest.android.core.datastore.TokenDataSourceImpl
-dontwarn com.unifest.android.core.datastore.di.DataSourceModule
-dontwarn com.unifest.android.core.datastore.di.DataStoreModule_ProvideOnboardingDataStore$datastore_releaseFactory
-dontwarn com.unifest.android.core.datastore.di.DataStoreModule_ProvideRecentFestivalDataStore$datastore_releaseFactory
-dontwarn com.unifest.android.core.datastore.di.HiltWrapper_DataStoreModule
-dontwarn com.unifest.android.core.designsystem.ComponentPreview
-dontwarn com.unifest.android.core.designsystem.component.ButtonKt
-dontwarn com.unifest.android.core.designsystem.component.DialogKt
-dontwarn com.unifest.android.core.designsystem.component.LoadingWheelKt
Expand All @@ -82,36 +94,70 @@
-dontwarn com.unifest.android.core.navigation.MainTabRoute$Waiting
-dontwarn com.unifest.android.core.navigation.MainTabRoute
-dontwarn com.unifest.android.core.navigation.Route
-dontwarn com.unifest.android.core.network.di.ApiModule
-dontwarn com.unifest.android.core.network.di.ApiModule_ProvideUnifestService$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.HiltWrapper_NetworkModule
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideHttpLoggingInterceptor$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideUnifestApiRetrofit$network_releaseFactory
-dontwarn com.unifest.android.core.network.di.NetworkModule_ProvideUnifestOkHttpClient$network_releaseFactory
-dontwarn com.unifest.android.core.network.service.UnifestService
-dontwarn com.unifest.android.core.ui.DevicePreview
-dontwarn com.unifest.android.core.ui.component.CameraPermissionTextProvider
-dontwarn com.unifest.android.core.ui.component.LikedFestivalGridKt
-dontwarn com.unifest.android.core.ui.component.PermissionDialogKt
-dontwarn com.unifest.android.core.ui.component.PermissionTextProvider
-dontwarn com.unifest.android.feature.booth.navigation.BoothNavigationKt
-dontwarn com.unifest.android.feature.booth.viewmodel.BoothViewModel
-dontwarn com.unifest.android.feature.booth.viewmodel.BoothViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.booth.viewmodel.BoothViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.festival.viewmodel.FestivalViewModel
-dontwarn com.unifest.android.feature.festival.viewmodel.FestivalViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.festival.viewmodel.FestivalViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.home.navigation.HomeNavigationKt
-dontwarn com.unifest.android.feature.home.viewmodel.HomeViewModel
-dontwarn com.unifest.android.feature.home.viewmodel.HomeViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.home.viewmodel.HomeViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.liked_booth.navigation.LikedBoothNavigationKt
-dontwarn com.unifest.android.feature.liked_booth.viewmodel.LikedBoothViewModel
-dontwarn com.unifest.android.feature.liked_booth.viewmodel.LikedBoothViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.liked_booth.viewmodel.LikedBoothViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.map.navigation.MapNavigationKt
-dontwarn com.unifest.android.feature.map.viewmodel.MapViewModel
-dontwarn com.unifest.android.feature.map.viewmodel.MapViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.map.viewmodel.MapViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.menu.navigation.MenuNavigationKt
-dontwarn com.unifest.android.feature.menu.viewmodel.MenuViewModel
-dontwarn com.unifest.android.feature.menu.viewmodel.MenuViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.menu.viewmodel.MenuViewModel_HiltModules$KeyModule
-dontwarn com.unifest.android.feature.navigator.IntroNavigator
-dontwarn com.unifest.android.feature.navigator.MainNavigator
-dontwarn com.unifest.android.feature.navigator.Navigator$DefaultImpls
-dontwarn com.unifest.android.feature.navigator.Navigator
-dontwarn com.unifest.android.feature.navigator.SplashNavigator
-dontwarn com.unifest.android.feature.waiting.navigation.WaitingNavigationKt
-dontwarn com.unifest.android.feature.waiting.viewmodel.WaitingViewModel
-dontwarn com.unifest.android.feature.waiting.viewmodel.WaitingViewModel_HiltModules$BindsModule
-dontwarn com.unifest.android.feature.waiting.viewmodel.WaitingViewModel_HiltModules$KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_data_di_HiltWrapper_DataSourceModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_data_di_HiltWrapper_FirebaseModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_data_di_HiltWrapper_RepositoryModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_database_di_DaoModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_database_di_DatabaseModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_datastore_di_DataSourceModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_datastore_di_HiltWrapper_DataStoreModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_network_di_ApiModule
-dontwarn hilt_aggregated_deps._com_unifest_android_core_network_di_HiltWrapper_NetworkModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_booth_viewmodel_BoothViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_booth_viewmodel_BoothViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_festival_viewmodel_FestivalViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_festival_viewmodel_FestivalViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_home_viewmodel_HomeViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_home_viewmodel_HomeViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_liked_booth_viewmodel_LikedBoothViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_liked_booth_viewmodel_LikedBoothViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_map_viewmodel_MapViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_map_viewmodel_MapViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_menu_viewmodel_MenuViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_menu_viewmodel_MenuViewModel_HiltModules_KeyModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_waiting_viewmodel_WaitingViewModel_HiltModules_BindsModule
-dontwarn hilt_aggregated_deps._com_unifest_android_feature_waiting_viewmodel_WaitingViewModel_HiltModules_KeyModule
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.unifest.android.initializer
import android.content.Context
import androidx.startup.Initializer
import com.google.firebase.messaging.FirebaseMessaging
import com.unifest.android.BuildConfig
import timber.log.Timber

class FirebaseMessagingInitializer : Initializer<Unit> {
Expand All @@ -15,6 +16,17 @@ class FirebaseMessagingInitializer : Initializer<Unit> {
Timber.e("Failed to subscribe to topic")
}
}

if (BuildConfig.DEBUG) {
FirebaseMessaging.getInstance().subscribeToTopic("test")
.addOnCompleteListener { task ->
if (task.isSuccessful) {
Timber.d("Subscribed to topic successfully")
} else {
Timber.e("Failed to subscribe to topic")
}
}
}
}

override fun dependencies(): List<Class<out Initializer<*>>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ import timber.log.Timber
class UnifestFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
Timber.d("$remoteMessage")
Timber.d("${remoteMessage.notification?.title}")
Timber.d("${remoteMessage.notification?.body}")
Timber.d("${remoteMessage.data.size}")
Timber.d("${remoteMessage.data.keys}")
Timber.d("${remoteMessage.data.entries}")

if (remoteMessage.notification != null) {
sendNotification(remoteMessage)
}
Expand All @@ -24,18 +31,18 @@ class UnifestFirebaseMessagingService : FirebaseMessagingService() {
private fun sendNotification(remoteMessage: RemoteMessage) {
val requestCode = System.currentTimeMillis().toInt()

// Activity 의 onNewIntent 가 호출되기 위해선 해당 flag 들이 필요함
val intent = Intent(this, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).also {
if (remoteMessage.data["boothId"] != null) {
if (remoteMessage.data["waitingId"] != null) {
Timber.tag("UnifestFirebaseMessagingService").d("waitingId: ${remoteMessage.data["waitingId"]}")
putExtra("navigate_to_waiting", true)
putExtra("waitingId", remoteMessage.data["waitingId"])
} else {
Timber.tag("UnifestFirebaseMessagingService").d("boothId: ${remoteMessage.data["boothId"]}")
putExtra("navigate_to_booth", true)
putExtra("boothId", remoteMessage.data["boothId"])
}
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
}

for (key in remoteMessage.data.keys) {
val value = remoteMessage.data[key]
when {
value == null -> Timber.d("Null value for key: $key")
else -> {
intent.putExtra(key, value)
Timber.d("data -> key $key -> $value")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
compileOnly(libs.gradle.android)
compileOnly(libs.gradle.kotlin)
compileOnly(libs.gradle.androidx.room)
compileOnly(libs.compose.compiler.extension)
// compileOnly(libs.compose.compiler.extension)

compileOnly(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import org.gradle.kotlin.dsl.configure

internal class AndroidApplicationComposeConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.ANDROID_APPLICATION, Plugins.COMPOSE_COMPILER)
// applyPlugins(Plugins.ANDROID_APPLICATION, Plugins.COMPOSE_COMPILER)
applyPlugins(Plugins.ANDROID_APPLICATION)

extensions.configure<ApplicationExtension> {
configureCompose(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import org.gradle.kotlin.dsl.configure

internal class AndroidLibraryComposeConventionPlugin : BuildLogicConventionPlugin(
{
applyPlugins(Plugins.ANDROID_LIBRARY, Plugins.COMPOSE_COMPILER)
// applyPlugins(Plugins.ANDROID_LIBRARY, Plugins.COMPOSE_COMPILER)
applyPlugins(Plugins.ANDROID_LIBRARY)

extensions.configure<LibraryExtension> {
configureCompose(this)
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/com/unifest/android/Android.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension

internal fun Project.configureAndroid(extension: CommonExtension<*, *, *, *, *, *>) {
internal fun Project.configureAndroid(extension: CommonExtension<*, *, *, *, *>) {
extension.apply {
compileSdk = libs.versions.compileSdk.get().toInt()

Expand Down
59 changes: 47 additions & 12 deletions build-logic/src/main/kotlin/com/unifest/android/Compose.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,60 @@ package com.unifest.android

import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

internal fun Project.configureCompose(extension: CommonExtension<*, *, *, *, *, *>) {
//internal fun Project.configureCompose(extension: CommonExtension<*, *, *, *, *, *>) {
// extension.apply {
// dependencies {
// implementation(libs.bundles.androidx.compose)
// debugImplementation(libs.androidx.compose.ui.tooling)
// }
//
// configure<ComposeCompilerGradlePluginExtension> {
// enableStrongSkippingMode.set(true)
// includeSourceInformation.set(true)
//
// metricsDestination.file("build/composeMetrics")
// reportsDestination.file("build/composeReports")
//
// stabilityConfigurationFile.set(project.rootDir.resolve("stability.config.conf"))
// }
// }
//}

internal fun Project.configureCompose(extension: CommonExtension<*, *, *, *, *>) {
extension.apply {
dependencies {
implementation(libs.bundles.androidx.compose)
debugImplementation(libs.androidx.compose.ui.tooling)
buildFeatures {
compose = true
}

configure<ComposeCompilerGradlePluginExtension> {
enableStrongSkippingMode.set(true)
includeSourceInformation.set(true)
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

metricsDestination.file("build/composeMetrics")
reportsDestination.file("build/composeReports")
dependencies {
implementation(libs.androidx.compose.bom)
androidTestImplementation(libs.androidx.compose.bom)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling.preview)
debugImplementation(libs.androidx.compose.ui.tooling)
}
}

stabilityConfigurationFile.set(project.rootDir.resolve("stability.config.conf"))
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$rootDir/report/compose-metrics",
)
freeCompilerArgs = freeCompilerArgs + listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$rootDir/report/compose-reports",
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal val Project.isAndroidProject: Boolean
get() = pluginManager.hasPlugin(Plugins.ANDROID_APPLICATION) ||
pluginManager.hasPlugin(Plugins.ANDROID_LIBRARY)

internal val Project.androidExtensions: CommonExtension<*, *, *, *, *, *>
internal val Project.androidExtensions: CommonExtension<*, *, *, *, *>
get() {
return if (pluginManager.hasPlugin(Plugins.ANDROID_APPLICATION)) {
extensions.getByType<BaseAppModuleExtension>()
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/com/unifest/android/Plugins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal object Plugins {

const val ANDROID_APPLICATION = "com.android.application"
const val ANDROID_LIBRARY = "com.android.library"
const val COMPOSE_COMPILER = "org.jetbrains.kotlin.plugin.compose"
// const val COMPOSE_COMPILER = "org.jetbrains.kotlin.plugin.compose"

const val ANDROIDX_ROOM = "androidx.room"

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.compose.compiler) apply false
// alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.google.service) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.investigator) apply false
// alias(libs.plugins.compose.investigator) apply false
}

buildscript {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import com.unifest.android.core.data.repository.OnboardingRepository
import com.unifest.android.core.data.repository.OnboardingRepositoryImpl
import com.unifest.android.core.data.repository.RemoteConfigRepository
import com.unifest.android.core.data.repository.RemoteConfigRepositoryImpl
import com.unifest.android.core.data.repository.SettingRepository
import com.unifest.android.core.data.repository.SettingRepositoryImpl
import com.unifest.android.core.data.repository.WaitingRepository
import com.unifest.android.core.data.repository.WaitingRepositoryImpl
import dagger.Binds
Expand Down Expand Up @@ -56,4 +58,8 @@ internal abstract class RepositoryModule {
@Binds
@Singleton
abstract fun bindMessagingRepository(messagingRepositoryImpl: MessagingRepositoryImpl): MessagingRepository

@Binds
@Singleton
abstract fun bindSettingRepository(settingRepositoryImpl: SettingRepositoryImpl): SettingRepository
}
Loading
Loading