-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Conversation
@kroikie looks good. Sorry about the formatting issue. I'm having some serious compatibility issues with my computer after upgrading to Mojave. |
@kroikie Should we also add a corresponding |
@pranjalsatija good call, added. |
I tested it on an armv7 (32-bit) iPhone and an android simulator and the example provided worked fine. Nice work. checked out the PR using
Note have to add phone number To add it to your own flutter project and see how far you can get, add the following to your
Happy Coding!! |
Is firebase auth v 0.5.12 is released? |
@hemesh2394 As of this posting, |
@mmcc007 how much time will it take for the release of firebase auth v 0.5.12. Thanks |
@saivamsid I'm not a contributor to this new feature. Just looking at using the new phone auth feature in a flutter app. So I have no input on when it will be released. |
@mmcc007 How did you manage to get the iOS working? Here it just stopped sending the phone verification today on a real device while the simulator still works. |
cc @bparrishMines for review |
@gildaswise I tested it again on an armv7 (32-bit) iPhone and it still works (deleted the user in Google Console -> Authentication). It looks like it will not work without using a normalized phone number (probably conforming to format described in libphonenumber). For example, in my case (in USA) it did not send a verification code if I used the format BTW: would be nice if there was a dart implementation of libphonenumber to catch badly formed phone numbers on input (hint... hint... ;) ) |
@mmcc007 I don't know what's happening here. I'm using the same number on both simulator and real device (an iPhone 7+) and it is only working on the simulator. This is the only thing missing for a release here. The only difference is that I'm brazilian, so the country code is +55. |
@gildaswise I assume you are using your Per Telephone_numbers_in_Brazil I'm guessing the format should look something like |
@mmcc007 That didn't work, sadly. As I said, it's only failing on the iPhone 7+ while it works normally with this format: |
@gildaswise Working on a simulator confirms that the code is most likely completely correct. If you cannot receive a text on your real device from whichever data center Google is texting your confirmation code (datacenter could be in Brazil, or some other country), then, I'm guessing, either you cannot receive international texts on your real device, or the format of the number is incorrect, or possibly something else. Confirm u can receive international texts on your real device and try different phone number formats, I'm guessing it should eventually work. |
@mmcc007 I tried sending the code to the iPhone 7+'s number from my Google Pixel and it worked. I really don't know what is the problem as all printed logs from inputted numbers are matching. |
My guess is that your real device has to have a plan from your telephone company that supports international texting. |
I said that it's receiving the code if I do the process from my Android device or the simultator, but it isn't "sending from itself". |
@gildaswise I assume from your posts that the phone auth of your flutter app works on your If both your My guess is you're pretty close to solving the problem. I don't know if there is much further I can add. |
default: | ||
result.notImplemented(); | ||
break; | ||
} | ||
} | ||
|
||
private void handleSignInWithPhoneNumber(MethodCall call, Result result) { | ||
Map<String, String> arguments = (Map<String, String>) call.arguments; | ||
String verificationId = arguments.get("verificationId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can just use call.argument("verificationId")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast to Map<String, String>
would still be necessary so I'll leave it as is.
@@ -37,6 +37,10 @@ class MyHomePage extends StatefulWidget { | |||
|
|||
class _MyHomePageState extends State<MyHomePage> { | |||
Future<String> _message = new Future<String>.value(''); | |||
TextEditingController smsCodeController = new TextEditingController(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add underscore to variables like _message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@AlexandreRoba Have you tried using https instead of ssh? It fixed some fetch issues for me.
|
Hello @kueckermann thanks for the tip. It solved the issue. Now why it works on my mac and not in a docker container is mistery :). Cheers, Alex. |
471373c
to
5e5e346
Compare
I tried out the PR, and it worked fine at first - I got the SMS, entered code and logged in. Then i tried deleting the FirebaseUser from the console for my phone number. Any comments on this? |
@xzminx Thanks for reporting this, I was able to reproduce and I will submit a fix in another PR. |
* Add phone auth
@kueckermann I am getting
How can i add the dependency for the PR in my flutter project, |
@probuse Phone Auth has been published in the firebase_auth plugin. |
@gildaswise If you have a chance can you please update your medium article with 0.5.15. Thanks |
@saltpetreca Just updated it! Also, changed a few things related to error handling. |
@gildaswise Thanks Appreciate |
@gildaswise & @kroikie |
@padmanabanSampath you can use shared_preferences plugin |
@CasperPas thanks for your recommendation, any example code snippet will be useful, regarding phone auth token or uid persistence and checking whether the user has signed in before or not, and adding expiry to the shared preference firebase user storage |
I am sorry if this is not the right place to raise this issue again. Just opened the issue on flutter (flutter/flutter#22903 ) but was looking for any help!?. Is a google or any other auth necessary for phone auth or can it be done stand alone. If it can be done stand alone what is the above error message. ˜Thanks |
* Add phone auth
Update firebase_auth plugin to support phone number authentication.
This PR is a combination of the ideas expressed by @alibitek in PR and @pranjalsatija in PR
Fixes: flutter/flutter#10404