Skip to content

Commit

Permalink
release snutt 3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
plgafhd committed Aug 10, 2024
1 parent 650e3fe commit 3ee46db
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.google.android.gms.auth.api.signin.GoogleSignInClient
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.gms.common.api.ApiException
import com.google.android.gms.tasks.Task
import com.google.firebase.crashlytics.FirebaseCrashlytics
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.common.model.AuthError
import com.kakao.sdk.common.model.AuthErrorCause
Expand Down Expand Up @@ -155,15 +156,19 @@ fun TutorialPage() {
val loginWithKakaoAccountCallback: (OAuthToken?, Throwable?) -> Unit = { token, error ->
if (error != null) {
if (error is ClientError && error.reason == ClientErrorCause.Cancelled) {
firebaseTest(error)
context.toast(context.getString(R.string.sign_in_kakao_failed_cancelled))
} else if (error is AuthError && error.reason == AuthErrorCause.AccessDenied) {
firebaseTest(error)
context.toast(context.getString(R.string.sign_in_kakao_failed_cancelled))
} else {
firebaseTest(error)
context.toast(context.getString(R.string.sign_in_kakao_failed_unknown))
}
} else if (token != null) {
loginWithKaKaoAccessToken(token.accessToken)
} else {
firebaseTest("KakaoAccount Login Failed Unknown")
context.toast(context.getString(R.string.sign_in_kakao_failed_unknown))
}
}
Expand All @@ -173,21 +178,26 @@ fun TutorialPage() {
UserApiClient.instance.loginWithKakaoTalk(context) { token, loginError ->
if (loginError != null) {
if (loginError is ClientError && loginError.reason == ClientErrorCause.Cancelled) {
firebaseTest(loginError)
context.toast(context.getString(R.string.sign_in_kakao_failed_cancelled))
} else if (loginError is AuthError && loginError.reason == AuthErrorCause.AccessDenied) {
firebaseTest(loginError)
context.toast(context.getString(R.string.sign_in_kakao_failed_cancelled))
} else {
// 카카오계정으로 로그인
firebaseTest(loginError)
UserApiClient.instance.loginWithKakaoAccount(context = context, callback = loginWithKakaoAccountCallback)
}
} else if (token != null) {
loginWithKaKaoAccessToken(token.accessToken)
} else {
firebaseTest("KakaoTalk Login Unknown")
context.toast(context.getString(R.string.sign_in_kakao_failed_unknown))
}
}
} else {
// 카카오계정으로 로그인
firebaseTest("KakaoTalk Login Failed")
UserApiClient.instance.loginWithKakaoAccount(context = context, callback = loginWithKakaoAccountCallback)
}
}
Expand Down Expand Up @@ -296,3 +306,22 @@ fun TutorialPage() {
fun TutorialPagePreview() {
TutorialPage()
}

fun firebaseTest(errorName: String) {
try {
throw Exception("snutt 3.7.1 firebase test Exception - $errorName")
} catch (e: Exception) {
FirebaseCrashlytics.getInstance().recordException(
Throwable(cause = e, message = errorName),
)
}
}

fun firebaseTest(error: Throwable?) {
if (error != null) {
FirebaseCrashlytics.getInstance().recordException(
error,
)
}
}

2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
snuttVersionName=3.6.0
snuttVersionName=3.7.1

0 comments on commit 3ee46db

Please sign in to comment.