Skip to content

Commit a822880

Browse files
Yue-Wang-GoogleCorrob
authored andcommitted
Remove support for deprecated API for Firebase 6 (#2759)
1 parent b6b75fa commit a822880

File tree

4 files changed

+0
-94
lines changed

4 files changed

+0
-94
lines changed

Example/Auth/Tests/FIRAuthTests.m

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -451,42 +451,6 @@ - (void)testFetchSignInMethodsForEmailSuccess {
451451
OCMVerifyAll(_mockBackend);
452452
}
453453

454-
/** @fn testFetchProvidersForEmailSuccessDeprecatedProviderID
455-
@brief Tests the flow of a successful @c fetchProvidersForEmail:completion: call using the
456-
deprecated FIREmailPasswordAuthProviderID.
457-
*/
458-
- (void)testFetchProvidersForEmailSuccessDeprecatedProviderID {
459-
#pragma clang diagnostic push
460-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
461-
NSArray<NSString *> *allProviders =
462-
@[ FIRGoogleAuthProviderID, FIREmailAuthProviderID ];
463-
#pragma clang diagnostic pop
464-
OCMExpect([_mockBackend createAuthURI:[OCMArg any]
465-
callback:[OCMArg any]])
466-
.andCallBlock2(^(FIRCreateAuthURIRequest *_Nullable request,
467-
FIRCreateAuthURIResponseCallback callback) {
468-
XCTAssertEqualObjects(request.identifier, kEmail);
469-
XCTAssertNotNil(request.endpoint);
470-
XCTAssertEqualObjects(request.APIKey, kAPIKey);
471-
dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
472-
id mockCreateAuthURIResponse = OCMClassMock([FIRCreateAuthURIResponse class]);
473-
OCMStub([mockCreateAuthURIResponse allProviders]).andReturn(allProviders);
474-
callback(mockCreateAuthURIResponse, nil);
475-
});
476-
});
477-
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
478-
[[FIRAuth auth] fetchProvidersForEmail:kEmail
479-
completion:^(NSArray<NSString *> *_Nullable providers,
480-
NSError *_Nullable error) {
481-
XCTAssertTrue([NSThread isMainThread]);
482-
XCTAssertEqualObjects(providers, allProviders);
483-
XCTAssertNil(error);
484-
[expectation fulfill];
485-
}];
486-
[self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
487-
OCMVerifyAll(_mockBackend);
488-
}
489-
490454
/** @fn testFetchProvidersForEmailFailure
491455
@brief Tests the flow of a failed @c fetchProvidersForEmail:completion: call.
492456
*/
@@ -1135,45 +1099,6 @@ - (void)testSignInWithEmailCredentialSuccess {
11351099
OCMVerifyAll(_mockBackend);
11361100
}
11371101

