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

Phone/SMS Auth - enable reCAPTCHA flow for devices with push notifications disabled #461

Closed
southerneer opened this issue Oct 4, 2017 · 14 comments
Assignees

Comments

@southerneer
Copy link

Issue

In #119 there was some mention of the fallback reCAPTCHA flow from the Firebase Auth docs. Is it (or should it be) possible to trigger with the latest v3 of react-native-firebase?

The Firebase docs make it sound like it should "just work" in iOS by adding the REVERSED_CLIENT_ID from GoogleService-Info.plist to URL Types in XCode.
image

For devices with push notifications disabled (or simulators) the reCAPTCHA flow should be the fallback option, but I haven't been able to get it to work with react-native-firebase.

My setup works flawlessly on physical devices with push notifications enabled, but when I try to login with a phone number on my simulator I get the following error: "There seems to be a problem with your project's Firebase phone number authentication set-up, please make sure to follow the instructions found at https://firebase.google.com/docs/auth/ios/phone-auth". I've added the REVERSED_CLIENT_ID per the instructions, but at this point it's difficult to tell if the problem lies with react-native-firebase or something I'm still missing in my code.

Environment

  1. Application Target Platform: iOS
  2. Development Operating System: macOS Sierra
  3. Build Tools: Xcode 9.0
  4. React Native version: 0.47.2
  5. RNFirebase Version: 3.0.0-alpha.5
  6. Firebase Module: auth
@Salakar
Copy link
Member

Salakar commented Oct 4, 2017

@southerneer I've been going through the motions of documenting / testing this end to end for the past couple hours, I'll respond once I've either confirmed the full process works or if I have to fix anything along the way.

@southerneer
Copy link
Author

Great, let me know if you need me to test anything on my end. I'm actively working on this today too.

@southerneer
Copy link
Author

@Salakar I figured out what was missing from react-native-firebase, will submit a PR in a few minutes

@Salakar
Copy link
Member

Salakar commented Oct 4, 2017

Ah, awesome :)

@southerneer
Copy link
Author

Never mind, it was already good...

https://github.com/invertase/react-native-firebase/blob/master/ios/RNFirebase/auth/RNFirebaseAuth.m#L660

Looks like you added the UIDelegate:nil bit in a commit yesterday. That enabled the reCAPTCHA. Please publish to npm when you get a chance. And thanks for all your hard work!

@Salakar
Copy link
Member

Salakar commented Oct 4, 2017

Ah yes I did that change yesterday (797780f), which means it's already on npm - the full v3 version has been out since the launch of Cloud Firestore

@Salakar
Copy link
Member

Salakar commented Oct 4, 2017

Out of interest, are you using signInWithPhoneNumber or verifyPhoneNumber?

Would you be able to give verifyPhoneNumber number a go if you haven't already used it, be good to get a couple other devices trying it. #119 (comment) Is the writeup of it - see the Basic Example bit - ios specific implementation

Edit: having said that, I only pushed up verify as part of the full v3, doh - so once you've upgraded then if possible can you give it a go, ta.

@southerneer
Copy link
Author

southerneer commented Oct 4, 2017

Using both...the app I'm working on uses Firebase Auth as the only auth solution (and as we're in the process of submitting to the app store we're getting rejected because there was no alternative for phones with push notifications disabled). I'll be testing this thoroughly for the next couple hours and will post here if anything unexpected turns up.

I misspoke, we're only using signInWithPhoneNumber at the moment. It'll be a bit before I can test verifyPhoneNumber

@Salakar
Copy link
Member

Salakar commented Oct 4, 2017

Ok, no worries, feel free to make another issue if you come across any issues. We're also all on discord.

@southerneer southerneer reopened this Oct 5, 2017
@southerneer
Copy link
Author

@Salakar what did you mean by "I only pushed up verify as part of the full v3"? Should I therefore switch to using verifyPhoneNumber? We're in the process of getting through App Store review and keep getting rejected because the Apple testers never receive the SMS. They get past the verification step (where they would either get a background push notification or get the reCAPTCHA challenge) so that's all good, but they never get the SMS after that step.

I'm going to implement verifyPhoneNumber on my end and see if that makes any difference.

@chrisbianca
Copy link
Contributor

I believe that @Salakar merely meant that verifyPhoneNumber was added after signInWithPhoneNumber as a more customisable version of the functionality. His change should have enabled reCAPTCHA support so I believe that this can be closed as solving the initial problem.

If you're experiencing other problems, could you open a new issue with details?

@southerneer
Copy link
Author

Gotcha, thanks for clarifying @chrisbianca . At the time I reopened this issue I was grasping at straws because our app was getting rejecting from the Apple App Store. The tester/reviewer couldn't get the expected SMS (or so they claimed). Once a different tester tried the app, though, everything magically resolved itself so I think it was more user error than anything that was wrong with Firebase or react-native-firebase.

@ankit-kachhwaha
Copy link

how can I disable robot captcha on firebase for IOS app

@fullstact69
Copy link

I can't receive the verification code from firebase . How can i resolve this?

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

No branches or pull requests

5 participants