Skip to content

Commit 79a4ba9

Browse files
committed
[CHORE/#273] 마켓 이동 함수를 AppUpdateUtils를 사용합니다.
1 parent 0fa677f commit 79a4ba9

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

app/src/main/java/com/sopt/clody/core/review/InAppReviewManager.kt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.sopt.clody.core.review
22

33
import android.app.Activity
4-
import android.content.Intent
5-
import android.net.Uri
4+
import android.content.Context
65
import com.google.android.play.core.review.ReviewManagerFactory
6+
import com.sopt.clody.presentation.utils.appupdate.AppUpdateUtils
77
import timber.log.Timber
88

99
object InAppReviewManager {
10-
fun showPopup(activity: Activity) {
10+
fun showPopup(activity: Activity, context: Context) {
1111
if (activity.isFinishing || activity.isDestroyed) return
1212

1313
val reviewManager = ReviewManagerFactory.create(activity)
@@ -19,15 +19,7 @@ object InAppReviewManager {
1919
reviewManager.launchReviewFlow(activity, reviewInfo)
2020
} else {
2121
try {
22-
val uri = Uri.parse("market://details?id=${activity.packageName}")
23-
val intent = Intent(Intent.ACTION_VIEW, uri)
24-
if (intent.resolveActivity(activity.packageManager) != null) {
25-
activity.startActivity(intent)
26-
} else {
27-
val webUri = Uri.parse("https://play.google.com/store/apps/details?id=${activity.packageName}")
28-
val webIntent = Intent(Intent.ACTION_VIEW, webUri)
29-
activity.startActivity(webIntent)
30-
}
22+
AppUpdateUtils.navigateToMarket(context)
3123
} catch (e: Exception) {
3224
e.printStackTrace()
3325
Timber.e(e, "Failed to open store for app review")

app/src/main/java/com/sopt/clody/presentation/ui/home/screen/HomeScreen.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import com.sopt.clody.presentation.utils.amplitude.AmplitudeConstraints
3535
import com.sopt.clody.presentation.utils.amplitude.AmplitudeUtils
3636
import com.sopt.clody.presentation.utils.navigation.Route
3737
import com.sopt.clody.ui.theme.ClodyTheme
38+
import timber.log.Timber
3839
import java.time.LocalDate
3940

4041
@Composable
@@ -68,8 +69,11 @@ fun HomeRoute(
6869
else -> ""
6970
}
7071

72+
Timber.tag("showInAppReviewPopup").e(showInAppReviewPopup.toString())
73+
Timber.tag("isFromReplyDiary").e(isFromReplyDiary.toString())
74+
7175
LaunchedEffect(showInAppReviewPopup && isFromReplyDiary) {
72-
InAppReviewManager.showPopup(context as Activity)
76+
InAppReviewManager.showPopup(context as Activity, context)
7377
homeViewModel.updateShowInAppReviewPopup(false)
7478
}
7579

0 commit comments

Comments
 (0)