Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get phone number from FUIPhoneAuth instance #857

Open
willbattel opened this issue Apr 27, 2020 · 4 comments
Open

Get phone number from FUIPhoneAuth instance #857

willbattel opened this issue Apr 27, 2020 · 4 comments
Labels

Comments

@willbattel
Copy link

willbattel commented Apr 27, 2020

Step 1: Are you 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 or Swift: Swift
  • iOS version: >=11.1
  • Firebase SDK version: 6.18.0
  • FirebaseUI version: 8.4.2
  • CocoaPods Version: 1.9.1

Step 3: Describe the problem:

We're using FUI for phone authentication. In the event on a merge conflict, where we do not get an AuthDataResult, I want to retrieve the phone number that the user provided from within the authUI(_:didSignInWith:error:) delegate function (before we do signIn, where we would then be able to get it directly from FIRAuth). What I think would make the most sense would be to add it as a property on the FUIPhoneAuth class similar to how we can get the email with authUI.providers.first?.email?(). Would this change be feasible?

@willbattel
Copy link
Author

Hey @morganchen12 could I get your thoughts on this as a short-term solution to #851? I know it will be some time before 851 can be implemented, so as a workaround I'd like to get the phone number to do a Firestore lookup for finding the UID manually. As far as I can tell, there isn't a way for us to intercept the phone number provided by the user in the FUI flow.

@morganchen12
Copy link
Contributor

The best way to do that would be to fork FirebaseUI, add the workaround there, and point your CocoaPods installation to your fork.

@willbattel
Copy link
Author

Regardless of my use case, would it not make sense to expose a phoneNumber property on the FUIPhoneAuth class? It already has an email property- so it seems like providing the phone number would make sense. Is this thought misguided?

@morganchen12
Copy link
Contributor

That thought makes sense. User identifiers (like phone/email) should be attached to the specific providers for those identifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants