Skip to content

Commit

Permalink
[MIN-44] feat: manifest 리다이렉션 및 exported 설정 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
KDW03 committed Feb 11, 2023
1 parent 763cea2 commit 93a6405
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
17 changes: 0 additions & 17 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

9 changes: 4 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name=".MineMeApplication"
android:allowBackup="true"
Expand All @@ -15,11 +17,8 @@
tools:targetApi="33">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
android:exported="false">

<meta-data
android:name="android.app.lib_name"
android:value="" />
Expand Down
9 changes: 8 additions & 1 deletion onboarding/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

<uses-permission android:name="android.permission.INTERNET" />


<application>
<activity
android:name=".SplashActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>
<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
Expand All @@ -17,6 +21,9 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- Redirect URI: "kakao${NATIVE_APP_KEY}://oauth" -->

<data
android:host="oauth"
android:scheme="kakao${NATIVE_APP_KEY}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import com.najudoryeong.mineme.common_ui.MainActivityUtil
import com.najudoryeong.mineme.onboarding.R
import com.najudoryeong.mineme.onboarding.databinding.FragmentLoginBinding
import com.najudoryeong.mineme.onboarding.databinding.FragmentOnBoardingViewPagerBinding
import dagger.hilt.android.AndroidEntryPoint


@AndroidEntryPoint
class LoginFragment : Fragment() {

private var _binding: FragmentLoginBinding? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.najudoryeong.mineme.onboarding
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.util.Log
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.common.model.ClientError
import com.kakao.sdk.common.model.ClientErrorCause
Expand All @@ -29,14 +30,15 @@ class LoginUtil {
// 카카오톡으로 로그인 할 수 없어 카카오계정으로 로그인할 경우 사용됨
val callback: (OAuthToken?, Throwable?) -> Unit = { token, error ->
if (error != null) {
// 카카오 계정으로 로그인 실패
Log.d("errorLogin",error.toString())
} else {
onLoginSuccess(token?.accessToken)
// 카카오 계정으로 로그인 성공
}
}

// 카카오톡이 설치되어 있으면 카카오톡 로그인, 아니면 카카오계정으로 로그인
Log.d("errorLogin",UserApiClient.instance.isKakaoTalkLoginAvailable(context).toString())
if (UserApiClient.instance.isKakaoTalkLoginAvailable(context)) {
UserApiClient.instance.loginWithKakaoTalk(context) { token, error ->
if (error != null) {
Expand All @@ -61,6 +63,7 @@ class LoginUtil {
} else {
//카카오톡 설치 x => 카카오 계정으로 로그인
UserApiClient.instance.loginWithKakaoAccount(context, callback = callback)

}


Expand Down

0 comments on commit 93a6405

Please sign in to comment.