Skip to content

Commit 27cb2dd

Browse files
committed
[IDLE-000] AppsFlyer Deferred DeepLink 버그 수정
1 parent 2ec3841 commit 27cb2dd

File tree

3 files changed

+21
-30
lines changed

3 files changed

+21
-30
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
namespace = "com.idle.care"
1212

1313
defaultConfig {
14-
versionCode = 16
15-
versionName = "1.2.1"
14+
versionCode = 17
15+
versionName = "1.2.2"
1616
targetSdk = 34
1717

1818
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

presentation/src/main/java/com/idle/presentation/MainActivity.kt

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ import androidx.navigation.NavController
2222
import androidx.navigation.fragment.NavHostFragment
2323
import androidx.navigation.ui.setupWithNavController
2424
import com.appsflyer.AppsFlyerLib
25-
import com.appsflyer.deeplink.DeepLink
2625
import com.appsflyer.deeplink.DeepLinkResult
2726
import com.idle.analytics.AnalyticsEvent
2827
import com.idle.analytics.businessmetric.AnalyticsHelper
2928
import com.idle.auth.AuthFragmentDirections
3029
import com.idle.binding.MainEvent
3130
import com.idle.binding.ShareJobPostingInfo
32-
import com.idle.binding.ToastType
3331
import com.idle.binding.repeatOnStarted
3432
import com.idle.designsystem.binding.component.dismissToast
3533
import com.idle.designsystem.binding.component.showToast
@@ -206,7 +204,7 @@ class MainActivity : AppCompatActivity() {
206204

207205
private fun showForceUpdateDialog(info: ForceUpdate) {
208206
val currentVersion = packageManager.getPackageInfo(packageName, 0).versionName
209-
if (!checkShouldUpdate(currentVersion, info.minVersion)) {
207+
if (checkShouldUpdate(currentVersion, info.minVersion)) {
210208
forceUpdateFragment = ForceUpdateFragment(info).apply { isCancelable = false }
211209
forceUpdateFragment.show(supportFragmentManager, forceUpdateFragment.tag)
212210
}
@@ -246,34 +244,28 @@ class MainActivity : AppCompatActivity() {
246244
private fun handleDeepLinking() {
247245
AppsFlyerLib.getInstance().subscribeForDeepLink { deepLinkResult ->
248246
when (deepLinkResult.status) {
249-
DeepLinkResult.Status.FOUND -> handleDeepLink(deepLinkResult.deepLink)
247+
DeepLinkResult.Status.FOUND -> {
248+
val sharedJobPostingId =
249+
deepLinkResult.deepLink.getStringValue("deep_link_value")
250+
val sharedJobPostingType =
251+
deepLinkResult.deepLink.getStringValue("deep_link_sub1")
252+
253+
handleDeepLink(sharedJobPostingId, sharedJobPostingType)
254+
}
255+
250256
DeepLinkResult.Status.NOT_FOUND -> viewModel.errorLoggingHelper.logError(Exception("AppsFlyer User Not Found"))
251257
else -> viewModel.errorLoggingHelper.logError(Exception(deepLinkResult.error.toString()))
252258
}
253259
}
254260
}
255261

256-
private fun handleDeepLink(deepLink: DeepLink) {
257-
try {
258-
val sharedJobPostingId = deepLink.deepLinkValue
259-
val sharedJobPostingType = deepLink.getStringValue("deep_link_sub1")
260-
261-
showToast(
262-
this,
263-
"sharedJobPostingId: $sharedJobPostingId, sharedJobPostingTpye : $sharedJobPostingType",
264-
toastType = ToastType.SUCCESS,
265-
paddingBottom = 50
262+
private fun handleDeepLink(sharedJobPostingId: String?, sharedJobPostingType: String?) {
263+
viewModel.setSharedJobPostingInfo(
264+
SharedJobPostingInfo(
265+
jobPostingId = sharedJobPostingId ?: return,
266+
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
266267
)
267-
268-
viewModel.setSharedJobPostingInfo(
269-
SharedJobPostingInfo(
270-
jobPostingId = sharedJobPostingId ?: return,
271-
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
272-
)
273-
)
274-
} catch (e: Exception) {
275-
viewModel.errorLoggingHelper.logError(e)
276-
}
268+
)
277269
}
278270

279271
private fun showNetworkDialog() {

presentation/src/main/res/layout/fragment_force_update.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636
android:layout_width="wrap_content"
3737
android:layout_height="wrap_content"
3838
android:layout_marginBottom="24dp"
39-
android:text="유저분들의 의견을 반영해 앱을 더 발전시켰어요.\n
40-
보다 좋은 서비스를 만나기 위해, 업데이트해주세요."
41-
android:textAlignment="center"
42-
android:maxLines="4"
4339
android:ellipsize="end"
40+
android:maxLines="3"
41+
android:text="@{viewModel.forceUpdate.noticeMsg}"
42+
android:textAlignment="center"
4443
android:textColor="@color/gray_500" />
4544

4645
<LinearLayout

0 commit comments

Comments
 (0)