diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fcb84fa4..4474ef0c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,4 +1,5 @@ PODS: + - Alamofire (5.9.1) - boost (1.83.0) - BVLinearGradient (2.8.3): - React-Core @@ -35,6 +36,22 @@ PODS: - hermes-engine (0.73.5): - hermes-engine/Pre-built (= 0.73.5) - hermes-engine/Pre-built (0.73.5) + - kakao-login (5.4.1): + - KakaoSDKAuth (= 2.22.0) + - KakaoSDKCommon (= 2.22.0) + - KakaoSDKUser (= 2.22.0) + - React + - KakaoSDKAuth (2.22.0): + - KakaoSDKCommon (= 2.22.0) + - KakaoSDKCommon (2.22.0): + - KakaoSDKCommon/Common (= 2.22.0) + - KakaoSDKCommon/Network (= 2.22.0) + - KakaoSDKCommon/Common (2.22.0) + - KakaoSDKCommon/Network (2.22.0): + - Alamofire (~> 5.9.0) + - KakaoSDKCommon/Common (= 2.22.0) + - KakaoSDKUser (2.22.0): + - KakaoSDKAuth (= 2.22.0) - libevent (2.1.12) - RCT-Folly (2022.05.16.00): - boost @@ -1131,6 +1148,7 @@ DEPENDENCIES: - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - "kakao-login (from `../node_modules/@react-native-seoul/kakao-login`)" - libevent (~> 2.1.12) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1191,7 +1209,11 @@ DEPENDENCIES: SPEC REPOS: trunk: + - Alamofire - fmt + - KakaoSDKAuth + - KakaoSDKCommon + - KakaoSDKUser - libevent - SocketRocket @@ -1225,6 +1247,8 @@ EXTERNAL SOURCES: hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-02-20-RNv0.73.5-18f99ace4213052c5e7cdbcd39ee9766cd5df7e4 + kakao-login: + :path: "../node_modules/@react-native-seoul/kakao-login" RCT-Folly: :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" RCTRequired: @@ -1335,6 +1359,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: + Alamofire: f36a35757af4587d8e4f4bfa223ad10be2422b8c boost: d3f49c53809116a5d38da093a8aa78bf551aed09 BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 @@ -1350,6 +1375,10 @@ SPEC CHECKSUMS: fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: 1d1835b2cc54c381909d94d1b3c8e0a2f1a94a0e + kakao-login: 6f7a39583ae9e1a4e76240e66ae3ec575d461d1e + KakaoSDKAuth: 569b377eda622d93d4575240b8031cd658163eef + KakaoSDKCommon: d57127c339fc79e73aa8b236a4c77211c29924f1 + KakaoSDKUser: 043bcd7e91454ebf3bf64f150c430e6f65f0a08d libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87 diff --git a/ios/SwiftBridge.swift b/ios/SwiftBridge.swift new file mode 100644 index 00000000..f843e2e1 --- /dev/null +++ b/ios/SwiftBridge.swift @@ -0,0 +1,8 @@ +// +// SwiftBridge.swift +// WAITHER +// +// Created by 오윤 on 8/21/24. +// + +import Foundation diff --git a/ios/WAITHER.xcodeproj/project.pbxproj b/ios/WAITHER.xcodeproj/project.pbxproj index 8e73505f..6d1b7e9c 100644 --- a/ios/WAITHER.xcodeproj/project.pbxproj +++ b/ios/WAITHER.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -14,6 +14,7 @@ 96905EF65AED1B983A6B3ABC /* libPods-WAITHER.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-WAITHER.a */; }; B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; }; BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; }; + DB3300462C75EA73002907F6 /* SwiftBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB3300452C75EA73002907F6 /* SwiftBridge.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -28,6 +29,7 @@ 7A4D352CD337FB3A3BF06240 /* Pods-WAITHER.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WAITHER.release.xcconfig"; path = "Target Support Files/Pods-WAITHER/Pods-WAITHER.release.xcconfig"; sourceTree = ""; }; AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = WAITHER/SplashScreen.storyboard; sourceTree = ""; }; BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = ""; }; + DB3300452C75EA73002907F6 /* SwiftBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftBridge.swift; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-WAITHER/ExpoModulesProvider.swift"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -50,6 +52,7 @@ BB2F792B24A3F905000567C9 /* Supporting */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */, + DB3300452C75EA73002907F6 /* SwiftBridge.swift */, 13B07FB51A68108700A75B9A /* Images.xcassets */, 13B07FB61A68108700A75B9A /* Info.plist */, 13B07FB71A68108700A75B9A /* main.m */, @@ -282,7 +285,9 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-WAITHER/Pods-WAITHER-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/KakaoSDKCommon/KakaoSDKCommon.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle", "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf", "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf", @@ -307,7 +312,9 @@ ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Alamofire.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/KakaoSDKCommon.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf", @@ -344,6 +351,7 @@ files = ( 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, + DB3300462C75EA73002907F6 /* SwiftBridge.swift in Sources */, B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -365,7 +373,10 @@ ); INFOPLIST_FILE = WAITHER/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", @@ -390,7 +401,10 @@ CURRENT_PROJECT_VERSION = 1; INFOPLIST_FILE = WAITHER/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", @@ -454,7 +468,10 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -512,7 +529,10 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; + LD_RUNPATH_SEARCH_PATHS = ( + /usr/lib/swift, + "$(inherited)", + ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = NO; OTHER_CFLAGS = "$(inherited)"; diff --git a/ios/WAITHER.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/WAITHER.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/ios/WAITHER.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/WAITHER/AppDelegate.mm b/ios/WAITHER/AppDelegate.mm index d5d63839..cd913f7d 100644 --- a/ios/WAITHER/AppDelegate.mm +++ b/ios/WAITHER/AppDelegate.mm @@ -3,6 +3,7 @@ #import #import #import "RNSplashScreen.h" +#import @implementation AppDelegate @@ -46,6 +47,7 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull N return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result; } + // Explicitly define remote notification delegates to ensure compatibility with some third-party libraries - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { @@ -64,4 +66,5 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; } + @end diff --git a/ios/WAITHER/Info.plist b/ios/WAITHER/Info.plist index 5a1db714..7b2a27db 100644 --- a/ios/WAITHER/Info.plist +++ b/ios/WAITHER/Info.plist @@ -1,51 +1,66 @@ - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - NSAllowsLocalNetworking - - - UILaunchStoryboardName - SplashScreen - UIRequiredDeviceCapabilities - - armv7 - - UIStatusBarStyle - UIStatusBarStyleDefault - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + kakaoe4d22841db9ebef546c5e7b36489e737 + + + + CFBundleVersion + 1 + + KAKAO_APP_KEY + e4d22841db9ebef546c5e7b36489e737 + + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsLocalNetworking + + + UILaunchStoryboardName + SplashScreen + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleDefault + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + diff --git a/package-lock.json b/package-lock.json index da2867ad..b79ac6ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,10 +15,12 @@ "@react-native-community/blur": "^4.4.0", "@react-native-community/slider": "^4.5.1", "@react-native-picker/picker": "^2.7.2", + "@react-native-seoul/kakao-login": "^5.4.1", "@react-native/metro-config": "^0.75.0-main", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@types/react": "~18.2.45", + "add": "^2.0.6", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-react-hooks": "^4.6.0", "expo": "~50.0.13", @@ -5791,6 +5793,18 @@ "react-native": "*" } }, + "node_modules/@react-native-seoul/kakao-login": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@react-native-seoul/kakao-login/-/kakao-login-5.4.1.tgz", + "integrity": "sha512-ezhkX3AsJZ3Qf3b0QDJEpPIvWDqxuz2N9lKd9g90ULpzaYa+d0r7UdfCe4h+/Fo859t7t0vFSXqIbLLIHSlxFw==", + "dependencies": { + "dooboolab-welcome": "^1.3.2" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/@react-native/assets-registry": { "version": "0.73.1", "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.73.1.tgz", @@ -7416,6 +7430,11 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/add": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/add/-/add-2.0.6.tgz", + "integrity": "sha512-j5QzrmsokwWWp6kUcJQySpbG+xfOBqqKnup3OIk1pz+kB/80SLorZ9V8zHFLO92Lcd+hbvq8bT+zOGoPkmBV0Q==" + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -9284,6 +9303,15 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dooboolab-welcome": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/dooboolab-welcome/-/dooboolab-welcome-1.3.2.tgz", + "integrity": "sha512-2NbMaIIURElxEf/UAoVUFlXrO+7n/FRhLCiQlk4fkbGRh9cJ3/f8VEMPveR9m4Ug2l2Zey+UCXjd6EcBqHJ5bw==", + "hasInstallScript": true, + "bin": { + "dooboolab-welcome": "bin/hello.js" + } + }, "node_modules/dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", diff --git a/package.json b/package.json index 3add1598..80fcd7dc 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,12 @@ "@react-native-community/blur": "^4.4.0", "@react-native-community/slider": "^4.5.1", "@react-native-picker/picker": "^2.7.2", + "@react-native-seoul/kakao-login": "^5.4.1", "@react-native/metro-config": "^0.75.0-main", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@types/react": "~18.2.45", + "add": "^2.0.6", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-react-hooks": "^4.6.0", "expo": "~50.0.13", diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx index 2a31d0f6..d18bf3e5 100644 --- a/src/screens/Login.tsx +++ b/src/screens/Login.tsx @@ -9,7 +9,16 @@ import { KAKAO_LOGIN_COLOR, MAIN_COLOR, } from '../styles/color.js'; -import MainScreen from './MainScreen'; + +import { + login, + logout, + getProfile as getKakaoProfile, + shippingAddresses as getKakaoShippingAddresses, + serviceTerms as getKakaoServiceTerms, + unlink, + KakaoOAuthToken, +} from '@react-native-seoul/kakao-login'; const Wrapper = styled.View` flex-direction: column; @@ -177,15 +186,32 @@ const LoginPopupGoodText = styled.Text` export default function Login({ navigation }) { const [isModalVisible, setModalVisible] = useState(false); + const [profile, setProfile] = useState(''); + const withOutLoginOnPress = () => { setModalVisible(!isModalVisible); }; + const signInWithKakao = async (): Promise => { + const result: KakaoOAuthToken = await login(); + getProfile(); + console.log('로그인 결과', result); + }; + const getProfile = async (): Promise => { + try { + const profile = await getKakaoProfile(); + setProfile(JSON.stringify(profile)); + + console.log('프로필 조회', profile); + } catch (err) { + console.error('signOut error', err); + } + }; return ( 로그인 - navigation.navigate('Web')}> + Kakao로 계속하기