Skip to content

Commit 3d6305a

Browse files
author
chuanr
authored
Force to recaptcha verification flow for phone auth in Simulators (#10426)
1 parent 80940c0 commit 3d6305a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

FirebaseAuth/Sources/AuthProvider/Phone/FIRPhoneAuthProvider.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,17 @@ - (void)verifyClientAndSendVerificationCodeToPhoneNumber:(NSString *)phoneNumber
593593
*/
594594
- (void)verifyClientWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
595595
completion:(FIRVerifyClientCallback)completion {
596+
// Remove the simulator check below after FCM supports APNs in simulators
597+
#if TARGET_OS_SIMULATOR
598+
if (@available(iOS 16, *)) {
599+
NSDictionary *environment = [[NSProcessInfo processInfo] environment];
600+
if ((environment[@"XCTestConfigurationFilePath"] == nil)) {
601+
[self reCAPTCHAFlowWithUIDelegate:UIDelegate completion:completion];
602+
return;
603+
}
604+
}
605+
#endif
606+
596607
if (_auth.appCredentialManager.credential) {
597608
completion(_auth.appCredentialManager.credential, nil, nil);
598609
return;

0 commit comments

Comments
 (0)