Skip to content

Commit 1262e17

Browse files
authored
More Firebase 11 updates (#1193)
1 parent d599b6c commit 1262e17

File tree

47 files changed

+915
-540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+915
-540
lines changed

FirebaseAnonymousAuthUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseAnonymousAuthUI'
3-
s.version = '14.1.0'
3+
s.version = '14.2.0'
44
s.summary = 'Provides anonymous auth support for FirebaseAuthUI.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
66
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }

FirebaseAnonymousAuthUI/FirebaseAnonymousAuthUITests/FirebaseAnonymousAuthUITests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#import <OCMock/OCMock.h>
1818
#import <XCTest/XCTest.h>
1919

20-
#import <FirebaseAuth/FirebaseAuth.h>
20+
@import FirebaseAuth;
2121
#import <FirebaseAuthUI/FirebaseAuthUI.h>
2222

2323
#import "FUIAnonymousAuth.h"

FirebaseAnonymousAuthUI/Sources/FUIAnonymousAuth.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// limitations under the License.
1515
//
1616

17+
@import FirebaseAuth;
18+
1719
#import <FirebaseAuthUI/FirebaseAuthUI.h>
1820

1921
#import "FirebaseAnonymousAuthUI/Sources/Public/FirebaseAnonymousAuthUI/FUIAnonymousAuth.h"

FirebaseAuthUI.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseAuthUI'
3-
s.version = '14.1.0'
3+
s.version = '14.2.0'
44
s.summary = 'A prebuilt authentication UI flow for Firebase Auth.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
66
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }

FirebaseAuthUI/Sources/FUIAccountSettingsOperation.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ - (void)showVerifyDialogWithMessage:(NSString *)message
230230
alertMessage:message
231231
alertCloseButton:FUILocalizedString(kStr_Cancel)
232232
providerHandler:^(id<FIRUserInfo> provider) {
233-
if (![provider.providerID isEqualToString:FIREmailAuthProviderID]) {
233+
if (![provider.providerID isEqualToString:@"email"]) {
234234
[self reauthenticateWithProvider:provider.providerID actionHandler:handler];
235235
} else {
236236
[self showVerifyPasswordViewWithMessage:message providerHandler:handler];

FirebaseAuthUI/Sources/FUIAccountSettingsOperationDeleteAccount.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ - (void)showDeleteAccountDialog {
4343
alertMessage:FUILocalizedString(kStr_DeleteAccountBody)
4444
alertCloseButton:FUILocalizedString(kStr_Cancel)
4545
providerHandler:^(id<FIRUserInfo> provider) {
46-
if (![provider.providerID isEqualToString:FIREmailAuthProviderID]) {
46+
// TODO: Use public API after Firebase 11 minimum.
47+
if (![provider.providerID isEqualToString:@"email"]) {
4748
[self reauthenticateWithProvider:provider.providerID actionHandler:^{
4849
[self showDeleteAccountView];
4950
}];

FirebaseAuthUI/Sources/FUIAccountSettingsViewController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ - (FUIASAccountState)accountState {
7979

8080
for (id<FIRUserInfo> userInfo in providers) {
8181
if (userInfo.email.length > 0 &&
82-
![userInfo.providerID isEqualToString:FIREmailAuthProviderID]) {
82+
![userInfo.providerID isEqualToString:@"email"]) {
8383
hasEmailInLinkedProvider = YES;
8484
}
8585

86-
if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) {
86+
if ([userInfo.providerID isEqualToString:@"email"]) {
8787
hasPasswordProvider = YES;
8888
}
8989
}
@@ -225,7 +225,7 @@ - (void)updateTableStateLinkedAccountWithoutEmail {
225225
NSMutableArray *linkedAccounts =
226226
[[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count];
227227
for (id<FIRUserInfo> userInfo in self.auth.currentUser.providerData) {
228-
if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) {
228+
if ([userInfo.providerID isEqualToString:@"email"]) {
229229
continue;
230230
}
231231
FUIStaticContentTableViewCell *cell =
@@ -262,7 +262,7 @@ - (void)updateTableStateLinkedAccountWithEmail {
262262
NSMutableArray *linkedAccounts =
263263
[[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count];
264264
for (id<FIRUserInfo> userInfo in self.auth.currentUser.providerData) {
265-
if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) {
265+
if ([userInfo.providerID isEqualToString:@"email"]) {
266266
continue;
267267
}
268268
FUIStaticContentTableViewCell *cell =
@@ -309,7 +309,7 @@ - (void)updateTableStateLinkedAccountWithEmailPassword {
309309
NSMutableArray *linkedAccounts =
310310
[[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count];
311311
for (id<FIRUserInfo> userInfo in self.auth.currentUser.providerData) {
312-
if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) {
312+
if ([userInfo.providerID isEqualToString:@"email"]) {
313313
continue;
314314
}
315315
FUIStaticContentTableViewCell *cell =

FirebaseAuthUI/Sources/FUIAuth.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
238238
if (error) {
239239
// Check for "credential in use" conflict error and handle appropriately.
240240
if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) {
241-
FIRAuthCredential *newCredential = error.userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey];
241+
// TODO: When Firebase 11 is minimum update string to
242+
// FIRAuthErrors.userInfoUpdatedCredentialKey
243+
FIRAuthCredential *newCredential =
244+
error.userInfo[@"FIRAuthErrorUserInfoUpdatedCredentialKey"];
242245
NSDictionary *userInfo = @{ };
243246
if (newCredential) {
244247
userInfo = @{ FUIAuthCredentialKey : newCredential };

FirebaseAuthUI/Sources/FUIAuthBaseViewController.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h"
1818

19-
#import <FirebaseAuth/FirebaseAuth.h>
19+
@import FirebaseAuth;
2020
#import <objc/runtime.h>
2121

2222
#import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthErrorUtils.h"
@@ -430,13 +430,13 @@ - (void)cancelAuthorization {
430430
}
431431

432432
+ (NSString *)providerLocalizedName:(NSString *)providerId {
433-
if ([providerId isEqualToString:FIREmailAuthProviderID]) {
433+
if ([providerId isEqualToString:@"email"]) {
434434
return FUILocalizedString(kStr_ProviderTitlePassword);
435-
} else if ([providerId isEqualToString:FIRGoogleAuthProviderID]) {
435+
} else if ([providerId isEqualToString:@"google.com"]) {
436436
return FUILocalizedString(kStr_ProviderTitleGoogle);
437-
} else if ([providerId isEqualToString:FIRFacebookAuthProviderID]) {
437+
} else if ([providerId isEqualToString:@"facebook.com"]) {
438438
return FUILocalizedString(kStr_ProviderTitleFacebook);
439-
} else if ([providerId isEqualToString:FIRTwitterAuthProviderID]) {
439+
} else if ([providerId isEqualToString:@"twitter.com"]) {
440440
return FUILocalizedString(kStr_ProviderTitleTwitter);
441441
}
442442
return @"";

FirebaseAuthUI/Sources/FUIAuthPickerViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthPickerViewController.h"
1818

1919
#import <AuthenticationServices/AuthenticationServices.h>
20-
#import <FirebaseAuth/FirebaseAuth.h>
20+
@import FirebaseAuth;
2121

2222
#import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h"
2323
#import "FirebaseAuthUI/Sources/FUIAuthSignInButton.h"

0 commit comments

Comments
 (0)