-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Merge phone auth into version-2.0.0 #740
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
Conversation
Change-Id: Ief6f138e79117a43aa789cc3e8ad5c9872a4e476
Change-Id: Ia3b861157127a1dee7e4625d9e786a6df45dea30
Change-Id: I989ee0354088a185d1373981532b52c9c0b0165e
Change-Id: I18fc00185d7505408f448079563564618339a32c
Change-Id: I901c8d8132d93582f30ee1589080bb3f882fa452
Change-Id: Id2cbfdfc49e82da03f319c209799648bb9c3bfc5
Change-Id: I1d759c469567545158b5d51de847da1d6cff297f
Fix unhandled error cases Change-Id: I39a5fb26297ebe1afd57a0687f709aee2dd529eb
Change-Id: I126347c68c0ce19604f0926f30fccb8c89532f5a
Change-Id: I6ba7ea8b8268d10cfea5db421db7a740bc20a8f7
Change-Id: I6b57fb46472367360cda4d1c4e88538f0495fa49
Change-Id: Icd1e115e51c37c1b599166422be6072fc0fd4f4c
Revert changes introduced in cred picker to support phone auth in commit a626685 Change-Id: I265be2d294218579d177c1d39b44fd6181f88767
Used the asset downloaded from: https://icons.googleplex.com/#icon=ic_phone&search=phone Used Android Studio to create the vector drawable, allowed RTL auto-mirroring and manually changed color from black to white. Bug: 38454930 Change-Id: I7e55d7e95284c0e20ff3aa99d6727bddc3e795b6
Change-Id: Id5beeacdb014632b7c9438dc7d42066fc05d28f0
Change-Id: I1b07ed83741832730b4277dd65934cdf11d658db
Change-Id: I20b9ee9c24180f8de19f030371541922d0f10104
Change-Id: I9928978e188599c852f675453f59ce624bc9602d
Change-Id: I6d2bedb15d96f39e3d3e71682e33388fa41f3439
We upgrade to twitter kit 3.0 and achieve the following 1. No more fabric deps. This shaves our sdk down even more and clears related bugs. 2. We use only twitter core and not other deps. Shaves even more. Total savings: 0.6 MB Change-Id: I64ae5b6c7e2f238c35e25d6b2a2b7089431a3a0a
Change-Id: I57574ae9e376e3c576218b4e18e16ad914a6c496
Problem: Apps are currently required to add the facebook and twitter dependency even if they do not require these login methods to be supported. Solution: In this change, we assume a provided scope dependency on facebook and twitter sdks and expect that the apps provide these dependencies. If these dependencies are not found, we fail early with an actionable error. Also, the size of the resulting apk reduces by about 2MB. Change-Id: I5979039c281dd6daca265f60f9c9dcf59596ced1
Bug: 62309027 Change-Id: Iccbdb2a34e8c0b14c6fcf186005e0f1a68ea180e
Change-Id: Ib18e49c565e39c30bba83333aa8188fc853e1775
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
LGTM |
Here is an enumeration of the changes at a high level (in no particular order):
|
Change-Id: I5ff1752f718b91602020147a91fe56691b09318f
@samtstern Ouch! That's a lot of changes! 😕 Glad to finally see phone auth come out though!!! 😄 I have a few questions:
|
PS: The failing test is because you guys aren't using <a href="#DM_BOXED_PRIMITIVE_FOR_PARSING">Bug type DM_BOXED_PRIMITIVE_FOR_PARSING (click for details)</a>
<br/>In class com.firebase.ui.auth.ui.phone.CountryListSpinner<br/>In method com.firebase.ui.auth.ui.phone.CountryListSpinner.setSelectedForCountry(Locale, String)<br/>Called method Integer.intValue()<br/>Should call Integer.parseInt(String) instead<br/>At CountryListSpinner.java:[line 83]</p> |
@SUPERCILEX there's a few huge benefits of doing twitter/facebook this way:
I agree we should use implementation down the road, but I think in the meantime this is a big improvement. |
@samtstern Ohhhh, wait so you don't have to include them if you aren't using Facebook/Twitter? Won't there be a |
Change-Id: I0b884bdbe5e62713dc3a4edca8539cace74f3f18
@SUPERCILEX we're using a trick to check for Facebook/Twitter SDK presence if you enable those providers (and at other entry points to the flow like |
Two remaining test failures:
|
LoginManager.getInstance().logOut(); | ||
try { | ||
LoginManager.getInstance().logOut(); | ||
} catch (NoClassDefFoundError e) { |
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.
@SUPERCILEX we're using a trick to check for Facebook/Twitter SDK presence if you enable those providers (and at other entry points to the flow like signOut) and then throwing a RuntimeException before you can proceed saying "add the dependency"
Gotcha, just saw this. Now that I think about it, I'm definitely starting to really like the idea. For Instant apps, you could limit the providers to just Google and reap massive benefits. Snazzy! 😄
cc: @ashwinraghav two remaining test failures in the phone auth branch. I pushed commits to fix all the lint/checkstyle/findbugs errors. |
Change-Id: If1686bde8906f2e06d87c51fb8399be0b960028d
@SUPERCILEX got all the tests to pass now but |
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.
Some general comments, questions, and code quality improvements.
|
||
if (config.getProviderId().equals(FACEBOOK_PROVIDER)) { | ||
try { | ||
Class c = com.facebook.FacebookCallback.class; |
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.
Why FacebookCallback
? Wouldn't FacebookSdk
make more sense since it's something Facebook will probably never get rid of?
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.
Yep, good call.
|
||
if (config.getProviderId().equals(TWITTER_PROVIDER)) { | ||
try { | ||
Class c = com.twitter.sdk.android.core.TwitterCore.class; |
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.
Same, Twitter
makes more sense than TwitterCore
.
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.
We're actually only depending on Twitter core now (which means we don't pull in Fabric). This is new with the upgrade to Twitter SDK 3.0
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.
Oh, awesome! Gotta love that smaller APK size! 😄
@@ -34,22 +34,25 @@ | |||
public class IdpResponse implements Parcelable { | |||
private final String mProviderId; | |||
private final String mEmail; | |||
private final String mPhoneNumber; |
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.
Lol, this isn't being used anywhere. 😆 There's no getter anywhere so we should just get rid of it.
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.
We are setting it in PhoneVerificationActivity
so I'll add a getter.
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.
Oh, K so we do want the dev to get the phone number from IdpResponse
. Cool beans! 😄
} | ||
|
||
@Override | ||
public String getProviderId() { |
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.
Can we add @AuthUI.SupportedProvider
?
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, added on email too.
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.
Awesome!
} | ||
|
||
@Override | ||
public int getButtonLayout() { |
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.
Can we add @LayoutRes
?
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.
@@ -93,7 +93,6 @@ public void onConnected(Bundle bundle) { | |||
finish(); | |||
return; | |||
} | |||
|
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: this space reduces cram so we should keep it.
@@ -21,6 +21,7 @@ | |||
import com.google.firebase.auth.FacebookAuthProvider; | |||
import com.google.firebase.auth.FirebaseUser; | |||
import com.google.firebase.auth.GoogleAuthProvider; | |||
import com.google.firebase.auth.PhoneAuthProvider; |
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.
This doesn't look necessary since there are no other changes in this class. Should there be some though? Wouldn't we want to update and use providerIdToAccountType
somewhere?
@@ -16,6 +16,7 @@ | |||
|
|||
import com.firebase.ui.auth.ui.ActivityHelper; | |||
import com.firebase.ui.auth.util.signincontainer.SaveSmartLock; | |||
import com.google.firebase.auth.PhoneAuthProvider; |
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.
Probs a refactor mistake, we don't need it.
@@ -18,6 +18,7 @@ | |||
|
|||
public class TestConstants { | |||
public static final String EMAIL = "[email protected]"; | |||
public static final String PHONE = "+14347565353"; |
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.
Lol, is this a real phone number? We should probably go with +15555555555
or something similar.
@@ -81,4 +83,26 @@ public static void verifySmartLockSave(String providerId, String email, String p | |||
assertEquals(password, passwordCaptor.getValue()); | |||
assertEquals(providerId, idpResponseCaptor.getValue().getProviderType()); | |||
} | |||
|
|||
public static void verifySmartLockSave(String providerId, String email, String phoneNumber, |
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.
Could we fold this into the method above? I know this is a test, but still the method below is almost unreadable. We could just pass in null for the phoneNumber
or have a simple overload that does that for us.
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.
Good idea, will make this DRY
@samtstern Looks like an issue with your machine 😄 (The Travis tests are passing) |
Change-Id: I6eac4c2e92c13b1e5ad9a2953441566ad2d7c29e
@SUPERCILEX thank you for the thorough review! I believe I have addressed all feedback with the following TODO items (which can be handled later):
|
@samtstern Awesome, LGTM! |
As mentioned we've been working on phone auth internally. Now that the Play services
11.0.0
SDK is out we can move into the open.This merges all of the phone auth changes into
version-2.0.0-dev