diff --git a/FirebaseAnonymousAuthUI.podspec b/FirebaseAnonymousAuthUI.podspec index c806366c96b..40c693f3eb4 100644 --- a/FirebaseAnonymousAuthUI.podspec +++ b/FirebaseAnonymousAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseAnonymousAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'Provides anonymous auth support for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseAnonymousAuthUI/FirebaseAnonymousAuthUITests/FirebaseAnonymousAuthUITests.m b/FirebaseAnonymousAuthUI/FirebaseAnonymousAuthUITests/FirebaseAnonymousAuthUITests.m index 1f3f911ed2d..7be0133a705 100644 --- a/FirebaseAnonymousAuthUI/FirebaseAnonymousAuthUITests/FirebaseAnonymousAuthUITests.m +++ b/FirebaseAnonymousAuthUI/FirebaseAnonymousAuthUITests/FirebaseAnonymousAuthUITests.m @@ -17,7 +17,7 @@ #import #import -#import +@import FirebaseAuth; #import #import "FUIAnonymousAuth.h" diff --git a/FirebaseAnonymousAuthUI/Sources/FUIAnonymousAuth.m b/FirebaseAnonymousAuthUI/Sources/FUIAnonymousAuth.m index 20a0a5e045d..14ddf7a26e8 100644 --- a/FirebaseAnonymousAuthUI/Sources/FUIAnonymousAuth.m +++ b/FirebaseAnonymousAuthUI/Sources/FUIAnonymousAuth.m @@ -14,6 +14,8 @@ // limitations under the License. // +@import FirebaseAuth; + #import #import "FirebaseAnonymousAuthUI/Sources/Public/FirebaseAnonymousAuthUI/FUIAnonymousAuth.h" diff --git a/FirebaseAuthUI.podspec b/FirebaseAuthUI.podspec index a4b4b8c4b5f..a938a515833 100644 --- a/FirebaseAuthUI.podspec +++ b/FirebaseAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'A prebuilt authentication UI flow for Firebase Auth.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseAuthUI/Sources/FUIAccountSettingsOperation.m b/FirebaseAuthUI/Sources/FUIAccountSettingsOperation.m index 1469eed71e9..0b6fb75962f 100644 --- a/FirebaseAuthUI/Sources/FUIAccountSettingsOperation.m +++ b/FirebaseAuthUI/Sources/FUIAccountSettingsOperation.m @@ -230,7 +230,7 @@ - (void)showVerifyDialogWithMessage:(NSString *)message alertMessage:message alertCloseButton:FUILocalizedString(kStr_Cancel) providerHandler:^(id provider) { - if (![provider.providerID isEqualToString:FIREmailAuthProviderID]) { + if (![provider.providerID isEqualToString:@"email"]) { [self reauthenticateWithProvider:provider.providerID actionHandler:handler]; } else { [self showVerifyPasswordViewWithMessage:message providerHandler:handler]; diff --git a/FirebaseAuthUI/Sources/FUIAccountSettingsOperationDeleteAccount.m b/FirebaseAuthUI/Sources/FUIAccountSettingsOperationDeleteAccount.m index ab30c3fdf54..d2183696e2e 100644 --- a/FirebaseAuthUI/Sources/FUIAccountSettingsOperationDeleteAccount.m +++ b/FirebaseAuthUI/Sources/FUIAccountSettingsOperationDeleteAccount.m @@ -43,7 +43,8 @@ - (void)showDeleteAccountDialog { alertMessage:FUILocalizedString(kStr_DeleteAccountBody) alertCloseButton:FUILocalizedString(kStr_Cancel) providerHandler:^(id provider) { - if (![provider.providerID isEqualToString:FIREmailAuthProviderID]) { + // TODO: Use public API after Firebase 11 minimum. + if (![provider.providerID isEqualToString:@"email"]) { [self reauthenticateWithProvider:provider.providerID actionHandler:^{ [self showDeleteAccountView]; }]; diff --git a/FirebaseAuthUI/Sources/FUIAccountSettingsViewController.m b/FirebaseAuthUI/Sources/FUIAccountSettingsViewController.m index 069d13abc91..8700f592ad3 100644 --- a/FirebaseAuthUI/Sources/FUIAccountSettingsViewController.m +++ b/FirebaseAuthUI/Sources/FUIAccountSettingsViewController.m @@ -79,11 +79,11 @@ - (FUIASAccountState)accountState { for (id userInfo in providers) { if (userInfo.email.length > 0 && - ![userInfo.providerID isEqualToString:FIREmailAuthProviderID]) { + ![userInfo.providerID isEqualToString:@"email"]) { hasEmailInLinkedProvider = YES; } - if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) { + if ([userInfo.providerID isEqualToString:@"email"]) { hasPasswordProvider = YES; } } @@ -225,7 +225,7 @@ - (void)updateTableStateLinkedAccountWithoutEmail { NSMutableArray *linkedAccounts = [[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count]; for (id userInfo in self.auth.currentUser.providerData) { - if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) { + if ([userInfo.providerID isEqualToString:@"email"]) { continue; } FUIStaticContentTableViewCell *cell = @@ -262,7 +262,7 @@ - (void)updateTableStateLinkedAccountWithEmail { NSMutableArray *linkedAccounts = [[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count]; for (id userInfo in self.auth.currentUser.providerData) { - if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) { + if ([userInfo.providerID isEqualToString:@"email"]) { continue; } FUIStaticContentTableViewCell *cell = @@ -309,7 +309,7 @@ - (void)updateTableStateLinkedAccountWithEmailPassword { NSMutableArray *linkedAccounts = [[NSMutableArray alloc] initWithCapacity:self.auth.currentUser.providerData.count]; for (id userInfo in self.auth.currentUser.providerData) { - if ([userInfo.providerID isEqualToString:FIREmailAuthProviderID]) { + if ([userInfo.providerID isEqualToString:@"email"]) { continue; } FUIStaticContentTableViewCell *cell = diff --git a/FirebaseAuthUI/Sources/FUIAuth.m b/FirebaseAuthUI/Sources/FUIAuth.m index 8ef6c8f0d67..fe045fd96c7 100644 --- a/FirebaseAuthUI/Sources/FUIAuth.m +++ b/FirebaseAuthUI/Sources/FUIAuth.m @@ -238,7 +238,10 @@ - (void)autoUpgradeAccountWithProviderUI:(id)providerUI if (error) { // Check for "credential in use" conflict error and handle appropriately. if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) { - FIRAuthCredential *newCredential = error.userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey]; + // TODO: When Firebase 11 is minimum update string to + // FIRAuthErrors.userInfoUpdatedCredentialKey + FIRAuthCredential *newCredential = + error.userInfo[@"FIRAuthErrorUserInfoUpdatedCredentialKey"]; NSDictionary *userInfo = @{ }; if (newCredential) { userInfo = @{ FUIAuthCredentialKey : newCredential }; diff --git a/FirebaseAuthUI/Sources/FUIAuthBaseViewController.m b/FirebaseAuthUI/Sources/FUIAuthBaseViewController.m index e912dad2a63..38cf3a5a1b5 100644 --- a/FirebaseAuthUI/Sources/FUIAuthBaseViewController.m +++ b/FirebaseAuthUI/Sources/FUIAuthBaseViewController.m @@ -16,7 +16,7 @@ #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h" -#import +@import FirebaseAuth; #import #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthErrorUtils.h" @@ -430,13 +430,13 @@ - (void)cancelAuthorization { } + (NSString *)providerLocalizedName:(NSString *)providerId { - if ([providerId isEqualToString:FIREmailAuthProviderID]) { + if ([providerId isEqualToString:@"email"]) { return FUILocalizedString(kStr_ProviderTitlePassword); - } else if ([providerId isEqualToString:FIRGoogleAuthProviderID]) { + } else if ([providerId isEqualToString:@"google.com"]) { return FUILocalizedString(kStr_ProviderTitleGoogle); - } else if ([providerId isEqualToString:FIRFacebookAuthProviderID]) { + } else if ([providerId isEqualToString:@"facebook.com"]) { return FUILocalizedString(kStr_ProviderTitleFacebook); - } else if ([providerId isEqualToString:FIRTwitterAuthProviderID]) { + } else if ([providerId isEqualToString:@"twitter.com"]) { return FUILocalizedString(kStr_ProviderTitleTwitter); } return @""; diff --git a/FirebaseAuthUI/Sources/FUIAuthPickerViewController.m b/FirebaseAuthUI/Sources/FUIAuthPickerViewController.m index d302cddf0e8..2821b87391a 100644 --- a/FirebaseAuthUI/Sources/FUIAuthPickerViewController.m +++ b/FirebaseAuthUI/Sources/FUIAuthPickerViewController.m @@ -17,7 +17,7 @@ #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthPickerViewController.h" #import -#import +@import FirebaseAuth; #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h" #import "FirebaseAuthUI/Sources/FUIAuthSignInButton.h" diff --git a/FirebaseAuthUI/Sources/FUIPrivacyAndTermsOfServiceView.m b/FirebaseAuthUI/Sources/FUIPrivacyAndTermsOfServiceView.m index cc0288030c6..10a7efb5ce8 100644 --- a/FirebaseAuthUI/Sources/FUIPrivacyAndTermsOfServiceView.m +++ b/FirebaseAuthUI/Sources/FUIPrivacyAndTermsOfServiceView.m @@ -16,7 +16,7 @@ #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIPrivacyAndTermsOfServiceView.h" -#import +@import FirebaseAuth; #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuth.h" #import "FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthStrings.h" diff --git a/FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthProvider.h b/FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthProvider.h index dd2a7cafd62..16ea09b147c 100644 --- a/FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthProvider.h +++ b/FirebaseAuthUI/Sources/Public/FirebaseAuthUI/FUIAuthProvider.h @@ -15,12 +15,14 @@ // #import -#import +@import FirebaseAuth; @class FIRAuth; @class FIRAuthCredential; @class FIRUserInfo; +typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error); + NS_ASSUME_NONNULL_BEGIN /** @typedef FUIAuthProviderSignInCompletionBlock diff --git a/FirebaseDatabaseUI.podspec b/FirebaseDatabaseUI.podspec index 8647bf3471b..097e8f21f60 100644 --- a/FirebaseDatabaseUI.podspec +++ b/FirebaseDatabaseUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseDatabaseUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'Prebuilt data sources and UI bindings for Firebase Database.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseEmailAuthUI.podspec b/FirebaseEmailAuthUI.podspec index 5173b2506ec..2cc5d9399ca 100644 --- a/FirebaseEmailAuthUI.podspec +++ b/FirebaseEmailAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseEmailAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'An email authentication provider for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseEmailAuthUI/FirebaseEmailAuthUITests/FirebaseEmailAuthUITests.m b/FirebaseEmailAuthUI/FirebaseEmailAuthUITests/FirebaseEmailAuthUITests.m index 3cd1eb1ab9a..812a9a462c4 100644 --- a/FirebaseEmailAuthUI/FirebaseEmailAuthUITests/FirebaseEmailAuthUITests.m +++ b/FirebaseEmailAuthUI/FirebaseEmailAuthUITests/FirebaseEmailAuthUITests.m @@ -15,7 +15,7 @@ // #import "FUIEmailAuth.h" -#import +@import FirebaseAuth; #import #import "FUIAuthUtils.h" #import diff --git a/FirebaseEmailAuthUI/Sources/FUIConfirmEmailViewController.m b/FirebaseEmailAuthUI/Sources/FUIConfirmEmailViewController.m index b9a17c865f5..8543db62690 100755 --- a/FirebaseEmailAuthUI/Sources/FUIConfirmEmailViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIConfirmEmailViewController.m @@ -16,7 +16,7 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIConfirmEmailViewController.h" -#import +@import FirebaseAuth; #import @@ -137,7 +137,8 @@ - (void)next { } - (void)onNext:(NSString *)emailText { - FUIEmailAuth *emailAuth = [self.authUI providerWithID:FIREmailAuthProviderID]; + // TODO: After Firebase 11 minimum, change to EmailAuthProvider.id. + FUIEmailAuth *emailAuth = [self.authUI providerWithID:@"email"]; if (![[self class] isValidEmail:emailText]) { [self showAlertWithMessage:FUILocalizedString(kStr_InvalidEmailError)]; diff --git a/FirebaseEmailAuthUI/Sources/FUIEmailAuth.m b/FirebaseEmailAuthUI/Sources/FUIEmailAuth.m index 41fee6d8ac8..08efb77641f 100644 --- a/FirebaseEmailAuthUI/Sources/FUIEmailAuth.m +++ b/FirebaseEmailAuthUI/Sources/FUIEmailAuth.m @@ -16,9 +16,8 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailAuth.h" -#import -#import -#import +@import FirebaseCore; +@import FirebaseAuth; #import #import @@ -78,7 +77,7 @@ + (NSBundle *)bundle { - (instancetype)init { return [self initAuthAuthUI:[FUIAuth defaultAuthUI] - signInMethod:FIREmailPasswordAuthSignInMethod + signInMethod:@"email" forceSameDevice:NO allowNewEmailAccounts:YES requireDisplayName:YES @@ -122,7 +121,7 @@ - (instancetype)initAuthAuthUI:(FUIAuth *)authUI #pragma mark - FUIAuthProvider - (nullable NSString *)providerID { - return FIREmailAuthProviderID; + return @"email"; } /** @fn accessToken: @@ -294,7 +293,7 @@ - (BOOL)handleOpenURL:(NSURL *)URL sourceApplication:(nullable NSString *)source - (void)handleUnverifiedProviderLinking:(NSString *)providerID email:(NSString *)email error:(NSError **)error { - if ([providerID isEqualToString:FIRFacebookAuthProviderID]) { + if ([providerID isEqualToString:@"facebook.com"]) { NSData *unverifiedProviderCredentialData = [GULUserDefaults.standardUserDefaults objectForKey:kEmailLinkSignInLinkingCredentialKey]; FIRAuthCredential *unverifiedProviderCredential; @@ -533,12 +532,12 @@ - (void)signInWithEmailHint:(NSString *)emailHint NSString *existingFederatedProviderID = [self authProviderFromProviders:providers]; // Set of providers which can be auto-linked. NSSet *supportedProviders = - [NSSet setWithObjects:FIRGoogleAuthProviderID, - FIRFacebookAuthProviderID, - FIREmailAuthProviderID, + [NSSet setWithObjects:@"google.com", + @"facebook.com", + @"email", nil]; if ([supportedProviders containsObject:existingFederatedProviderID]) { - if ([existingFederatedProviderID isEqualToString:FIREmailAuthProviderID]) { + if ([existingFederatedProviderID isEqualToString:@"email"]) { [FUIAuthBaseViewController showSignInAlertWithEmail:emailHint providerShortName:@"Email/Password" @@ -670,7 +669,7 @@ - (void)handleAccountLinkingForEmail:(NSString *)email return; } NSString *bestProviderID = providers[0]; - if ([bestProviderID isEqual:FIREmailAuthProviderID]) { + if ([bestProviderID isEqual:@"email"]) { // Password verification. UIViewController *passwordController; if ([delegate respondsToSelector: @@ -693,13 +692,14 @@ - (void)handleAccountLinkingForEmail:(NSString *)email return; } - if ([bestProviderID isEqual:FIREmailLinkAuthSignInMethod]) { + if ([bestProviderID isEqual:@"emailLink"]) { NSString *providerName; - if ([newCredential.provider isEqualToString:FIRFacebookAuthProviderID]) { + if ([newCredential.provider isEqualToString:@"facebook.com"]) { providerName = @"Facebook"; - } else if ([newCredential.provider isEqualToString:FIRTwitterAuthProviderID]) { + } else if ([newCredential.provider isEqualToString:@"twitter.com"]) { providerName = @"Twitter"; - } else if ([newCredential.provider isEqualToString:FIRGitHubAuthProviderID]) { + } else if ([newCredential.provider isEqualToString:@"github.com" +@"twitter.com"]) { providerName = @"Github"; } NSString *message = [NSString stringWithFormat: @@ -854,9 +854,9 @@ - (void)generateURLParametersAndLocalCache:(NSString *)email linkingProvider:(NS - (nullable NSString *)authProviderFromProviders:(NSArray *) providers { NSSet *providerSet = - [NSSet setWithArray:@[ FIRFacebookAuthProviderID, - FIRGoogleAuthProviderID, - FIREmailAuthProviderID ]]; + [NSSet setWithArray:@[ @"facebook.com", + @"google.com", + @"email" ]]; for (NSString *provider in providers) { if ( [providerSet containsObject:provider]) { return provider; diff --git a/FirebaseEmailAuthUI/Sources/FUIEmailEntryViewController.m b/FirebaseEmailAuthUI/Sources/FUIEmailEntryViewController.m index 12e7d2ee38f..d64e4da5326 100755 --- a/FirebaseEmailAuthUI/Sources/FUIEmailEntryViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIEmailEntryViewController.m @@ -16,7 +16,7 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailEntryViewController.h" -#import +@import FirebaseAuth; #import @@ -138,7 +138,7 @@ - (void)next { } - (void)onNext:(NSString *)emailText { - FUIEmailAuth *emailAuth = [self.authUI providerWithID:FIREmailAuthProviderID]; + FUIEmailAuth *emailAuth = [self.authUI providerWithID:@"email"]; id delegate = self.authUI.delegate; if (![[self class] isValidEmail:emailText]) { @@ -165,7 +165,7 @@ - (void)onNext:(NSString *)emailText { } id provider = [self bestProviderFromProviderIDs:providers]; - if (provider && ![provider.providerID isEqualToString:FIREmailAuthProviderID]) { + if (provider && ![provider.providerID isEqualToString:@"email"]) { NSString *email = emailText; [[self class] showSignInAlertWithEmail:email provider:provider @@ -176,7 +176,7 @@ - (void)onNext:(NSString *)emailText { cancelHandler:^{ [self.authUI signOutWithError:nil]; }]; - } else if ([providers containsObject:FIREmailAuthProviderID]) { + } else if ([providers containsObject:@"email"]) { UIViewController *controller; if ([delegate respondsToSelector:@selector(passwordSignInViewControllerForAuthUI:email:)]) { controller = [delegate passwordSignInViewControllerForAuthUI:self.authUI @@ -186,7 +186,9 @@ - (void)onNext:(NSString *)emailText { email:emailText]; } [self pushViewController:controller]; - } else if ([emailAuth.signInMethod isEqualToString:FIREmailLinkAuthSignInMethod]) { + + // TODO: Use API to get string when Firebase 11 is the minimum. + } else if ([emailAuth.signInMethod isEqualToString:@"emailLink"]) { [self sendSignInLinkToEmail:emailText]; } else { if (providers.count) { @@ -223,7 +225,7 @@ - (void)sendSignInLinkToEmail:(NSString*)email { } [self incrementActivity]; - FUIEmailAuth *emailAuth = [self.authUI providerWithID:FIREmailAuthProviderID]; + FUIEmailAuth *emailAuth = [self.authUI providerWithID:@"email"]; [emailAuth generateURLParametersAndLocalCache:email linkingProvider:nil]; [self.auth sendSignInLinkToEmail:email actionCodeSettings:emailAuth.actionCodeSettings diff --git a/FirebaseEmailAuthUI/Sources/FUIPasswordRecoveryViewController.m b/FirebaseEmailAuthUI/Sources/FUIPasswordRecoveryViewController.m index 43edc1fccc1..7fb030ead65 100755 --- a/FirebaseEmailAuthUI/Sources/FUIPasswordRecoveryViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIPasswordRecoveryViewController.m @@ -16,7 +16,8 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIPasswordRecoveryViewController.h" -#import +@import FirebaseAuth; + #import #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailAuth.h" diff --git a/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController.m b/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController.m index eaf9ebce714..e9461bfbb74 100755 --- a/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController.m @@ -16,13 +16,16 @@ #import "FUIPasswordSignInViewController_Internal.h" -#import +@import FirebaseAuth; #import #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailAuth.h" #import "FirebaseEmailAuthUI/Sources/FUIEmailAuthStrings.h" #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIPasswordRecoveryViewController.h" +typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, + NSError *_Nullable error); + /** @var kCellReuseIdentifier @brief The reuse identifier for table view cell. */ diff --git a/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController_Internal.h b/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController_Internal.h index d8c2ff8aa0c..b4e43b0d579 100644 --- a/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController_Internal.h +++ b/FirebaseEmailAuthUI/Sources/FUIPasswordSignInViewController_Internal.h @@ -15,12 +15,15 @@ // #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIPasswordSignInViewController.h" -#import +@import FirebaseAuth; NS_ASSUME_NONNULL_BEGIN @interface FUIPasswordSignInViewController () +typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, + NSError *_Nullable error); + /** @property onDismissCallback: @brief Sets an optional custom callback for FUIPasswordSigInViewController during dismissal. This block is NOT set to nil after use, set to nil after using if you wish to avoid circular references. diff --git a/FirebaseEmailAuthUI/Sources/FUIPasswordSignUpViewController.m b/FirebaseEmailAuthUI/Sources/FUIPasswordSignUpViewController.m index fda0d26f213..19c377ee9ee 100755 --- a/FirebaseEmailAuthUI/Sources/FUIPasswordSignUpViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIPasswordSignUpViewController.m @@ -16,7 +16,7 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIPasswordSignUpViewController.h" -#import +@import FirebaseAuth; #import #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailAuth.h" diff --git a/FirebaseEmailAuthUI/Sources/FUIPasswordVerificationViewController.m b/FirebaseEmailAuthUI/Sources/FUIPasswordVerificationViewController.m index c07b1804b9b..eb1062e339c 100755 --- a/FirebaseEmailAuthUI/Sources/FUIPasswordVerificationViewController.m +++ b/FirebaseEmailAuthUI/Sources/FUIPasswordVerificationViewController.m @@ -16,7 +16,8 @@ #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIPasswordVerificationViewController.h" -#import +@import FirebaseAuth; + #import #import "FirebaseEmailAuthUI/Sources/Public/FirebaseEmailAuthUI/FUIEmailAuth.h" diff --git a/FirebaseFacebookAuthUI.podspec b/FirebaseFacebookAuthUI.podspec index 3548874e6ca..cdc1af52a7e 100644 --- a/FirebaseFacebookAuthUI.podspec +++ b/FirebaseFacebookAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseFacebookAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'A Facebook auth provider for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseFacebookAuthUI/FirebaseFacebookAuthUITests/FirebaseFacebookAuthUITests.m b/FirebaseFacebookAuthUI/FirebaseFacebookAuthUITests/FirebaseFacebookAuthUITests.m index 13b57af8ec2..4da8a54d2ba 100644 --- a/FirebaseFacebookAuthUI/FirebaseFacebookAuthUITests/FirebaseFacebookAuthUITests.m +++ b/FirebaseFacebookAuthUI/FirebaseFacebookAuthUITests/FirebaseFacebookAuthUITests.m @@ -21,7 +21,7 @@ #import "FUIAuthUtils.h" #import -#import +@import FirebaseAuth; #import #import #import diff --git a/FirebaseFacebookAuthUI/Sources/FUIFacebookAuth.m b/FirebaseFacebookAuthUI/Sources/FUIFacebookAuth.m index 93a3db74301..edea630ef47 100644 --- a/FirebaseFacebookAuthUI/Sources/FUIFacebookAuth.m +++ b/FirebaseFacebookAuthUI/Sources/FUIFacebookAuth.m @@ -17,7 +17,7 @@ #import "FirebaseFacebookAuthUI/Sources/Public/FirebaseFacebookAuthUI/FUIFacebookAuth.h" #import -#import +@import FirebaseAuth; #if SWIFT_PACKAGE @import FBSDKCoreKit; @@ -133,7 +133,7 @@ - (instancetype)init { #pragma mark - FUIAuthProvider - (nullable NSString *)providerID { - return FIRFacebookAuthProviderID; + return @"facebook.com"; } /** @fn accessToken: @@ -313,7 +313,7 @@ - (void)completeSignInFlowWithAccessToken:(nullable NSString *)accessToken FIRAuthCredential *credential; if (idToken) { NSString *rawNonce = self.currentNonce; - credential = [FIROAuthProvider credentialWithProviderID:FIRFacebookAuthProviderID + credential = [FIROAuthProvider credentialWithProviderID:@"facebook.com" IDToken:idToken rawNonce:rawNonce]; } else { @@ -389,7 +389,7 @@ - (BOOL)maybeHandleCancelledResult:(FBSDKLoginManagerLoginResult *)result if (error) { NSError *newError = [FUIAuthErrorUtils providerErrorWithUnderlyingError:error - providerID:FIRFacebookAuthProviderID]; + providerID:@"facebook.com"]; [self completeSignInFlowWithAccessToken:nil idToken:nil error:newError]; return true; } diff --git a/FirebaseFirestoreUI.podspec b/FirebaseFirestoreUI.podspec index 659de4bc667..05980c42a37 100644 --- a/FirebaseFirestoreUI.podspec +++ b/FirebaseFirestoreUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseFirestoreUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'Data libraries and UI bindings for Firestore.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseGoogleAuthUI.podspec b/FirebaseGoogleAuthUI.podspec index 2681d4ce27c..1b08e2f8e87 100644 --- a/FirebaseGoogleAuthUI.podspec +++ b/FirebaseGoogleAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseGoogleAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'Google authentication for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseGoogleAuthUI/FirebaseGoogleAuthUITests/FirebaseGoogleAuthUITests.m b/FirebaseGoogleAuthUI/FirebaseGoogleAuthUITests/FirebaseGoogleAuthUITests.m index 58e7947039e..70e03b78c8f 100644 --- a/FirebaseGoogleAuthUI/FirebaseGoogleAuthUITests/FirebaseGoogleAuthUITests.m +++ b/FirebaseGoogleAuthUI/FirebaseGoogleAuthUITests/FirebaseGoogleAuthUITests.m @@ -14,7 +14,7 @@ // limitations under the License. // -#import +@import FirebaseAuth; #import #import #import diff --git a/FirebaseGoogleAuthUI/Sources/FUIGoogleAuth.m b/FirebaseGoogleAuthUI/Sources/FUIGoogleAuth.m index 22f6a355d93..2a3db2a6a4f 100644 --- a/FirebaseGoogleAuthUI/Sources/FUIGoogleAuth.m +++ b/FirebaseGoogleAuthUI/Sources/FUIGoogleAuth.m @@ -16,7 +16,8 @@ #import "FirebaseGoogleAuthUI/Sources/Public/FirebaseGoogleAuthUI/FUIGoogleAuth.h" -#import +@import FirebaseAuth; + #import #import #import @@ -111,21 +112,22 @@ - (NSString *)clientID { #pragma mark - FUIAuthProvider - (nullable NSString *)providerID { - return FIRGoogleAuthProviderID; + // TODO: Replace with FIRGoogleAuthProvider.id when Firebase 11 is the minimum. + return @"google.com"; } - (nullable NSString *)accessToken { if (self.authUI.isEmulatorEnabled) { return nil; } - return [self googleSignIn].currentUser.authentication.accessToken; + return [self googleSignIn].currentUser.accessToken.tokenString; } - (nullable NSString *)idToken { if (self.authUI.isEmulatorEnabled) { return nil; } - return [self googleSignIn].currentUser.authentication.idToken; + return [self googleSignIn].currentUser.idToken.tokenString; } - (NSString *)shortName { @@ -193,11 +195,9 @@ - (void)signInWithDefaultValue:(nullable NSString *)defaultValue } }; - [signIn signInWithConfiguration:config - presentingViewController:presentingViewController - hint:defaultValue - callback:^(GIDGoogleUser *user, NSError *error) { - [self handleSignInWithUser:user + [signIn signInWithPresentingViewController:presentingViewController + hint:defaultValue completion:^(GIDSignInResult * _Nullable signInResult, NSError * _Nullable error) { + [self handleSignInWithUser:signInResult.user error:error presentingViewController:presentingViewController callback:callback]; @@ -234,25 +234,6 @@ - (void)signInWithOAuthProvider:(FIROAuthProvider *)oauthProvider }]; } -- (void)requestScopesWithPresentingViewController:(UIViewController *)presentingViewController - completion:(FUIAuthProviderSignInCompletionBlock)completion { - GIDSignIn *signIn = [self googleSignIn]; - [signIn addScopes:self.scopes presentingViewController:presentingViewController - callback:^(GIDGoogleUser *user, NSError *error) { - [self handleSignInWithUser:user - error:error - presentingViewController:presentingViewController - callback:^(FIRAuthCredential *credential, - NSError *error, - FIRAuthResultCallback result, - NSDictionary *userInfo) { - if (completion != nil) { - completion(credential, error, result, userInfo); - } - }]; - }]; -} - - (void)signOut { if (self.authUI.isEmulatorEnabled) { return; @@ -286,7 +267,7 @@ - (void)handleSignInWithUser:(GIDGoogleUser *)user } else { NSError *newError = [FUIAuthErrorUtils providerErrorWithUnderlyingError:error - providerID:FIRGoogleAuthProviderID]; + providerID:@"google.com"]; if (callback) { callback(nil, newError, nil, nil); } @@ -298,8 +279,8 @@ - (void)handleSignInWithUser:(GIDGoogleUser *)user [FUIAuthBaseViewController addActivityIndicator:presentingViewController.view]; [activityView startAnimating]; FIRAuthCredential *credential = - [FIRGoogleAuthProvider credentialWithIDToken:user.authentication.idToken - accessToken:user.authentication.accessToken]; + [FIRGoogleAuthProvider credentialWithIDToken:user.idToken.tokenString + accessToken:user.accessToken.tokenString]; FIRAuthResultCallback result = ^(FIRUser *_Nullable user, NSError *_Nullable error) { [activityView stopAnimating]; diff --git a/FirebaseOAuthUI.podspec b/FirebaseOAuthUI.podspec index b1c701d004b..69c8af846b9 100644 --- a/FirebaseOAuthUI.podspec +++ b/FirebaseOAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseOAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'A collection of OAuth providers for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebaseOAuthUI/FirebaseOAuthUITests/FirebaseOAuthUITests.m b/FirebaseOAuthUI/FirebaseOAuthUITests/FirebaseOAuthUITests.m index e260ded03c7..4896dd53bc5 100644 --- a/FirebaseOAuthUI/FirebaseOAuthUITests/FirebaseOAuthUITests.m +++ b/FirebaseOAuthUI/FirebaseOAuthUITests/FirebaseOAuthUITests.m @@ -17,7 +17,7 @@ #import #import -#import +@import FirebaseAuth; #import #import diff --git a/FirebaseOAuthUI/Sources/FUIOAuth.m b/FirebaseOAuthUI/Sources/FUIOAuth.m index 26645138b48..452db652824 100644 --- a/FirebaseOAuthUI/Sources/FUIOAuth.m +++ b/FirebaseOAuthUI/Sources/FUIOAuth.m @@ -14,6 +14,8 @@ // limitations under the License. // +@import FirebaseAuth; + #import "FirebaseOAuthUI/Sources/Public/FirebaseOAuthUI/FUIOAuth.h" #import diff --git a/FirebasePhoneAuthUI.podspec b/FirebasePhoneAuthUI.podspec index 4ea40ad0b39..86c2de4f3d6 100644 --- a/FirebasePhoneAuthUI.podspec +++ b/FirebasePhoneAuthUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebasePhoneAuthUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'A phone auth provider for FirebaseAuthUI.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/FirebasePhoneAuthUI/FirebasePhoneAuthUITests/FirebasePhoneAuthUITests.m b/FirebasePhoneAuthUI/FirebasePhoneAuthUITests/FirebasePhoneAuthUITests.m index 28bf8f72ca7..52ad866692b 100644 --- a/FirebasePhoneAuthUI/FirebasePhoneAuthUITests/FirebasePhoneAuthUITests.m +++ b/FirebasePhoneAuthUI/FirebasePhoneAuthUITests/FirebasePhoneAuthUITests.m @@ -18,7 +18,7 @@ #import "FUIAuthUtils.h" #import -#import +@import FirebaseAuth; #import #import #import "FUIAuthUtils.h" diff --git a/FirebasePhoneAuthUI/Sources/FUIPhoneAuth.m b/FirebasePhoneAuthUI/Sources/FUIPhoneAuth.m index 17d049d1cee..8b717e63d2f 100644 --- a/FirebasePhoneAuthUI/Sources/FUIPhoneAuth.m +++ b/FirebasePhoneAuthUI/Sources/FUIPhoneAuth.m @@ -14,6 +14,8 @@ // limitations under the License. // +@import FirebaseAuth; + #import "FirebasePhoneAuthUI/Sources/FUIPhoneAuth_Internal.h" #import diff --git a/FirebasePhoneAuthUI/Sources/FUIPhoneEntryViewController.m b/FirebasePhoneAuthUI/Sources/FUIPhoneEntryViewController.m index 20f9cf44247..61558bdc8c3 100755 --- a/FirebasePhoneAuthUI/Sources/FUIPhoneEntryViewController.m +++ b/FirebasePhoneAuthUI/Sources/FUIPhoneEntryViewController.m @@ -16,9 +16,8 @@ #import "FirebasePhoneAuthUI/Sources/FUIPhoneEntryViewController.h" -#import -#import -#import +@import FirebaseAuth; + #import #import "FirebasePhoneAuthUI/Sources/Public/FirebasePhoneAuthUI/FUIPhoneAuth.h" diff --git a/FirebasePhoneAuthUI/Sources/FUIPhoneVerificationViewController.m b/FirebasePhoneAuthUI/Sources/FUIPhoneVerificationViewController.m index 2d7219baad7..6ece9dd1f82 100644 --- a/FirebasePhoneAuthUI/Sources/FUIPhoneVerificationViewController.m +++ b/FirebasePhoneAuthUI/Sources/FUIPhoneVerificationViewController.m @@ -16,8 +16,8 @@ #import "FirebasePhoneAuthUI/Sources/FUIPhoneVerificationViewController.h" -#import -#import +@import FirebaseAuth; + #import #import "FirebasePhoneAuthUI/Sources/Public/FirebasePhoneAuthUI/FUIPhoneAuth.h" diff --git a/FirebaseStorageUI.podspec b/FirebaseStorageUI.podspec index 379466d5f33..c7b3f339ab0 100644 --- a/FirebaseStorageUI.podspec +++ b/FirebaseStorageUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseStorageUI' - s.version = '14.1.0' + s.version = '14.2.0' s.summary = 'UI binding libraries for Firebase.' s.homepage = 'https://github.com/firebase/FirebaseUI-iOS' s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } diff --git a/Package.swift b/Package.swift index f8af273bda1..b9b459b492d 100644 --- a/Package.swift +++ b/Package.swift @@ -77,12 +77,12 @@ let package = Package( .package( name: "GoogleSignIn", url: "https://github.com/google/GoogleSignIn-iOS", - from: "6.0.0" + from: "7.0.0" ), .package( name: "GoogleUtilities", url: "https://github.com/google/GoogleUtilities.git", - from: "7.4.1" + "7.4.1"..<"9.0.0" ), .package( name: "SDWebImage", diff --git a/UITests/FirebaseUISample/FUIViewController.m b/UITests/FirebaseUISample/FUIViewController.m index be064233284..da7cd52bd43 100644 --- a/UITests/FirebaseUISample/FUIViewController.m +++ b/UITests/FirebaseUISample/FUIViewController.m @@ -84,14 +84,16 @@ - (IBAction)onAuthorization:(id)sender { NSString *firstProviderID = _authProviders.firstObject.providerID; BOOL shouldSkipPhoneAuthPicker = _authProviders.count == 1 && ([firstProviderID isEqualToString:FIRPhoneAuthProviderID] || - [firstProviderID isEqualToString:FIREmailAuthProviderID]); + [firstProviderID isEqualToString:@ +@"email"]); if (!shouldSkipPhoneAuthPicker) { UIViewController *controller = [self.authUIMock authViewController]; [self presentViewController:controller animated:YES completion:nil]; } else if ([firstProviderID isEqualToString:FIRPhoneAuthProviderID]) { FUIPhoneAuth *provider = _authProviders.firstObject; [provider signInWithPresentingViewController:self phoneNumber:nil]; - } else if ([firstProviderID isEqualToString:FIREmailAuthProviderID]) { + } else if ([firstProviderID isEqualToString:@ +@"email"]) { FUIEmailAuth *provider = _authProviders.firstObject; [provider signInWithPresentingViewController:self email:nil]; } @@ -383,7 +385,8 @@ - (void)prepareForAccountManagerWithPasswordWithLinkedAccountWithEmail { id emailPasswordProviderMock = [self createPasswordProvider]; //Add third party provider with email - id linkedProviderMock = [self createThirdPartyProvider:FIRGoogleAuthProviderID hasEmail:YES]; + id linkedProviderMock = [self createThirdPartyProvider:@ +@"google.com" hasEmail:YES]; // Stub providerData NSArray *providers = @@ -395,7 +398,8 @@ - (void)prepareForAccountManagerWithPasswordWithLinkedAccountWithoutEmail { id mockUser = [self mockUserWhichHasEmail:YES]; //Add third party provider without email - id linkedProviderMock = [self createThirdPartyProvider:FIRGoogleAuthProviderID hasEmail:NO]; + id linkedProviderMock = [self createThirdPartyProvider:@ +@"google.com" hasEmail:NO]; //Add EmailPassword provider id emailPasswordProviderMock = [self createPasswordProvider]; @@ -410,7 +414,8 @@ - (void)prepareForAccountManagerWithoutPasswordWithLinkedAccountWithoutEmail { id mockUser = [self mockUserWhichHasEmail:NO]; //Add third party provider without email - id linkedProviderMock = [self createThirdPartyProvider:FIRGoogleAuthProviderID hasEmail:NO]; + id linkedProviderMock = [self createThirdPartyProvider:@ +@"google.com" hasEmail:NO]; // Stub providerData NSArray *providers = [NSArray arrayWithObject:linkedProviderMock]; @@ -421,7 +426,8 @@ - (void)prepareForAccountManagerWithoutPasswordWithLinkedAccountWithEmail { id mockUser = [self mockUserWhichHasEmail:YES]; //Add third party provider with email - id linkedProviderMock = [self createThirdPartyProvider:FIRGoogleAuthProviderID hasEmail:YES]; + id linkedProviderMock = [self createThirdPartyProvider:@ +@"google.com" hasEmail:YES]; // Stub providerData NSArray *providers = [NSArray arrayWithObject:linkedProviderMock]; @@ -432,7 +438,8 @@ - (void)prepareForAccountManagerWithoutPasswordWithLinkedAccountWithEmail { - (id)createPasswordProvider { id emailPasswordProviderMock = OCMProtocolMock(@protocol(FIRUserInfo)); - OCMStub([emailPasswordProviderMock providerID]).andReturn(FIREmailAuthProviderID); + OCMStub([emailPasswordProviderMock providerID]).andReturn(@ +@"email"); OCMStub([emailPasswordProviderMock email]).andReturn(@"password@email.com"); OCMStub([emailPasswordProviderMock displayName]).andReturn(@"password displayName"); @@ -572,7 +579,8 @@ - (void)mockServerOperations { [self mockDeleteUserRequest:mockUser]; // mock re-authentication with 3P provider - [self mockSignInWithProvider:FIRGoogleAuthProviderID user:mockUser]; + [self mockSignInWithProvider:@ +@"google.com" user:mockUser]; // mock unlinking 3P provider [self mockUnlinkOperation:mockUser]; diff --git a/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m b/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m index dd9065f8a9e..74d19cd47dd 100644 --- a/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m +++ b/samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m @@ -262,7 +262,8 @@ - (IBAction)onAuthorization:(id)sender { NSString *providerID = self.authUI.providers.firstObject.providerID; BOOL isPhoneAuth = [providerID isEqualToString:FIRPhoneAuthProviderID]; - BOOL isEmailAuth = [providerID isEqualToString:FIREmailAuthProviderID]; + BOOL isEmailAuth = [providerID isEqualToString:@ +@"email"]; BOOL shouldSkipAuthPicker = self.authUI.providers.count == 1 && (isPhoneAuth || isEmailAuth); if (shouldSkipAuthPicker) { if (isPhoneAuth) { diff --git a/samples/objc/FirebaseUI-demo-objc/Samples/Chat/FUIChatViewController.m b/samples/objc/FirebaseUI-demo-objc/Samples/Chat/FUIChatViewController.m index 333dbd46e25..b89f49b3eb8 100644 --- a/samples/objc/FirebaseUI-demo-objc/Samples/Chat/FUIChatViewController.m +++ b/samples/objc/FirebaseUI-demo-objc/Samples/Chat/FUIChatViewController.m @@ -15,7 +15,7 @@ // @import FirebaseDatabaseUI; -#import +@import FirebaseAuth; #import "FUIChatViewController.h" #import "FUIChatMessage.h"