GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add default phone number to the Phone Auth number flow. by yramanchuk · Pull Request #334 · firebase/FirebaseUI-iOS

Conversation

@yramanchuk

@yramanchuk yramanchuk commented Sep 12, 2017

Copy link
Copy Markdown
Contributor

Related issue: #306

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yramanchuk
Add default phone number to the Phone Auth number flow.
7cb83f1
@yramanchuk
yramanchuk requested a review from morganchen12 September 12, 2017 20:21
morganchen12
morganchen12 requested changes Sep 12, 2017
View reviewed changes

@morganchen12 morganchen12 left a comment

Copy link
Copy Markdown
Contributor

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.

Looks mostly good, had a few comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebaseFacebookAuthUI/FUIFacebookAuth.m Outdated
}

- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
presentingViewController:(nullable UIViewController *)presentingViewController

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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: colon alignment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebaseGoogleAuthUI/FUIGoogleAuth.m Outdated
}

- (void)signInWithDefaultValue:(nullable NSString *)defaultValue
presentingViewController:(nullable UIViewController *)presentingViewController

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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: colon alignment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.h
a raw phone number and country code.
@return object or nil if any of the required parameters is nil.
*/
- (instancetype)initWithNormalizedPhoneNumber:(NSString *)normalizedPhoneNumber;

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

These three initializers need to return nullable instancetype, not instancetype.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.h
@param countryCode (required) The country code information
@return object or nil if any of the required parameters is nil.
*/
- (instancetype)initWithRawPhoneNumber:(NSString *)rawPhoneNumber

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

nullable instancetype

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.h
@param countryCode (required) The country code information
@return object or nil if any of the required parameters is nil.
*/
- (instancetype)initWithNormalizedPhoneNumber:(NSString *)normalizedPhoneNumber

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

nullable instancetype

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.h Outdated

- (instancetype)init __unavailable;

- (BOOL)validate:(NSError **)error;

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

Please add docs comments to this method.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated
NSParameterAssert(rawPhoneNumber);
NSParameterAssert(countryCode);
if (!normalizedPhoneNumber || !rawPhoneNumber || !countryCode){
return nil;

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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 return statement should be unreachable given the assertions above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@morganchen12 morganchen12 Sep 13, 2017

Copy link
Copy Markdown
Contributor

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.

If this is the only point where we return nil and it's unreachable, maybe the method signature should be modified to return a nonnull type and this code should be removed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated
if (error) {
*error = [NSError errorWithDomain:FUIPhoneNumberValidationErrorDomain
code:FUIPhoneNumberValidationErrorMissingPlus
userInfo:nil];

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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 should be adding userInfo dictionaries with description keys, so meaningful error messages appear when the errors are logged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated
if (error) {
*error = [NSError errorWithDomain:FUIPhoneNumberValidationErrorDomain
code:FUIPhoneNumberValidationErrorMissingDialCode
userInfo:nil];

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

See above

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/FUIPhoneEntryViewController.m Outdated
- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
bundle:(nullable NSBundle *)nibBundleOrNil
authUI:(FUIAuth *)authUI {
return [self initWithNibName:NSStringFromClass([self class])

@morganchen12 morganchen12 Sep 12, 2017

Copy link
Copy Markdown
Contributor

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.

Should this initializer ignore the nib and bundle parameters?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yramanchuk yramanchuk mentioned this pull request Sep 12, 2017
Default phone firebase/FirebaseUI-Android#906
Merged
@yramanchuk
Update code style. Fix phone number validation method.
90e0a0d
@yramanchuk

yramanchuk commented Sep 13, 2017

Copy link
Copy Markdown
Contributor Author

Morgan, thanks for all your comments!
PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yramanchuk
Update code style. Fix phone number validation method.
623c011
morganchen12
morganchen12 reviewed Sep 13, 2017
View reviewed changes

@morganchen12 morganchen12 left a comment

Copy link
Copy Markdown
Contributor

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.

Looks good, pending a few comments about assertions/nullability in the initializers.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated

@implementation FUIPhoneNumber

- (nullable instancetype)initWithNormalizedPhoneNumber:(NSString *)normalizedPhoneNumber {

@morganchen12 morganchen12 Sep 13, 2017

Copy link
Copy Markdown
Contributor

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 function takes a nonnull normalizedPhoneNumber, so maybe instead of returning nil we can assert and return a nonnull type as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated
- (nullable instancetype)initWithNormalizedPhoneNumber:(NSString *)normalizedPhoneNumber
rawPhoneNumber:(NSString *)rawPhoneNumber
countryCode:(FUICountryCodeInfo *)countryCode {
if (!normalizedPhoneNumber || !rawPhoneNumber || !countryCode){

@morganchen12 morganchen12 Sep 13, 2017

Copy link
Copy Markdown
Contributor

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 as the other initializer, all of these parameters are expected to be nonnull.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.m Outdated
return self;
}

- (nullable instancetype)initWithRawPhoneNumber:(NSString *)rawPhoneNumber

@morganchen12 morganchen12 Sep 13, 2017

Copy link
Copy Markdown
Contributor

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.

If the other two initializers are no longer failable, this one can be marked nonnull as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yramanchuk
Update signature of FUIPhoneNumber init methods.
6608ec1
@yramanchuk

yramanchuk commented Sep 19, 2017

Copy link
Copy Markdown
Contributor Author

@morganchen12 Done!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

morganchen12
morganchen12 approved these changes Sep 19, 2017
View reviewed changes

@morganchen12 morganchen12 left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM, merge whenever

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yramanchuk
yramanchuk merged commit 5dac6a1 into master Sep 19, 2017
@yramanchuk
yramanchuk deleted the default_phone branch September 19, 2017 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@morganchen12 morganchen12 morganchen12 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yramanchuk @morganchen12
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.