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

Add extra_params argument to signin call #369

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion GoogleSignIn.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ The Google Sign-In SDK allows users to sign in with their Google account from th
s.osx.framework = 'AppKit'
s.dependency 'AppAuth', '>= 1.7.3', '< 2.0'
s.dependency 'GTMAppAuth', '>= 4.1.1', '< 5.0'
s.dependency 'GTMSessionFetcher/Core', '~> 3.3'
s.resource_bundle = {
'GoogleSignIn' => ['GoogleSignIn/Sources/{Resources,Strings}/*']
}
Expand Down
10 changes: 8 additions & 2 deletions GoogleSignIn/Sources/GIDSignIn.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,21 @@ - (void)signInWithPresentingViewController:(UIViewController *)presentingViewCon
- (void)signInWithPresentingViewController:(UIViewController *)presentingViewController
hint:(nullable NSString *)hint
additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
additionalParams:(nullable NSDictionary *)extraParams
completion:(nullable GIDSignInCompletion)completion {
GIDSignInInternalOptions *options =
GIDSignInInternalOptions *options =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please remove the extra space in the beginning of this line?

[GIDSignInInternalOptions defaultOptionsWithConfiguration:_configuration
presentingViewController:presentingViewController
loginHint:hint
addScopesFlow:NO
scopes:additionalScopes
completion:completion];
[self signInWithOptions:options];

if (extraParams != nil) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests for this method?

options = [options optionsWithExtraParameters:extraParams forContinuation:NO];
}

[self signInWithOptions:options];
}

- (void)signInWithPresentingViewController:(UIViewController *)presentingViewController
Expand Down
1 change: 1 addition & 0 deletions GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) {
- (void)signInWithPresentingViewController:(UIViewController *)presentingViewController

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add documentation comment on the new parameter.

hint:(nullable NSString *)hint
additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
additionalParams:(nullable NSDictionary *)extraParams

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep the original method and create another method with the additionalParams parameter, to prevent breaking existing client integrations with this API? We can have the original method call this method with nil as additionalParams.

completion:
(nullable void (^)(GIDSignInResult *_Nullable signInResult,
NSError *_Nullable error))completion
Expand Down