Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Tuist
- HIG
- Xcode
- alamofire
- Swift
- content-type
- Tuist-Action
- UITest
- rc
- retain cycle
- Automatic Reference Count
- FlexLayout
- AppStore
- garbage collection
- layoutSubviews
- App Connect
- pagination
- human interface guidelines
- Firebase
- HealthKit
- fetchSignInMethods
- playground
- SPM
- YGEnums.h
- arc
- ios
- Github-Action
- authentication
- 회고
- Nan
Archives
- Today
- Total
멋있게걷는방법
[Swift] firebase - 이메일 중복 검사 본문
firebase에서 이메일 중복을 검사하는 메서는 따로 없는 것 같더라고요..
그래서,
이렇게 해봤습니다.
먼저 FirebaseAuth를 import 해야겠죠?
그다음 아래와 같은 코드를 작성합니다.
forEmail에 검사하고 싶은 email(String type)을 넣습니다.
Auth.auth().fetchSignInMethods(forEmail: "test_email") { arg, error in
if let arg = arg {
print("등록됨")
} else {
print("등록 안 됨")
}
}
Authentication에 등록된 이메일이라면 if, 등록되지 않았다면 (사용가능) else가 실행됩니다.
arg를 출력해 보면
- 등록된 이메일이 아니다? = nil
- 등록된 이메일이다? = Optional(["password"])
가 출력됩니다.
'iOS' 카테고리의 다른 글
App Store 배포 회고(with. 개발 & 책임) (0) | 2023.06.25 |
---|---|
[Swift] 지금 바로 Pagination 을 적용해야 하는 이유 (0) | 2023.06.08 |
[UITest] password textFiled 에 tap 이 안 될 때? (0) | 2023.04.04 |
[Swift] Alamofire 를 쓴다면 꼭 알아야 하는 내용 (0) | 2023.03.23 |
[Swift] HealthKit 설정과 데이터 요청 (distanceWalkingRunning, activeEnergyBurned, appleExerciseTime) (0) | 2023.03.07 |