Skip to content

Commit d42ca5e

Browse files
committed
Update FirebaseUI with FirebaseAuth 4.2.0 changes
1 parent 10b596a commit d42ca5e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

FirebasePhoneAuthUI/FUIPhoneEntryViewController.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
#import "FUIPhoneEntryViewController.h"
1818

19-
#import <FirebaseAuth/FIRPhoneAuthProvider.h>
2019
#import <FirebaseAuth/FirebaseAuth.h>
20+
#import <FirebaseAuth/FIRAuthUIDelegate.h>
21+
#import <FirebaseAuth/FIRPhoneAuthProvider.h>
2122
#import "FUIAuthTableViewCell.h"
2223
#import "FUIAuthUtils.h"
2324
#import "FUIAuth_Internal.h"
@@ -50,8 +51,11 @@
5051
*/
5152
static NSString *const kNextButtonAccessibilityID = @"NextButtonAccessibilityID";
5253

53-
@interface FUIPhoneEntryViewController ()
54-
<UITextFieldDelegate, UITabBarDelegate, UITableViewDataSource, FUICountryTableViewDelegate>
54+
@interface FUIPhoneEntryViewController () <UITextFieldDelegate,
55+
UITabBarDelegate,
56+
UITableViewDataSource,
57+
FUICountryTableViewDelegate,
58+
FIRAuthUIDelegate>
5559
@end
5660

5761
@implementation FUIPhoneEntryViewController {
@@ -162,6 +166,7 @@ - (void)onNext:(NSString *)phoneNumber {
162166
NSString *phoneNumberWithCountryCode =
163167
[NSString stringWithFormat:@"+%@%@", _selectedCountryCode.dialCode, phoneNumber];
164168
[provider verifyPhoneNumber:phoneNumberWithCountryCode
169+
UIDelegate:self
165170
completion:^(NSString *_Nullable verificationID, NSError *_Nullable error) {
166171

167172
[self decrementActivity];

FirebasePhoneAuthUI/FUIPhoneVerificationViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#import "FUIPhoneVerificationViewController.h"
1818

19+
#import <FirebaseAuth/FIRAuthUIDelegate.h>
1920
#import <FirebaseAuth/FIRPhoneAuthProvider.h>
2021
#import "FirebaseAuth/FIRPhoneAuthCredential.h"
2122
#import "FUIAuth_Internal.h"
@@ -35,7 +36,7 @@
3536
/** Regex pattern that matches for a TOS style link. For example: [Terms]. */
3637
static NSString *const kLinkPlaceholderPattern = @"\\[([^\\]]+)\\]";
3738

38-
@interface FUIPhoneVerificationViewController () <FUICodeFieldDelegate>
39+
@interface FUIPhoneVerificationViewController () <FUICodeFieldDelegate, FIRAuthUIDelegate>
3940
@end
4041

4142
@implementation FUIPhoneVerificationViewController {
@@ -135,6 +136,7 @@ - (IBAction)onResendCode:(id)sender {
135136
[_codeField resignFirstResponder];
136137
FIRPhoneAuthProvider *provider = [FIRPhoneAuthProvider providerWithAuth:self.auth];
137138
[provider verifyPhoneNumber:_phoneNumber
139+
UIDelegate:self
138140
completion:^(NSString *_Nullable verificationID, NSError *_Nullable error) {
139141

140142
[self decrementActivity];

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUIAuthViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class FUIAuthViewController: UITableViewController {
143143
(self.authUI?.isSignInWithEmailHidden)!;
144144
if (shouldSkipPhoneAuthPicker) {
145145
let provider = self.authUI?.providers.first as! FUIPhoneAuth;
146-
provider.signIn(withPresenting: self);
146+
provider.signIn(withPresenting: self, phoneNumber: nil);
147147
} else {
148148
let controller = self.authUI!.authViewController()
149149
controller.navigationBar.isHidden = self.customAuthorizationSwitch.isOn

0 commit comments

Comments
 (0)