Skip to content

Commit 0bf48f9

Browse files
smilesa-maurice
authored andcommitted
Move iOS Auth away from deprecated methods.
- FIRAuth:fetchProvidersForEmail was renamed fetchSignInMethodsForEmail - FIRAuth.signInAndRetrieveDataWithCredential was renamed signInWithCredential PiperOrigin-RevId: 264676177
1 parent 5fd85ba commit 0bf48f9

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

auth/src/ios/auth_ios.mm

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,20 @@ void UpdateCurrentUser(AuthData* auth_data) {
228228
futures.SafeAlloc<FetchProvidersResult>(kAuthFn_FetchProvidersForEmail, initial_data);
229229

230230
[AuthImpl(auth_data_)
231-
fetchProvidersForEmail:@(email)
232-
completion:^(NSArray<NSString *> *_Nullable providers, NSError *_Nullable error) {
233-
futures.Complete<FetchProvidersResult>(
234-
handle, AuthErrorFromNSError(error),
235-
[error.localizedDescription UTF8String],
236-
[providers](FetchProvidersResult* data) {
237-
// Copy data to our result format.
238-
data->providers.resize(providers.count);
239-
for (size_t i = 0; i < providers.count; ++i) {
240-
data->providers[i] = util::StringFromNSString(providers[i]);
241-
}
242-
});
243-
}];
231+
fetchSignInMethodsForEmail:@(email)
232+
completion:^(NSArray<NSString *> *_Nullable providers,
233+
NSError *_Nullable error) {
234+
futures.Complete<FetchProvidersResult>(
235+
handle, AuthErrorFromNSError(error),
236+
[error.localizedDescription UTF8String],
237+
[providers](FetchProvidersResult* data) {
238+
// Copy data to our result format.
239+
data->providers.resize(providers.count);
240+
for (size_t i = 0; i < providers.count; ++i) {
241+
data->providers[i] = util::StringFromNSString(providers[i]);
242+
}
243+
});
244+
}];
244245

245246
return MakeFuture(&futures, handle);
246247
}
@@ -343,11 +344,11 @@ void SignInResultCallback(FIRAuthDataResult *_Nullable auth_result, NSError *_Nu
343344
const auto handle =
344345
futures.SafeAlloc<SignInResult>(kAuthFn_SignInAndRetrieveDataWithCredential, SignInResult());
345346

346-
[AuthImpl(auth_data_) signInAndRetrieveDataWithCredential:CredentialFromImpl(credential.impl_)
347-
completion:^(FIRAuthDataResult *_Nullable auth_result,
348-
NSError *_Nullable error) {
349-
SignInResultCallback(auth_result, error, handle, auth_data_);
350-
}];
347+
[AuthImpl(auth_data_) signInWithCredential:CredentialFromImpl(credential.impl_)
348+
completion:^(FIRAuthDataResult *_Nullable auth_result,
349+
NSError *_Nullable error) {
350+
SignInResultCallback(auth_result, error, handle, auth_data_);
351+
}];
351352

352353
return MakeFuture(&futures, handle);
353354
}

0 commit comments

Comments
 (0)