FirebaseUI-iOS: FirebaseUI / FirebaseAuth Crash on phone number validation

Welcome to FirebaseUI and thanks for submitting an issue!

✅ Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.

✅ If your issue concerns the CocoaPods error, “…transitive dependencies that include static binaries”, please take a look at any of the following issues and see if your problem is solved: #48, #47, #46, #34, #23.

If not, please feel free to fill in the following info so we can help faster!

Step 1: Are you in the right place?

  • I’m in the right place * ✅

  • For issues or feature requests related to the code in this repository file a GitHub issue.

  • For general technical questions, post a question on StackOverflow tagged appropriately.

  • For general Firebase discussion, use the firebase-talk google group

  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel

Step 2: Describe your environment

  • Objective C
  • iOS version: 11.4
  • Firebase SDK version: 5.0.2
  • FirebaseUI version: 5.0.1
  • CocoaPods Version: 1.5.3

Step 3: Describe the problem:

Getting a crash inside Firebase components logic. (right after typing in phone number and taping ‘Verify’)

I understand it can be wrong use of GTMSessionFetcher in the Firebase Auth code, but also, crash happens inside this code: GTMSessionFetcherService fetcherDidBeginFetching:

Maybe you can suggest at least correct configuration for session fetcher to work properly?

Steps to reproduce:

  1. open Firebase Phone login page (see code example below)
  2. input your phone number
  3. press "Verify’ 💥

Observed Results:

Fatal Exception: NSInvalidArgumentException-[GTMSessionFetcher setFetcher:forTask:]: unrecognized selector sent to instance 0x10e429360 Raw Text
--
0 | CoreFoundation | __exceptionPreprocess
4 | CoreFoundation | _CF_forwarding_prep_0
5 | GTMSessionFetcher | GTMSessionFetcherService.m line 441-[GTMSessionFetcherService fetcherDidBeginFetching:]
6 | GTMSessionFetcher | GTMSessionFetcher.m line 894-[GTMSessionFetcher beginFetchMayDelay:mayAuthorize:]
7 | - | FIRAuthBackend.m line 545-[FIRAuthBackendRPCIssuerImplementation asyncPostToURLWithRequestConfiguration:URL:body:contentType:completionHandler:]
8 | - | FIRAuthBackend.m line 809-[FIRAuthBackendRPCImplementation postWithRequest:response:callback:]
9 | - | FIRAuthBackend.m line 701-[FIRAuthBackendRPCImplementation sendVerificationCode:callback:]
10 | - | FIRAuthBackend.m line 469+[FIRAuthBackend sendVerificationCode:callback:]
11 | - | FIRPhoneAuthProvider.m line 401__110-[FIRPhoneAuthProvider verifyClientAndSendVerificationCodeToPhoneNumber:retryOnInvalidAppCredential:callback:]_block_invoke.205
12 | - | FIRPhoneAuthProvider.m line 410-[FIRPhoneAuthProvider verifyClientWithCompletion:]
13 | - | FIRPhoneAuthProvider.m line 402-[FIRPhoneAuthProvider verifyClientAndSendVerificationCodeToPhoneNumber:retryOnInvalidAppCredential:callback:]
14 | - | FIRPhoneAuthProvider.m line 340__61-[FIRPhoneAuthProvider internalVerifyPhoneNumber:completion:]_block_invoke
15 | - | FIRAuthNotificationManager.m line 173-[FIRAuthNotificationManager callBack]
16 | - | FIRAuthNotificationManager.m line 146-[FIRAuthNotificationManager canHandleNotification:]
17 | - | FIRAuth.m line 1412__33-[FIRAuth canHandleNotification:]_block_invoke

Expected Results:

  • Would like to proceed to the SMS code entry page

Relevant Code:

Here’s how I’m using FirebaseAuth

FUIAuth *authUI = [FUIAuth defaultAuthUI];
  authUI.signInWithEmailHidden = YES;
  authUI.delegate = self;
  
  FUIPhoneAuth *provider = [[FUIPhoneAuth alloc] initWithAuthUI:authUI];
  authUI.providers = @[provider];
  [provider signInWithPresentingViewController:vc phoneNumber:mobileNumber];

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@morganchen12 @hawk-ukr hi there. I’ts a while since I’ve opened this ticket. Having crazy time now 😕 Here’s insights I have:

  1. swizzzzlinggg — if you also using something like TrustKit from Twitter — your url session delegate can be double swizzled.
  2. Firebase might re—use url session object — and at some point — It’s a problem — maybe object is deallocated at some point (this I’m not completely sure, need a good piece of time to build a trap for that bug) Hope it helps