From 28a2db8a8d5baad7d5865b6b622949196b2e59c0 Mon Sep 17 00:00:00 2001 From: Daniel Bazzani Date: Mon, 12 Feb 2024 19:05:03 +0100 Subject: [PATCH] Add extra_params argument to signin call --- GoogleSignIn/Sources/GIDSignIn.m | 10 ++++++++-- GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GoogleSignIn/Sources/GIDSignIn.m b/GoogleSignIn/Sources/GIDSignIn.m index 429c1666..0841fd72 100644 --- a/GoogleSignIn/Sources/GIDSignIn.m +++ b/GoogleSignIn/Sources/GIDSignIn.m @@ -248,15 +248,21 @@ - (void)signInWithPresentingViewController:(UIViewController *)presentingViewCon - (void)signInWithPresentingViewController:(UIViewController *)presentingViewController hint:(nullable NSString *)hint additionalScopes:(nullable NSArray *)additionalScopes + additionalParams:(nullable NSDictionary *)extraParams completion:(nullable GIDSignInCompletion)completion { - GIDSignInInternalOptions *options = + GIDSignInInternalOptions *options = [GIDSignInInternalOptions defaultOptionsWithConfiguration:_configuration presentingViewController:presentingViewController loginHint:hint addScopesFlow:NO scopes:additionalScopes completion:completion]; - [self signInWithOptions:options]; + + if (extraParams != nil) { + options = [options optionsWithExtraParameters:extraParams forContinuation:NO]; + } + + [self signInWithOptions:options]; } - (void)signInWithPresentingViewController:(UIViewController *)presentingViewController diff --git a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h index 9ea59812..8fc20836 100644 --- a/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h +++ b/GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h @@ -160,6 +160,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { - (void)signInWithPresentingViewController:(UIViewController *)presentingViewController hint:(nullable NSString *)hint additionalScopes:(nullable NSArray *)additionalScopes + additionalParams:(nullable NSDictionary *)extraParams completion: (nullable void (^)(GIDSignInResult *_Nullable signInResult, NSError *_Nullable error))completion