Skip to content

Commit d8a8316

Browse files
committed
Feat: 카카오 SDK 연동
- 카카오 SDK 의존성 추가 - AndroidManifest.xml에 AuthCodeHandlerActivity 추가 - Application 클래스에서 카카오 SDK 초기화 - 카카오 네이티브 앱 키 gradle.properties에서 관리
1 parent 08fc652 commit d8a8316

6 files changed

Lines changed: 44 additions & 1 deletion

File tree

app/build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Properties
2+
13
plugins {
24
alias(libs.plugins.bitnagil.android.application)
35
alias(libs.plugins.bitnagil.android.hilt)
@@ -7,8 +9,24 @@ plugins {
79
android {
810
namespace = "com.threegap.bitnagil"
911

12+
val properties =
13+
Properties().apply {
14+
load(rootProject.file("local.properties").inputStream())
15+
}
16+
1017
defaultConfig {
1118
applicationId = "com.threegap.bitnagil"
19+
20+
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] = properties["kakao.native.app.key"] as String
21+
buildConfigField(
22+
type = "String",
23+
name = "KAKAO_NATIVE_APP_KEY",
24+
value = "\"${properties["kakao.native.app.key"]}\"",
25+
)
26+
}
27+
28+
buildFeatures {
29+
buildConfig = true
1230
}
1331
}
1432

@@ -19,4 +37,5 @@ dependencies {
1937
implementation(projects.data)
2038
implementation(projects.domain)
2139
implementation(projects.presentation)
40+
implementation(libs.kakao.v2.user)
2241
}

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
<category android:name="android.intent.category.LAUNCHER" />
2626
</intent-filter>
2727
</activity>
28-
</application>
2928

29+
<activity
30+
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
31+
android:exported="true">
32+
<intent-filter>
33+
<action android:name="android.intent.action.VIEW" />
34+
35+
<category android:name="android.intent.category.DEFAULT" />
36+
<category android:name="android.intent.category.BROWSABLE" />
37+
38+
<data
39+
android:host="oauth"
40+
android:scheme="kakao${KAKAO_NATIVE_APP_KEY}" />
41+
</intent-filter>
42+
</activity>
43+
</application>
3044
</manifest>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package com.threegap.bitnagil
22

33
import android.app.Application
4+
import com.kakao.sdk.common.KakaoSdk
45
import dagger.hilt.android.HiltAndroidApp
56

67
@HiltAndroidApp
78
class BitnagilApplication : Application() {
89
override fun onCreate() {
910
super.onCreate()
11+
initKakaoSdk()
12+
}
13+
14+
private fun initKakaoSdk() {
15+
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY)
1016
}
1117
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ espressoCore = "3.6.1"
5050
material = "1.12.0"
5151
orbit = "6.1.0"
5252
javax = "1"
53+
kakaoLogin = "2.21.4"
5354

5455
[libraries]
5556
## Android Gradle Plugin
@@ -115,6 +116,7 @@ kotlin-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coro
115116

116117
## Other
117118
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
119+
kakao-v2-user = { group = "com.kakao.sdk", name = "v2-user", version.ref = "kakaoLogin" }
118120

119121
[bundles]
120122
androidx-core = [

presentation/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies {
1313

1414
implementation(libs.bundles.androidx.core)
1515
implementation(libs.bundles.orbit)
16+
implementation(libs.kakao.v2.user)
1617

1718
testImplementation(libs.junit)
1819
testImplementation(libs.kotlin.coroutines.test)

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencyResolutionManagement {
2020
repositories {
2121
google()
2222
mavenCentral()
23+
maven { url = java.net.URI("https://devrepo.kakao.com/nexus/content/groups/public/") }
2324
}
2425
}
2526

0 commit comments

Comments
 (0)