From 4d5ed3d69f28d9617c9c0c5861d590e98137fd48 Mon Sep 17 00:00:00 2001 From: Jen Date: Sat, 25 Jun 2022 00:07:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[FEAT]=20#235=20=EC=9C=A0=EC=A0=80=EB=94=94?= =?UTF-8?q?=ED=8F=B4=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChaRo-iOS/ChaRo-iOS.xcodeproj/project.pbxproj | 4 ++-- ChaRo-iOS/ChaRo-iOS/Resource/Info.plist | 1 + ChaRo-iOS/ChaRo-iOS/Source/Services/Contants.swift | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChaRo-iOS/ChaRo-iOS.xcodeproj/project.pbxproj b/ChaRo-iOS/ChaRo-iOS.xcodeproj/project.pbxproj index 877c253f..f57ad82e 100644 --- a/ChaRo-iOS/ChaRo-iOS.xcodeproj/project.pbxproj +++ b/ChaRo-iOS/ChaRo-iOS.xcodeproj/project.pbxproj @@ -2045,7 +2045,7 @@ CODE_SIGN_ENTITLEMENTS = "ChaRo-iOS/ChaRo-iOS.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 2ZS26WP93H; + DEVELOPMENT_TEAM = J8A843466G; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -2077,7 +2077,7 @@ CODE_SIGN_ENTITLEMENTS = "ChaRo-iOS/ChaRo-iOS.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 2ZS26WP93H; + DEVELOPMENT_TEAM = J8A843466G; "EXCLUDED_ARCHS[sdk=*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/ChaRo-iOS/ChaRo-iOS/Resource/Info.plist b/ChaRo-iOS/ChaRo-iOS/Resource/Info.plist index 76fbdc5a..47a3e9db 100644 --- a/ChaRo-iOS/ChaRo-iOS/Resource/Info.plist +++ b/ChaRo-iOS/ChaRo-iOS/Resource/Info.plist @@ -86,6 +86,7 @@ fetch remote-notification + voip UILaunchStoryboardName LaunchScreen diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Services/Contants.swift b/ChaRo-iOS/ChaRo-iOS/Source/Services/Contants.swift index 41267643..ee5777e6 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Services/Contants.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Services/Contants.swift @@ -12,10 +12,10 @@ struct Constants { // MARK: - BASE URL static let baseURL = "http://52.79.108.141:5000" - static let userId = UserDefaults.standard.string(forKey: "userId") ?? "ios@gmail.com" - static let nickName = UserDefaults.standard.string(forKey: "nickname") ?? "지으니" - static let profileName = UserDefaults.standard.string(forKey: "profileImage") ?? "https://charo-image.s3.ap-northeast-2.amazonaws.com/dummy/jieun.JPG" - static let userEmail = UserDefaults.standard.string(forKey: "userEmail") ?? "ios@gmail.com" + static let userId = UserDefaults.standard.string(forKey: Constants.UserDefaultsKey.userEmail) ?? "ios@gmail.com" + static let nickName = UserDefaults.standard.string(forKey: Constants.UserDefaultsKey.userNickname) ?? "지으니" + static let profileName = UserDefaults.standard.string(forKey: Constants.UserDefaultsKey.userImage) ?? "https://charo-image.s3.ap-northeast-2.amazonaws.com/dummy/jieun.JPG" + static let userEmail = UserDefaults.standard.string(forKey: Constants.UserDefaultsKey.userEmail) ?? "ios@gmail.com" // MARK: - Feature URL From 91785bb55101c21df7aaabe0cafb4174c9d62622 Mon Sep 17 00:00:00 2001 From: Jen Date: Sat, 25 Jun 2022 00:13:36 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[FEAT]=20=EC=88=98=EC=A0=95=20=EB=B7=B0=20?= =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift index e0a85225..568275e7 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift @@ -302,8 +302,8 @@ extension SettingVC: UITableViewDataSource { let changeImageVC = ChangeImageVC() self.navigationController?.pushViewController(changeImageVC, animated: true) case 1: - let findPasswordVC = FindPasswordVC() - self.navigationController?.pushViewController(findPasswordVC, animated: true) + let changePasswordVC = ChangePasswordVC() + self.navigationController?.pushViewController(changePasswordVC, animated: true) default: break } From d22ce7674aa8e6235e3ca480efa6e15e8ed0efde Mon Sep 17 00:00:00 2001 From: Jen Date: Sat, 25 Jun 2022 00:41:14 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[FEAT]=20#235=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=9C=A0=EC=A0=80=EB=94=94=ED=8F=B4=ED=8A=B8=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChaRo-iOS/Source/Services/UserDefaultKey.swift | 14 ++++++++++++++ .../Source/Views/VCs/SettingScene/SettingVC.swift | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Services/UserDefaultKey.swift b/ChaRo-iOS/ChaRo-iOS/Source/Services/UserDefaultKey.swift index 69868457..c8cc53fb 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Services/UserDefaultKey.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Services/UserDefaultKey.swift @@ -6,6 +6,7 @@ // import Foundation +import SwiftUI extension Constants { struct UserDefaultsKey { @@ -24,4 +25,17 @@ extension Constants { static let isKakaoLogin = "isKakaoLogin" static let isGoogleLogin = "isGoogleLogin" } + + static func removeAllUserDefaults() { + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userEmail) + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userPassword) + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userNickname) + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.userImage) + + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isLogin) + + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isAppleLogin) + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isKakaoLogin) + UserDefaults.standard.removeObject(forKey: Constants.UserDefaultsKey.isGoogleLogin) + } } diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift index 568275e7..e2412093 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SettingScene/SettingVC.swift @@ -171,8 +171,9 @@ extension SettingVC { /// LoginSB의 루트 네비게이션 컨트롤러로 화면전환하는 메서드 private func presentToSignNC() { + Constants.removeAllUserDefaults() guard let signNC = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: SignNC.className) - as? SignNC else {return} + as? SignNC else { return } signNC.modalPresentationStyle = .overFullScreen self.present(signNC, animated: true, completion: nil) } From b9a247b0e2ef99d0f40871edfe6f5ca4c1ce4d60 Mon Sep 17 00:00:00 2001 From: Jen Date: Sat, 25 Jun 2022 01:16:45 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[FEAT]=20#235=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=9C=A0=EC=A0=80=EB=94=94=ED=8F=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=88=98=EC=A0=95,=20=EC=9C=A0=EC=A0=80=EB=94=94?= =?UTF-8?q?=ED=8F=B4=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/Views/VCs/MyPageScene/MyPageVC.swift | 5 ++--- .../Source/Views/VCs/SignScene/SNSLoginVC.swift | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/MyPageScene/MyPageVC.swift b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/MyPageScene/MyPageVC.swift index 8cad211b..e1ec6bfb 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/MyPageScene/MyPageVC.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/MyPageScene/MyPageVC.swift @@ -18,8 +18,7 @@ class MyPageVC: UIViewController { let userheight = UIScreen.main.bounds.height var tabbarBottomConstraint: Int = 0 -// var isLogin: Bool = UserDefaults.standard.bool(forKey: "isLogin") ?? true - var isLogin: Bool = true + var isLogin: Bool = UserDefaults.standard.bool(forKey: Constants.UserDefaultsKey.isLogin) ?? false private var userProfileData: [UserInformation] = [] //var writenPostData: [MyPagePost] = [] @@ -31,7 +30,7 @@ class MyPageVC: UIViewController { var currentState: String = "인기순" //무한스크롤을 위함 - var myId: String = UserDefaults.standard.string(forKey: "userId") ?? "ios@gmail.com" + var myId: String = UserDefaults.standard.string(forKey: Constants.UserDefaultsKey.userEmail) ?? "ios@gmail.com" var lastId: Int = 0 var lastFavorite: Int = 0 var isLast: Bool = false diff --git a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/SNSLoginVC.swift b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/SNSLoginVC.swift index e1dc99d4..2926b43f 100644 --- a/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/SNSLoginVC.swift +++ b/ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/SNSLoginVC.swift @@ -91,6 +91,7 @@ class SNSLoginVC: UIViewController { @objc func lookAroundButtonClicked() { //isLogin 값을 false로 설정 - 둘러보기이므로 계정 없음 + Constants.removeAllUserDefaults() UserDefaults.standard.set(false, forKey: Constants.UserDefaultsKey.isLogin) self.goToHomeVC() } @@ -118,7 +119,14 @@ class SNSLoginVC: UIViewController { snsType = "G" GIDSignIn.sharedInstance.signIn(with: signInConfig, presenting: self) { user, error in guard error == nil else { return } - let userEmail = user?.profile?.email + + guard let userEmail = user?.profile?.email else { + self.makeAlert(title: "로그인 오류", + message: "선택된 구글 아이디가 없습니다.") + return + } + + self.socialLogin(email: userEmail, profileImage: nil, nickname: nil) //여기 유저 이미지 ... String 으로 변환 모루겟다 // do { // var userProfileImageString = try String(contentsOf: URL(string: (user?.profile?.imageURL(withDimension: 320)!)!)!) @@ -128,7 +136,6 @@ class SNSLoginVC: UIViewController { // } //로그인 - self.socialLogin(email: userEmail!, profileImage: nil, nickname: nil) } }