Skip to content

Commit a58289c

Browse files
committed
update FirebaseUI to Firebase 5.0.0
Change-Id: Ib60213bd542300a71e852b8bfe7c2dc43c47f6a8
1 parent 74cfe87 commit a58289c

25 files changed

+1551
-98
lines changed

FirebaseAuthUI/AccountManagement/FUIAccountSettingsOperation.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,13 @@ - (void)reauthenticateWithPassword:(NSString *)password
205205

206206
[self.delegate incrementActivity];
207207

208+
if (self.delegate.auth.currentUser.email == nil) {
209+
NSLog(@"FirebaseUI: Expected nonnull email during email/password reauthentication");
210+
return;
211+
}
208212
[self.delegate.auth signInWithEmail:self.delegate.auth.currentUser.email
209213
password:password
210-
completion:^(FIRUser *_Nullable user, NSError *_Nullable error) {
214+
completion:^(FIRAuthDataResult *authResult, NSError *error) {
211215
[self.delegate decrementActivity];
212216

213217
[self finishOperationWithError:error];

FirebaseAuthUI/FUIAuth.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ - (void)handleAccountLinkingForEmail:(NSString *)email
304304
return;
305305
}
306306

307-
[self.auth signInWithCredential:credential completion:^(FIRUser *_Nullable user,
308-
NSError *_Nullable error) {
307+
[self.auth signInAndRetrieveDataWithCredential:credential
308+
completion:^(FIRAuthDataResult*_Nullable authResult,
309+
NSError *_Nullable error) {
309310
if (error) {
310311
[self invokeResultCallbackWithAuthDataResult:nil error:error];
311312
if (result) {
@@ -314,6 +315,7 @@ - (void)handleAccountLinkingForEmail:(NSString *)email
314315
return;
315316
}
316317

318+
FIRUser *user = authResult.user;
317319
[user linkAndRetrieveDataWithCredential:newCredential
318320
completion:^(FIRAuthDataResult *_Nullable authResult,
319321
NSError *_Nullable error) {
@@ -339,12 +341,15 @@ - (void)handleAccountLinkingForEmail:(NSString *)email
339341
- (void)invokeResultCallbackWithAuthDataResult:(nullable FIRAuthDataResult *)authDataResult
340342
error:(nullable NSError *)error {
341343
dispatch_async(dispatch_get_main_queue(), ^{
344+
#pragma clang diagnostic push
345+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
342346
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWithAuthDataResult:error:)]) {
343347
[self.delegate authUI:self didSignInWithAuthDataResult:authDataResult error:error];
344348
}
345349
if ([self.delegate respondsToSelector:@selector(authUI:didSignInWithUser:error:)]) {
346350
[self.delegate authUI:self didSignInWithUser:authDataResult.user error:error];
347351
}
352+
#pragma clang diagnostic pop
348353
});
349354
}
350355

FirebaseAuthUI/FUIAuthBaseViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ - (void)incrementActivity {
313313
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
314314
(int64_t)(kActivityIndiactorAnimationDelay * NSEC_PER_SEC)),
315315
dispatch_get_main_queue(), ^{
316-
[_activityIndicator.superview bringSubviewToFront:_activityIndicator];
317-
if (_activityCount > 0) {
318-
[_activityIndicator startAnimating];
316+
[self->_activityIndicator.superview bringSubviewToFront:_activityIndicator];
317+
if (self->_activityCount > 0) {
318+
[self->_activityIndicator startAnimating];
319319
}
320320
});
321321
}

FirebaseAuthUI/FUIAuthProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//
1616

1717
#import <UIKit/UIKit.h>
18-
#import <FirebaseAuth/FIRAuth.h>
18+
#import <FirebaseAuth/FirebaseAuth.h>
1919

2020
@class FIRAuth;
2121
@class FIRAuthCredential;

FirebaseAuthUI/FUIPasswordVerificationViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ - (void)verifyPassword:(NSString *)password {
152152
return;
153153
}
154154

155-
[authResult.user linkAndRetrieveDataWithCredential:_newCredential
155+
[authResult.user linkAndRetrieveDataWithCredential:self->_newCredential
156156
completion:^(FIRAuthDataResult *_Nullable authResult,
157157
NSError *_Nullable error) {
158158
[self decrementActivity];

FirebaseAuthUI/FirebaseAuthUI.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ FOUNDATION_EXPORT const unsigned char FirebaseAuthUIVersionString[];
2727
#import "FUIAccountSettingsOperationType.h"
2828
#import "FUIAccountSettingsViewController.h"
2929
*/
30-
#import "FUIAuth.h"
31-
#import "FUIAuthBaseViewController.h"
32-
#import "FUIAuthErrorUtils.h"
33-
#import "FUIAuthPickerViewController.h"
34-
#import "FUIAuthProvider.h"
35-
#import "FUIEmailEntryViewController.h"
36-
#import "FUIPasswordRecoveryViewController.h"
37-
#import "FUIPasswordSignInViewController.h"
38-
#import "FUIPasswordSignUpViewController.h"
39-
#import "FUIPasswordVerificationViewController.h"
30+
#import <FirebaseAuthUI/FUIAuth.h>
31+
#import <FirebaseAuthUI/FUIAuthBaseViewController.h>
32+
#import <FirebaseAuthUI/FUIAuthErrorUtils.h>
33+
#import <FirebaseAuthUI/FUIAuthPickerViewController.h>
34+
#import <FirebaseAuthUI/FUIAuthProvider.h>
35+
#import <FirebaseAuthUI/FUIEmailEntryViewController.h>
36+
#import <FirebaseAuthUI/FUIPasswordRecoveryViewController.h>
37+
#import <FirebaseAuthUI/FUIPasswordSignInViewController.h>
38+
#import <FirebaseAuthUI/FUIPasswordSignUpViewController.h>
39+
#import <FirebaseAuthUI/FUIPasswordVerificationViewController.h>

FirebaseFacebookAuthUI/FUIFacebookAuth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// limitations under the License.
1515
//
1616

17-
#import "FUIAuth.h"
17+
#import <FirebaseAuthUI/FirebaseAuthUI.h>
1818

1919
@class FBSDKLoginManager;
2020
NS_ASSUME_NONNULL_BEGIN

FirebaseFacebookAuthUI/FUIFacebookAuth.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,16 @@ - (UIColor *)buttonTextColor {
114114
return [UIColor whiteColor];
115115
}
116116

117+
#pragma clang diagnostic push
118+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
117119
- (void)signInWithEmail:(nullable NSString *)email
118120
presentingViewController:(nullable UIViewController *)presentingViewController
119121
completion:(nullable FIRAuthProviderSignInCompletionBlock)completion {
120122
[self signInWithDefaultValue:email
121123
presentingViewController:presentingViewController
122124
completion:completion];
123125
}
126+
#pragma clang diagnostic pop
124127

125128
- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
126129
presentingViewController:(nullable UIViewController *)presentingViewController

FirebaseGoogleAuthUI/FUIGoogleAuth.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,16 @@ - (UIColor *)buttonTextColor {
103103
return [UIColor colorWithWhite:0 alpha:0.54f];
104104
}
105105

106+
#pragma clang diagnostic push
107+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
106108
- (void)signInWithEmail:(nullable NSString *)email
107109
presentingViewController:(nullable UIViewController *)presentingViewController
108110
completion:(nullable FIRAuthProviderSignInCompletionBlock)completion {
109111
[self signInWithDefaultValue:email
110112
presentingViewController:presentingViewController
111113
completion:completion];
112114
}
115+
#pragma clang diagnostic pop
113116

114117
- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
115118
presentingViewController:(nullable UIViewController *)presentingViewController

FirebasePhoneAuthUI/FUIPhoneAuth.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ - (void)signInWithPresentingViewController:(UIViewController *)presentingViewCon
9191
defaultValue:phoneNumber];
9292
}
9393

94+
#pragma clang diagnostic push
95+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
9496
- (void)signInWithEmail:(nullable NSString *)email
9597
presentingViewController:(nullable UIViewController *)presentingViewController
9698
completion:(nullable FIRAuthProviderSignInCompletionBlock)completion {
9799
[self signInWithDefaultValue:email
98100
presentingViewController:presentingViewController
99101
completion:completion];
100102
}
103+
#pragma clang diagnostic pop
101104

102105
- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
103106
presentingViewController:(nullable UIViewController *)presentingViewController
@@ -141,7 +144,7 @@ - (void)callbackWithCredential:(nullable FIRAuthCredential *)credential
141144

142145
FIRAuthResultCallback resultAuthCallback = ^(FIRUser *_Nullable user, NSError *_Nullable error) {
143146
if (!error) {
144-
_pendingSignInCallback = nil;
147+
self->_pendingSignInCallback = nil;
145148
}
146149
if (result) {
147150
result(user, error);

0 commit comments

Comments
 (0)