From 2816c5b56432962f41a14407fe3fe3da9f43042f Mon Sep 17 00:00:00 2001 From: yeonu Date: Fri, 6 Oct 2023 13:53:30 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20DeviceToken=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/xquare/xquare_android/MainActivity.kt | 7 ------- .../xquare/xquare_android/feature/signin/SignInScreen.kt | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/xquare/xquare_android/MainActivity.kt b/app/src/main/java/com/xquare/xquare_android/MainActivity.kt index 3f226aa8..ca8005fa 100644 --- a/app/src/main/java/com/xquare/xquare_android/MainActivity.kt +++ b/app/src/main/java/com/xquare/xquare_android/MainActivity.kt @@ -315,13 +315,6 @@ fun saveDeviceToken(context: Context) { } -fun getToken(context: Context): String? { - val pref = context.getSharedPreferences("token", Context.MODE_PRIVATE) - val token = pref.getString("token", null) - Log.d("TAG", "FCM token retrieved: $token") - return token -} - fun Context.getActivity(): ComponentActivity? = when (this) { is ComponentActivity -> this is ContextWrapper -> baseContext.getActivity() diff --git a/app/src/main/java/com/xquare/xquare_android/feature/signin/SignInScreen.kt b/app/src/main/java/com/xquare/xquare_android/feature/signin/SignInScreen.kt index 92966340..a45abdbe 100644 --- a/app/src/main/java/com/xquare/xquare_android/feature/signin/SignInScreen.kt +++ b/app/src/main/java/com/xquare/xquare_android/feature/signin/SignInScreen.kt @@ -32,8 +32,8 @@ import com.xquare.domain.entity.auth.SignInEntity import com.xquare.xquare_android.R import com.xquare.xquare_android.component.AppBar import com.xquare.xquare_android.component.TextField -import com.xquare.xquare_android.getToken import com.xquare.xquare_android.navigation.AppNavigationItem +import com.xquare.xquare_android.saveDeviceToken import com.xquare.xquare_android.util.DevicePaddings import com.xquare.xquare_android.util.makeToast @@ -139,7 +139,7 @@ private fun SignIn( } Spacer(Modifier.size(16.dp)) ColoredLargeButton(text = "로그인", isEnabled = isSignInEnabled) { - onSignInClick(SignInEntity(accountId, password, getToken(context).toString())) + onSignInClick(SignInEntity(accountId, password, saveDeviceToken(context).toString() )) } Spacer(Modifier.size(16.dp)) Body2(