diff --git a/Firebase/Auth/Source/Public/FIRUser.h b/Firebase/Auth/Source/Public/FIRUser.h index e0df1b1ee6b..f3380ec156d 100644 --- a/Firebase/Auth/Source/Public/FIRUser.h +++ b/Firebase/Auth/Source/Public/FIRUser.h @@ -18,13 +18,13 @@ #import "FIRAuth.h" #import "FIRAuthDataResult.h" -#import "FIRAuthUIDelegate.h" #import "FIRUserInfo.h" @class FIRAuthTokenResult; @class FIRPhoneAuthCredential; @class FIRUserProfileChangeRequest; @class FIRUserMetadata; +@protocol FIRAuthUIDelegate; NS_ASSUME_NONNULL_BEGIN diff --git a/Firebase/Auth/Source/User/FIRUser.m b/Firebase/Auth/Source/User/FIRUser.m index d91b90440fe..686763bccaf 100644 --- a/Firebase/Auth/Source/User/FIRUser.m +++ b/Firebase/Auth/Source/User/FIRUser.m @@ -795,12 +795,16 @@ - (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *) creden - (void)reauthenticateWithProvider:(id)provider UIDelegate:(nullable id)UIDelegate completion:(nullable FIRAuthDataResultCallback)completion { - [provider getCredentialWithUIDelegate:UIDelegate - completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - [self reauthenticateWithCredential:credential - completion:completion]; - }]; +#if TARGET_OS_IOS + dispatch_async(FIRAuthGlobalWorkQueue(), ^{ + [provider getCredentialWithUIDelegate:UIDelegate + completion:^(FIRAuthCredential *_Nullable credential, + NSError *_Nullable error) { + [self reauthenticateWithCredential:credential + completion:completion]; + }]; + }); +#endif // TARGET_OS_IOS } - (nullable NSString *)refreshToken { @@ -1249,12 +1253,16 @@ - (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *)credential - (void)linkWithProvider:(id)provider UIDelegate:(nullable id)UIDelegate completion:(nullable FIRAuthDataResultCallback)completion { - [provider getCredentialWithUIDelegate:UIDelegate - completion:^(FIRAuthCredential *_Nullable credential, - NSError *_Nullable error) { - [self linkWithCredential:credential - completion:completion]; - }]; +#if TARGET_OS_IOS + dispatch_async(FIRAuthGlobalWorkQueue(), ^{ + [provider getCredentialWithUIDelegate:UIDelegate + completion:^(FIRAuthCredential *_Nullable credential, + NSError *_Nullable error) { + [self linkWithCredential:credential + completion:completion]; + }]; + }); +#endif // TARGET_OS_IOS } - (void)unlinkFromProvider:(NSString *)provider