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);

FirebasePhoneAuthUI/FUIPhoneEntryViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ - (void)onNext:(NSString *)phoneNumber {
181181
self.navigationItem.rightBarButtonItem.enabled = YES;
182182

183183
if (error) {
184-
[_phoneNumberField becomeFirstResponder];
184+
[self->_phoneNumberField becomeFirstResponder];
185185

186186
UIAlertController *alertController = [FUIPhoneAuth alertControllerForError:error
187187
actionHandler:nil];

FirebasePhoneAuthUI/FUIPhoneVerificationViewController.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,22 @@ - (IBAction)onResendCode:(id)sender {
134134
// TODO: Remove temporary workaround when the issue is fixed in FirebaseAuth.
135135
dispatch_block_t completionBlock = ^() {
136136
[self decrementActivity];
137-
_verificationID = verificationID;
138-
[_codeField becomeFirstResponder];
137+
self->_verificationID = verificationID;
138+
[self->_codeField becomeFirstResponder];
139139

140140
if (error) {
141141
UIAlertController *alertController = [FUIPhoneAuth alertControllerForError:error
142142
actionHandler:^{
143-
[_codeField clearCodeInput];
144-
[_codeField becomeFirstResponder];
143+
[self->_codeField clearCodeInput];
144+
[self->_codeField becomeFirstResponder];
145145
}];
146146
[self presentViewController:alertController animated:YES completion:nil];
147147
return;
148148
}
149149

150150
NSString *resultMessage =
151151
[NSString stringWithFormat:FUIPhoneAuthLocalizedString(kPAStr_ResendCodeResult),
152-
_phoneNumber];
152+
self->_phoneNumber];
153153
[self showAlertWithMessage:resultMessage];
154154
};
155155
if ([NSThread isMainThread]) {
@@ -192,8 +192,8 @@ - (void)onNext:(NSString *)verificationCode {
192192
} else {
193193
UIAlertController *alertController = [FUIPhoneAuth alertControllerForError:error
194194
actionHandler:^{
195-
[_codeField clearCodeInput];
196-
[_codeField becomeFirstResponder];
195+
[self->_codeField clearCodeInput];
196+
[self->_codeField becomeFirstResponder];
197197
}];
198198
[self presentViewController:alertController animated:YES completion:nil];
199199
}
@@ -268,7 +268,7 @@ - (void)resendConfirmationCodeTimerFinished {
268268
- (void)updateResendLabel {
269269
NSInteger minutes = (NSInteger)_resendConfirmationCodeSeconds / 60; // Integer type for truncation
270270
NSInteger seconds = (NSInteger)round(_resendConfirmationCodeSeconds) % 60;
271-
NSString *formattedTime = [NSString stringWithFormat:@"%ld:%02ld", minutes, seconds];
271+
NSString *formattedTime = [NSString stringWithFormat:@"%ld:%02ld", (long)minutes, (long)seconds];
272272

273273
_resendConfirmationCodeTimerLabel.text =
274274
[NSString stringWithFormat:FUIPhoneAuthLocalizedString(kPAStr_ResendCodeTimer),

FirebaseTwitterAuthUI/FUITwitterAuth.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,16 @@ - (UIColor *)buttonTextColor {
8585
return [UIColor whiteColor];
8686
}
8787

88+
#pragma clang diagnostic push
89+
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
8890
- (void)signInWithEmail:(nullable NSString *)email
8991
presentingViewController:(nullable UIViewController *)presentingViewController
9092
completion:(nullable FIRAuthProviderSignInCompletionBlock)completion {
9193
[self signInWithDefaultValue:email
9294
presentingViewController:presentingViewController
9395
completion:completion];
9496
}
97+
#pragma clang diagnostic pop
9598

9699
- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
97100
presentingViewController:(nullable UIViewController *)presentingViewController

FirebaseUI.podspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseUI'
3-
s.version = '4.5.1'
3+
s.version = '5.0.0'
44
s.summary = 'UI binding libraries for Firebase.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
66
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
7-
s.source = { :git => 'https://github.com/firebase/FirebaseUI-iOS.git', :tag => 'v4.5.1' }
7+
# s.source = { :git => 'https://github.com/firebase/FirebaseUI-iOS.git', :tag => 'v5.0.0' }
8+
s.source = { :git => 'sso://devrel/firebaseui-ios', :branch => 'firebase-5' }
89
s.author = 'Firebase'
910
s.platform = :ios
1011
s.ios.deployment_target = '9.0'
@@ -13,7 +14,7 @@ Pod::Spec.new do |s|
1314
s.requires_arc = true
1415
s.public_header_files = 'FirebaseUI/FirebaseUI.h'
1516
s.source_files = 'FirebaseUI/FirebaseUI.h'
16-
s.cocoapods_version = '>= 1.4.0.beta.2'
17+
s.cocoapods_version = '>= 1.5.0'
1718

1819
s.subspec 'Database' do |database|
1920
database.platform = :ios, '8.0'

0 commit comments

Comments
 (0)