From 54a26afef57f8b9d7e42ecf848c78f5c7f236296 Mon Sep 17 00:00:00 2001 From: Junio Branco Date: Mon, 6 Mar 2017 22:53:39 +0800 Subject: [PATCH 1/3] Fix blank error code --- ios/Firestack/FirestackAuth.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Firestack/FirestackAuth.m b/ios/Firestack/FirestackAuth.m index 55d3dd0..404080f 100644 --- a/ios/Firestack/FirestackAuth.m +++ b/ios/Firestack/FirestackAuth.m @@ -196,11 +196,11 @@ @implementation FirestackAuth if (user != nil) { [self userCallback:callback user:user]; } else { - NSDictionary *err = @{ - @"error": @"createUserWithEmailError", - @"name": @([error code]), - @"description": [error localizedDescription] - }; + NSDictionary *err =@{ + @"error": @"createUserWithEmailError", + @"code": [NSString stringWithFormat:@"%d", @([error code])], + @"message": [error localizedDescription] + }; callback(@[err]); } }]; From 3e7490883c8d9b4f0443a8f58f58a91dd097012e Mon Sep 17 00:00:00 2001 From: Junio Branco Date: Wed, 8 Mar 2017 03:36:57 +0800 Subject: [PATCH 2/3] Refactor casting --- ios/Firestack/FirestackAuth.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Firestack/FirestackAuth.m b/ios/Firestack/FirestackAuth.m index 404080f..ced2884 100644 --- a/ios/Firestack/FirestackAuth.m +++ b/ios/Firestack/FirestackAuth.m @@ -196,11 +196,11 @@ @implementation FirestackAuth if (user != nil) { [self userCallback:callback user:user]; } else { - NSDictionary *err =@{ - @"error": @"createUserWithEmailError", - @"code": [NSString stringWithFormat:@"%d", @([error code])], - @"message": [error localizedDescription] - }; + NSDictionary *err = @{ + @"error": @"createUserWithEmailError", + @"code": [NSString stringWithFormat:@"%d", [error code]], + @"message": [error localizedDescription] + }; callback(@[err]); } }]; From 948b882231c1d30cd8b502e2f3ba08b8602aff55 Mon Sep 17 00:00:00 2001 From: Junio Branco Date: Thu, 9 Mar 2017 00:49:55 +0800 Subject: [PATCH 3/3] Fix for signInWithEmailPassword which was throwing the following error : 'code.toLowerCase not a function' --- ios/Firestack/FirestackErrors.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Firestack/FirestackErrors.m b/ios/Firestack/FirestackErrors.m index 7e87103..b19ab4e 100644 --- a/ios/Firestack/FirestackErrors.m +++ b/ios/Firestack/FirestackErrors.m @@ -31,8 +31,8 @@ + (NSDictionary *) handleFirebaseError:(NSString *) name { NSMutableDictionary *err = [NSMutableDictionary dictionaryWithObjectsAndKeys: name, @"name", - @([error code]), @"code", - [error localizedDescription], @"rawDescription", + [NSString stringWithFormat:@"%d", [error code]], @"code", + [error localizedDescription], @"message", [[error userInfo] description], @"userInfo", nil];