我需要的是所有不同的登录错误的FirebaseAuthentication代码的完整列表,也是所有这些错误的列表。到目前为止,我已经通过反复试验找到了一些,但我不能冒险错过了一些。
我正在使用Firebase简单登录,使用电子邮件/密码,facebook,twitter和匿名登录。显然,有这么多的登录方法,用户可能会有很多方法无法正确登录(不正确的电子邮件格式,没有输入密码等)。目前,我正在使用以下代码:
... authenticateWithDictionary method
completion:^(NSError * error, id<PUser> user) {
if (!error) {
[self loginButtonPressed:Nil];
}
else {
[UIView alertWithTitle:bErrorTitle withError:error];
}
这样做的唯一问题是,我得到的错误如下所示:
**(Error Code: EMAIL_TAKEN) The specified email address is already in use.**
这可以让我知道在测试中出了什么问题,但一旦应用程序上线,我将希望单独的消息a)看起来更整洁b)让用户知道他们为什么会有这个错误
到目前为止,通过试验和错误,我得出了以下结论:
错误码
-5 INVALID EMAIL - empty or incorrect format
-6 INVALID PASSWORD
-9 EMAIL TAKEN
一旦我有了一个完整的列表,我将使用switch语句来正确地处理它们
有没有人知道错误代码和错误的综合列表,以便我可以将它们全部考虑在内,而不必考虑所有选项,这可能意味着我会遗漏一个选项
发布于 2016-11-25 11:02:29
IOS身份验证错误包括:
名称:哈希;RawValue(代码):
- AccountExistsWithDifferentCredential: 10; 17012
- InvalidEmail: 6; 17008
- NetworkError: 15; 17020
- UserDisabled: 3; 17005
- UserMismatch: 18; 17024
- UserNotFound: 9; 17011
- WeakPassword: 20; 17026
- InternalError: 23; 17999
- InvalidAPIKey: 17; 17023
- KeychainError: 22; 17995
- WrongPassword: 7; 17009
- NoSuchProvider: 13; 17016
- TooManyRequests: 8; 17010
- AppNotAuthorized: 21; 17028
- InvalidUserToken: 14; 17017
- UserTokenExpired: 16; 17021
- EmailAlreadyInUse: 5; 17007
- InvalidCredential: 2; 17004
- InvalidCustomToken: 0; 17000
- CustomTokenMismatch: 1; 17002
- OperationNotAllowed: 4; 17006
- RequiresRecentLogin: 11; 17014
- ProviderAlreadyLinked: 12; 17015
- CredentialAlreadyInUse: 19; 17025
https://stackoverflow.com/questions/27420176
复制相似问题