문의 시 사용하시는 SDK 버전 정보를 알려주세요.
sdk 버전 : implementation “com.kakao.sdk:v2-user:2.12.0” // 카카오 로그인
카카오톡으로 로그인을 선택하고 하단 소프트키로 뒤로가기를 했을 때
TalkAuthCodeActivity가 finish 되고 키 이벤트가 소비되지 않고 fragment 까지 전달되서
fragment에 정의된 뒤로가기가 수행되는 상황입니다.
- back event 한번 → )TalkAuthCodeActivity finish → fragment back
- 카카오톡으로 로그인 화면에 "취소"를 누르면 정상동작
카카오톡 로그인을 아래와 같이 사용중입니다.
sdk를 잘못사용하고 있는것인지 sdk 오류 인지 문의드립니다.
코드
private suspend fun handleKakaoLogin(): Boolean =
suspendCoroutine<Boolean> { continuation ->
val callback: (OAuthToken?, Throwable?) -> Unit = { token, error ->
if (error != null) {
Timber.e("카카오계정으로 로그인 실패 $error")
if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
//test
continuation.resume(false)
} else {
continuation.resume(false)
}
} else if (token != null) {
Timber.i("카카오계정으로 로그인 성공 ${token.accessToken}")
UserApiClient.instance.me { user, error ->
if (error != null) {
Timber.e("사용자 정보 요청 실패 $error")
continuation.resume(false)
} else if (user != null) {
Timber.e("사용자 정보 요청 성공 : $user")
viewModel.postSnsLogin("KK", user.id.toString())
continuation.resume(true)
}
}
}
}
UserApiClient.instance.let { kakao ->
kakao.me { user, error ->
if (error != null) {
Timber.e("사용자 정보 요청 실패 $error")
if (kakao.isKakaoTalkLoginAvailable(requireActivity())) {
**kakao.loginWithKakaoTalk(requireActivity(), callback = callback)**
} else {
kakao.loginWithKakaoAccount(requireActivity(), callback = callback)
}
} else {
user?.let {
viewModel.postSnsLogin("KK", it.id.toString())
continuation.resume(true)
}
}
}
}
}
로그
2477-6019 InputManager-JNI pid-2477 W Input channel object ‘cb2a454 com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity (client)’ was disposed without first being removed with the input manager!
2477-2636 WindowManager pid-2477 I Reparenting to original parent: Surface(name=Task=12708)/@0x62258c9, destroy=true, surface=Surface(name=ActivityRecord{efa29cb u0 com.kakao.talk/com.kakao.sdk.CapriLoggedInActivity})/@0xa0e31bd
2477-2636 WindowManager pid-2477 V Setting visibility of Window{88cdae4 u0 com.kakao.talk/com.kakao.sdk.CapriLoggedInActivity}: false, caller=com.android.server.wm.WindowContainer.sendAppVisibilityToClients:1236 com.android.server.wm.WindowToken.setClientVisible:431 com.android.server.wm.ActivityRecord.setClientVisible:7587 com.android.server.wm.ActivityRecord.onAnimationFinished:8445 com.android.server.wm.WindowContainer$$ExternalSyntheticLambda4.onAnimationFinished:2
2477-2636 WindowManager pid-2477 I Reparenting to original parent: Surface(name=Task=12708)/@0x62258c9, destroy=true, surface=Surface(name=ActivityRecord{dce6a24 u0 com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity})/@0xce8c367
2477-2636 WindowManager pid-2477 V Setting visibility of Window{cb2a454 u0 com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity EXITING}: false, caller=com.android.server.wm.WindowContainer.sendAppVisibilityToClients:1236 com.android.server.wm.WindowToken.setClientVisible:431 com.android.server.wm.ActivityRecord.setClientVisible:7587 com.android.server.wm.ActivityRecord.onAnimationFinished:8445 com.android.server.wm.WindowContainer$$ExternalSyntheticLambda4.onAnimationFinished:2
2477-2636 WindowManager pid-2477 E win=Window{cb2a454 u0 com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity EXITING} destroySurfaces: appStopped=false cleanupOnResume=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.ActivityRecord.destroySurfaces:6443 com.android.server.wm.ActivityRecord.destroySurfaces:6424 com.android.server.wm.WindowState.onExitAnimationDone:5915 com.android.server.wm.ActivityRecord$$ExternalSyntheticLambda11.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.ActivityRecord.onAnimationFinished:8462 com.android.server.wm.WindowContainer$$ExternalSyntheticLambda4.onAnimationFinished:2
2477-2636 WindowManager pid-2477 I Destroying surface Surface(name=com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity$_28751)/@0xffa50b6 called by com.android.server.wm.WindowStateAnimator.destroySurface:907 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:519 com.android.server.wm.WindowState.destroySurfaceUnchecked:4253 com.android.server.wm.WindowState.destroySurface:4227 com.android.server.wm.ActivityRecord.destroySurfaces:6443 com.android.server.wm.ActivityRecord.destroySurfaces:6424 com.android.server.wm.WindowState.onExitAnimationDone:5915 com.android.server.wm.ActivityRecord$$ExternalSyntheticLambda11.accept:2
1808-1808 Layer pid-1808 I id=208451 removedFromDrawingState com.kyobo.nalcee.dev/com.kakao.sdk.auth.TalkAuthCodeActivity$_28751#208451 (122)