Skip to content

Commit

Permalink
refactor #87: xcconfig 세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
enebin committed Sep 2, 2023
1 parent 58cc61f commit 0dfe8d3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
Binary file modified Encrypted/XCConfig/App/DEV.xcconfig.encrypted
Binary file not shown.
2 changes: 1 addition & 1 deletion Encrypted/XCConfig/App/PROD.xcconfig.encrypted
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�d��BJؠ���LH�8�v2c�����mH �"?^F1Xn�o^� |�т�2x>�SFgtmz \���Ԍ����uQ&uD�0�p>y�����|/�N&UcŞ�;RV��$�H�K����X6W]�nu.����i}�D�ş?��~Jod >�w���R
�d��BJؠ���LH�8�v2c�����mH �"?^F1Xn�o^� |�т�2x>�SFgtmz \���Ԍ����uQ&=O��pV��fa�zuc)�!����wW�0+SXl>7{�mD@���Z�]��增�o�_{�Z���Ex�6 l}�5`������W����.?��h��o>Hˈ4��: SѢ����C^7L�
Expand Down
6 changes: 5 additions & 1 deletion Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ public extension Project {
"CFBundleURLTypes": [
[
"CFBundleTypeRole": "Editor",
"CFBundleURLSchemes": ["keyme"]
"CFBundleURLSchemes": [
"keyme",
"kakao$(KAKAO_API_KEY)"
]
]
],
"API_BASE_URL": "$(API_BASE_URL)",
"KAKAO_API_KEY": "$(KAKAO_API_KEY)",
"UIUserInterfaceStyle": "Light",
"NSAppTransportSecurity": [
"NSExceptionDomains": [
Expand Down
30 changes: 11 additions & 19 deletions Projects/Keyme/Sources/KeymeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import FirebaseMessaging
import Features
import Network

import KakaoSDKAuth
import KakaoSDKCommon
import KakaoSDKAuth

@main
struct KeymeApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

let KAKAO_PRIVATE_KEY = "" // 🚨 SECRET 🚨

init() {
KakaoSDK.initSDK(appKey: KAKAO_PRIVATE_KEY)
}

var body: some Scene {
WindowGroup {
RootView()
.onOpenURL { url in
print(url)
if (AuthApi.isKakaoTalkLoginUrl(url)) {
_ = AuthController.handleOpenUrl(url: url)
}
}
}
}
}
Expand All @@ -33,6 +33,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
if let kakaoAPIKey = Bundle.main.object(forInfoDictionaryKey: "KAKAO_API_KEY") as? String {
KakaoSDK.initSDK(appKey: kakaoAPIKey)
}

FirebaseApp.configure()

UNUserNotificationCenter.current().delegate = self
Expand All @@ -51,18 +55,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
return true
}

func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
if (AuthApi.isKakaoTalkLoginUrl(url)) {
return AuthController.handleOpenUrl(url: url)
}

return false
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
let token = tokenParts.joined()
Expand Down
9 changes: 7 additions & 2 deletions Projects/Network/Sources/Network/API/ShortUrlAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ extension ShortUrlAPI: TargetType {
}

public var headers: [String : String]? {
let accessToken = "e9a1ab0011a56327138c36652c2242cdff37ee1b" // TODO: 밖으로
return ["Authorization": "Bearer \(accessToken)", "Content-Type": "application/json"]
var header = ["Content-Type": "application/json"]

if let accessToken = Bundle.main.object(forInfoDictionaryKey: "BITLY_API_KEY") as? String {
header["Authorization"] = "Bearer \(accessToken)"
}

return header
}
}

0 comments on commit 0dfe8d3

Please sign in to comment.