Skip to content

Commit

Permalink
[IDLE-000] AppsFlyer Deferred DeepLink 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Nov 14, 2024
1 parent 4be0904 commit 73419f3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
namespace = "com.idle.care"

defaultConfig {
versionCode = 16
versionName = "1.2.1"
versionCode = 17
versionName = "1.2.2"
targetSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
40 changes: 16 additions & 24 deletions presentation/src/main/java/com/idle/presentation/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.appsflyer.AppsFlyerLib
import com.appsflyer.deeplink.DeepLink
import com.appsflyer.deeplink.DeepLinkResult
import com.idle.analytics.AnalyticsEvent
import com.idle.analytics.businessmetric.AnalyticsHelper
import com.idle.auth.AuthFragmentDirections
import com.idle.binding.MainEvent
import com.idle.binding.ShareJobPostingInfo
import com.idle.binding.ToastType
import com.idle.binding.repeatOnStarted
import com.idle.designsystem.binding.component.dismissToast
import com.idle.designsystem.binding.component.showToast
Expand Down Expand Up @@ -206,7 +204,7 @@ class MainActivity : AppCompatActivity() {

private fun showForceUpdateDialog(info: ForceUpdate) {
val currentVersion = packageManager.getPackageInfo(packageName, 0).versionName
if (!checkShouldUpdate(currentVersion, info.minVersion)) {
if (checkShouldUpdate(currentVersion, info.minVersion)) {
forceUpdateFragment = ForceUpdateFragment(info).apply { isCancelable = false }
forceUpdateFragment.show(supportFragmentManager, forceUpdateFragment.tag)
}
Expand Down Expand Up @@ -246,34 +244,28 @@ class MainActivity : AppCompatActivity() {
private fun handleDeepLinking() {
AppsFlyerLib.getInstance().subscribeForDeepLink { deepLinkResult ->
when (deepLinkResult.status) {
DeepLinkResult.Status.FOUND -> handleDeepLink(deepLinkResult.deepLink)
DeepLinkResult.Status.FOUND -> {
val sharedJobPostingId =
deepLinkResult.deepLink.getStringValue("deep_link_value")
val sharedJobPostingType =
deepLinkResult.deepLink.getStringValue("deep_link_sub1")

handleDeepLink(sharedJobPostingId, sharedJobPostingType)
}

DeepLinkResult.Status.NOT_FOUND -> viewModel.errorLoggingHelper.logError(Exception("AppsFlyer User Not Found"))
else -> viewModel.errorLoggingHelper.logError(Exception(deepLinkResult.error.toString()))
}
}
}

private fun handleDeepLink(deepLink: DeepLink) {
try {
val sharedJobPostingId = deepLink.deepLinkValue
val sharedJobPostingType = deepLink.getStringValue("deep_link_sub1")

showToast(
this,
"sharedJobPostingId: $sharedJobPostingId, sharedJobPostingTpye : $sharedJobPostingType",
toastType = ToastType.SUCCESS,
paddingBottom = 50
private fun handleDeepLink(sharedJobPostingId: String?, sharedJobPostingType: String?) {
viewModel.setSharedJobPostingInfo(
SharedJobPostingInfo(
jobPostingId = sharedJobPostingId ?: return,
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
)

viewModel.setSharedJobPostingInfo(
SharedJobPostingInfo(
jobPostingId = sharedJobPostingId ?: return,
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
)
)
} catch (e: Exception) {
viewModel.errorLoggingHelper.logError(e)
}
)
}

private fun showNetworkDialog() {
Expand Down
7 changes: 3 additions & 4 deletions presentation/src/main/res/layout/fragment_force_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="유저분들의 의견을 반영해 앱을 더 발전시켰어요.\n
보다 좋은 서비스를 만나기 위해, 업데이트해주세요."
android:textAlignment="center"
android:maxLines="4"
android:ellipsize="end"
android:maxLines="3"
android:text="@{viewModel.forceUpdate.noticeMsg}"
android:textAlignment="center"
android:textColor="@color/gray_500" />

<LinearLayout
Expand Down

0 comments on commit 73419f3

Please sign in to comment.