본문 바로가기

UIKIT/Firebase

(10)
🔍 Firebase Storage listAll(completion:) 설명 https://explorer89.tistory.com/380 🔥 Firebase의 Storage 내에 저장된 여러 이미지 삭제하기!https://firebase.google.com/docs/storage/ios/delete-files?hl=ko Apple 플랫폼에서 Cloud Storage로 파일 삭제  |  Cloud Storage for Firebase4월 9~11일, Cloud Next에서 Firebase가 돌아옵니다. 지금 등록하기 의견 보내기 Apple 플explorer89.tistory.com 🔍 Firebase Storage listAll(completion:) 설명🔹 기능listAll(completion:)은 Firebase Storage에서 특정 경로 아래의 모든 파일(items)..
🔥 Firebase의 Storage 내에 저장된 여러 이미지 삭제하기! https://firebase.google.com/docs/storage/ios/delete-files?hl=ko Apple 플랫폼에서 Cloud Storage로 파일 삭제  |  Cloud Storage for Firebase4월 9~11일, Cloud Next에서 Firebase가 돌아옵니다. 지금 등록하기 의견 보내기 Apple 플랫폼에서 Cloud Storage로 파일 삭제 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하firebase.google.comhttps://firebase.google.com/docs/storage/ios/list-files?hl=ko Apple 플랫폼에서 Cloud Storage로 파일 나열  |  Cloud Storage for Firebas..
🔥 Firebase Storage에 이미지 업로드, 이미지 주소 URL 가져오기 func uploadAvatar() { let userID = Auth.auth().currentUser?.uid ?? "" // ✅ 유저 ID 가져오기 guard let imageData = imageData?.jpegData(compressionQuality: 0.5) else { return } // ✅ 이미지 데이터 변환 let metaData = StorageMetadata() // Firebase Storage 메타데이터 생성 metaData.contentType = "image/jpeg" // ✅ 파일 타입 설정 StorageManager.shared.uploadProfilePhoto(with: userID, image: imageData, metaData: met..
📍 Firebase 의 Storage 에 사진 업로드하는 방법 ✅ Firebase 의 Storage 에 저장하는 메서드images/{userID}/profileImage/profileImage_{userID}.jpg 경로를 사용해서 사용자별로 폴더를 구분나중에 리뷰 이미지 등 다른 카테고리를 추가할 확장성도 고려이 메서드는 Firebase Storage에 사용자의 프로필 이미지를 업로드하는 기능을 수행import Foundationimport FirebaseAuthimport FirebaseStorageimport FirebaseStorageCombineSwiftimport Combinefinal class StorageManager { // MARK: - Variable static let shared = StorageManager() ..
❓ FireStore 내에 회원정보를 불러오는 데 왜 tryMap? 🔥 tryMap { try $0.data(as: MovieClipUser.self) }의 역할 func collectionUsers(retrieve id: String) -> AnyPublisher { db.collection(userPath) .document(id) .getDocument() .tryMap { try $0.data(as: MovieClipUser.self) } // 🔥 여기가 핵심 .eraseToAnyPublisher()}🔹 각 단계별 동작1️⃣ db.collection(userPath).document(id).getDocument()Firestore에서 특정 문서(Document)를 가져오는 비동기 작업반환 타입: AnyP..
❓ Firebase 로그인 메서드 내 map의 역할 ✅ map(\.user)의 역할func loginUser(with email: String, password: String) -> AnyPublisher { return Auth.auth().signIn(withEmail: email, password: password) .map(\.user) // ✅ 여기서 map이 동작 .eraseToAnyPublisher()} 🔹 Firebase의 signIn(withEmail:password:)가 반환하는 타입➡️ signIn은 AnyPublisher를 반환해.➡️ 즉, AuthDataResult라는 객체가 반환되는데, 우리는 여기서 User 객체만 필요해.func signIn(withEmail email: String, ..
🚀 Future를 사용한 방식 vs map(\.user)을 사용한 방식의 차이점 (Future 는 필수인가?) 두 방식 모두 Firebase의 createUser(withEmail:password:)를 Combine을 활용하여 AnyPublisher 형태로 변환하지만, 비동기 처리 방식이 조금 다릅니다.   ✅ 1. Future를 사용한 방식func registerUser(with email: String, password: String) -> AnyPublisher { return Future { promise in Auth.auth().createUser(withEmail: email, password: password) { authResult, error in if let error = error { promise(.failure(error))..
🔥 MVVM + Combine을 활용한 소셜 로그인 & 이메일 회원가입 https://explorer89.tistory.com/360 AnyPublisher { return Future { promise in Auth.auth().signIn(with: credential) { authResult, error in if let error = error { promise(.failure(error)) // " data-og-host="explorer89.tistory.com" data-og-source-url="https://explorer89.tistory.com/360" data-og-url="https://explorer89.tistory.com/360" data-og-image="https://scrap.kakaocdn.net/dn/bR0F7D/hyYjtptys4/JH..