1138-
/** @fn testSignInWithEmailCredentialSuccess
1139-
@brief Tests the flow of a successfully @c signInWithCredential:completion: call with an
1140-
email-password credential using the deprecated FIREmailPasswordAuthProvider.
1141-
*/
1142-
- (void)testSignInWithEmailCredentialSuccessWithDepricatedProvider {
1143-
OCMExpect([_mockBackend verifyPassword:[OCMArg any] callback:[OCMArg any]])
1144-
.andCallBlock2(^(FIRVerifyPasswordRequest *_Nullable request,
1145-
FIRVerifyPasswordResponseCallback callback) {
1146-
XCTAssertEqualObjects(request.APIKey, kAPIKey);
1147-
XCTAssertEqualObjects(request.email, kEmail);
1148-
XCTAssertEqualObjects(request.password, kFakePassword);
1149-
XCTAssertTrue(request.returnSecureToken);
1150-
dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
1151-
id mockVeriyPasswordResponse = OCMClassMock([FIRVerifyPasswordResponse class]);
1152-
[self stubTokensWithMockResponse:mockVeriyPasswordResponse];
1153-
callback(mockVeriyPasswordResponse, nil);
1154-
});
1155-
});
1156-
[self expectGetAccountInfo];
1157-
XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
1158-
[[FIRAuth auth] signOut:NULL];
1159-
#pragma clang diagnostic push
1160-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
1161-
FIRAuthCredential *emailCredential =
1162-
[FIREmailAuthProvider credentialWithEmail:kEmail password:kFakePassword];
1163-
#pragma clang diagnostic pop
1164-
[[FIRAuth auth] signInWithCredential:emailCredential
1165-
completion:^(FIRAuthDataResult * _Nullable result,
1166-
NSError *_Nullable error) {
1167-
XCTAssertTrue([NSThread isMainThread]);
1168-
[self assertUser:result.user];
1169-
XCTAssertNil(error);
1170-
[expectation fulfill];
1171-
}];
1172-
[self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
1173-
[self assertUser:[FIRAuth auth].currentUser];
1174-
OCMVerifyAll(_mockBackend);
1175-
}
1176-
11771102
/** @fn testSignInWithEmailCredentialFailure
11781103
@brief Tests the flow of a failed @c signInWithCredential:completion: call with an
11791104
email-password credential.

Firebase/Auth/Source/Auth Provider/Email/FIREmailAuthProvider.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#import "FIREmailPasswordAuthCredential.h"
2020

21-
// FIREmailPasswordAuthProviderID is defined in FIRAuthProvider.m.
22-
2321
NS_ASSUME_NONNULL_BEGIN
2422

2523
@implementation FIREmailAuthProvider

Firebase/Auth/Source/Auth Provider/FIRAuthProvider.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
// Declared 'extern' in FIREmailAuthProvider.h
2828
NSString *const FIREmailAuthProviderID = @"password";
2929

30-
// Declared 'extern' in FIREmailAuthProvider.h
31-
NSString *const FIREmailPasswordAuthProviderID = @"password";
32-
3330
// Declared 'extern' in FIRTwitterAuthProvider.h
3431
NSString *const FIRTwitterAuthProviderID = @"twitter.com";
3532

Firebase/Auth/Source/Utilities/FIRAuthErrorUtils.m

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737

3838
NSString *const FIRAuthErrorUserInfoNameKey = @"FIRAuthErrorUserInfoNameKey";
3939

40-
NSString *const FIRAuthErrorNameKey = @"error_name";
41-
42-
NSString *const FIRAuthUpdatedCredentialKey = @"FIRAuthUpdatedCredentialKey";
43-
4440
/** @var kServerErrorDetailMarker
4541
@brief This marker indicates that the server error message contains a detail error message which
4642
should be used instead of the hardcoded client error message.
@@ -753,11 +749,6 @@ + (NSError *)errorWithCode:(FIRAuthInternalErrorCode)code
753749
if (!errorUserInfo[NSLocalizedDescriptionKey]) {
754750
errorUserInfo[NSLocalizedDescriptionKey] = FIRAuthErrorDescription(errorCode);
755751
}
756-
#pragma clang diagnostic push
757-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
758-
// TODO(wangyue): Remove the deprecated code on next breaking change.
759-
errorUserInfo[FIRAuthErrorNameKey] = FIRAuthErrorCodeString(errorCode);
760-
#pragma clang diagnostic pop
761752
errorUserInfo[FIRAuthErrorUserInfoNameKey] = FIRAuthErrorCodeString(errorCode);
762753
return [NSError errorWithDomain:FIRAuthErrorDomain code:errorCode userInfo:errorUserInfo];
763754
} else {
@@ -957,11 +948,6 @@ + (NSError *)credentialAlreadyInUseErrorWithMessage:(nullable NSString *)message
957948
email:(nullable NSString *)email {
958949
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
959950
if (credential) {
960-
#pragma clang diagnostic push
961-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
962-
// TODO(wangyue): Remove the deprecated code on next breaking change.
963-
userInfo[FIRAuthUpdatedCredentialKey] = credential;
964-
#pragma clang diagnostic pop
965951
userInfo[FIRAuthErrorUserInfoUpdatedCredentialKey] = credential;
966952
}
967953
if (email.length) {

0 commit comments

Comments
 (0)