Selaa lähdekoodia

Style improvement.

pinlu 3 vuotta sitten
vanhempi
sitoutus
ba214ce8c5

+ 16 - 14
GoogleSignIn/Sources/GIDSignIn.m

@@ -189,8 +189,10 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
   return [authState isAuthorized];
 }
 
-- (void)restorePreviousSignInWithCallback:(nullable void (^)(GIDGoogleUser *_Nullable user, NSError *_Nullable error))callback {
-  [self signInWithOptions:[GIDSignInInternalOptions silentOptionsWithCallback:^(GIDUserAuth *userAuth, NSError *error){
+- (void)restorePreviousSignInWithCallback:(nullable void (^)(GIDGoogleUser *_Nullable user,
+                                                             NSError *_Nullable error))callback {
+  [self signInWithOptions:[GIDSignInInternalOptions silentOptionsWithCallback:
+                           ^(GIDUserAuth *userAuth, NSError *error) {
     if (userAuth) {
       callback(userAuth.user, nil);
     } else {
@@ -225,7 +227,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
        presentingViewController:(UIViewController *)presentingViewController
                            hint:(nullable NSString *)hint
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   GIDSignInInternalOptions *options =
       [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
                                        presentingViewController:presentingViewController
@@ -239,7 +241,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
        presentingViewController:(UIViewController *)presentingViewController
                            hint:(nullable NSString *)hint
                additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   GIDSignInInternalOptions *options =
     [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
                                      presentingViewController:presentingViewController
@@ -252,7 +254,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
        presentingViewController:(UIViewController *)presentingViewController
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   [self signInWithConfiguration:configuration
        presentingViewController:presentingViewController
                            hint:nil
@@ -261,7 +263,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 
 - (void)addScopes:(NSArray<NSString *> *)scopes
     presentingViewController:(UIViewController *)presentingViewController
-                    callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                    callback:(nullable GIDUserAuthCallback)callback {
   // A currentUser must be available in order to complete this flow.
   if (!self.currentUser) {
     // No currentUser is set, notify callback of failure.
@@ -318,7 +320,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
                presentingWindow:(NSWindow *)presentingWindow
                            hint:(nullable NSString *)hint
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   GIDSignInInternalOptions *options =
       [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
                                                presentingWindow:presentingWindow
@@ -330,7 +332,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
                presentingWindow:(NSWindow *)presentingWindow
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   [self signInWithConfiguration:configuration
                presentingWindow:presentingWindow
                            hint:nil
@@ -341,7 +343,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
                presentingWindow:(NSWindow *)presentingWindow
                            hint:(nullable NSString *)hint
                additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                       callback:(nullable GIDUserAuthCallback)callback {
   GIDSignInInternalOptions *options =
     [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
                                              presentingWindow:presentingWindow
@@ -354,7 +356,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 
 - (void)addScopes:(NSArray<NSString *> *)scopes
             presentingWindow:(NSWindow *)presentingWindow
-                    callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                    callback:(nullable GIDUserAuthCallback)callback {
   // A currentUser must be available in order to complete this flow.
   if (!self.currentUser) {
     // No currentUser is set, notify callback of failure.
@@ -549,7 +551,7 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
         if (options.callback) {
           self->_currentOptions = nil;
           dispatch_async(dispatch_get_main_queue(), ^{
-            GIDUserAuth *userAuth = [[GIDUserAuth alloc]initWithGoogleUser:self->_currentUser serverAuthCode:nil];
+            GIDUserAuth *userAuth = [[GIDUserAuth alloc] initWithGoogleUser:self->_currentUser serverAuthCode:nil];
             options.callback(userAuth, nil);
           });
         }
@@ -891,15 +893,15 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
   [authFlow addCallback:^() {
     GIDAuthFlow *handlerAuthFlow = weakAuthFlow;
     if (self->_currentOptions.callback) {
-      void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error) = self->_currentOptions.callback;
+      GIDUserAuthCallback callback = self->_currentOptions.callback;
       self->_currentOptions = nil;
       dispatch_async(dispatch_get_main_queue(), ^{
         if (handlerAuthFlow.error) {
           callback(nil, handlerAuthFlow.error);
         } else {
           OIDAuthState *authState = handlerAuthFlow.authState;
-          NSString * _Nullable serverAuthCode = [authState.lastTokenResponse.additionalParameters[@"server_code"] copy];
-          GIDUserAuth *  userAuth = [[GIDUserAuth alloc]initWithGoogleUser:self->_currentUser serverAuthCode:serverAuthCode];
+          NSString *_Nullable serverAuthCode = [authState.lastTokenResponse.additionalParameters[@"server_code"] copy];
+          GIDUserAuth *userAuth = [[GIDUserAuth alloc] initWithGoogleUser:self->_currentUser serverAuthCode:serverAuthCode];
           callback(userAuth, nil);
         }
       });

+ 12 - 6
GoogleSignIn/Sources/GIDSignInInternalOptions.h

@@ -54,7 +54,8 @@ NS_ASSUME_NONNULL_BEGIN
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
 
 /// The callback block to be called at the completion of the flow.
-@property(nonatomic, readonly, nullable) void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error);
+@property(nonatomic, readonly, nullable) void (^callback)(GIDUserAuth *_Nullable userAuth,
+                                                          NSError *_Nullable error);
 
 /// The scopes to be used during the flow.
 @property(nonatomic, copy, nullable) NSArray<NSString *> *scopes;
@@ -68,32 +69,37 @@ NS_ASSUME_NONNULL_BEGIN
                        presentingViewController:(nullable UIViewController *)presentingViewController
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback;
 
 + (instancetype)defaultOptionsWithConfiguration:(nullable GIDConfiguration *)configuration
                        presentingViewController:(nullable UIViewController *)presentingViewController
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
                                          scopes:(nullable NSArray *)scopes
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback;
 
 #elif TARGET_OS_OSX
 + (instancetype)defaultOptionsWithConfiguration:(nullable GIDConfiguration *)configuration
                                presentingWindow:(nullable NSWindow *)presentingWindow
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback;
 
 + (instancetype)defaultOptionsWithConfiguration:(nullable GIDConfiguration *)configuration
                                presentingWindow:(nullable NSWindow *)presentingWindow
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
                                          scopes:(nullable NSArray *)scopes
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback;
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
 
 /// Creates the options to sign in silently.
-+ (instancetype)silentOptionsWithCallback:(void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
++ (instancetype)silentOptionsWithCallback:(void (^)(GIDUserAuth *_Nullable userAuth,
+                                                    NSError *_Nullable error))callback;
 
 /// Creates options with the same values as the receiver, except for the "extra parameters", and
 /// continuation flag, which are replaced by the arguments passed to this method.

+ 11 - 6
GoogleSignIn/Sources/GIDSignInInternalOptions.m

@@ -31,14 +31,16 @@ NS_ASSUME_NONNULL_BEGIN
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
                                          scopes:(nullable NSArray *)scopes
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback {
 #elif TARGET_OS_OSX
 + (instancetype)defaultOptionsWithConfiguration:(nullable GIDConfiguration *)configuration
                                presentingWindow:(nullable NSWindow *)presentingWindow
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
                                          scopes:(nullable NSArray *)scopes
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback {
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
   
   GIDSignInInternalOptions *options = [[GIDSignInInternalOptions alloc] init];
@@ -64,13 +66,15 @@ NS_ASSUME_NONNULL_BEGIN
                        presentingViewController:(nullable UIViewController *)presentingViewController
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback {
 #elif TARGET_OS_OSX
 + (instancetype)defaultOptionsWithConfiguration:(nullable GIDConfiguration *)configuration
                                presentingWindow:(nullable NSWindow *)presentingWindow
                                       loginHint:(nullable NSString *)loginHint
                                   addScopesFlow:(BOOL)addScopesFlow
-                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
+                                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                                   NSError *_Nullable error))callback {
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
     GIDSignInInternalOptions *options = [self defaultOptionsWithConfiguration:configuration
 #if TARGET_OS_IOS || TARGET_OS_MACCATALYST
@@ -85,7 +89,8 @@ NS_ASSUME_NONNULL_BEGIN
   return options;
 }
 
-+ (instancetype)silentOptionsWithCallback:(void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback {
++ (instancetype)silentOptionsWithCallback:(void (^)(GIDUserAuth *_Nullable userAuth,
+                                                    NSError *_Nullable error))callback {
   GIDSignInInternalOptions *options = [self defaultOptionsWithConfiguration:nil
 #if TARGET_OS_IOS || TARGET_OS_MACCATALYST
                                                    presentingViewController:nil
@@ -93,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN
                                                            presentingWindow:nil
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
                                                                   loginHint:nil
-                                                               addScopesFlow:NO
+                                                              addScopesFlow:NO
                                                                    callback:callback];
   if (options) {
     options->_interactive = NO;

+ 4 - 0
GoogleSignIn/Sources/GIDSignIn_Private.h

@@ -21,6 +21,10 @@ NS_ASSUME_NONNULL_BEGIN
 @class GIDGoogleUser;
 @class GIDSignInInternalOptions;
 
+// Represents a callback block that takes a `GIDUserAuth` on success or an error if the operation
+// was unsuccessful.
+typedef void (^GIDUserAuthCallback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error);
+
 // Private |GIDSignIn| methods that are used internally in this SDK and other Google SDKs.
 @interface GIDSignIn ()
 

+ 30 - 22
GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h

@@ -88,9 +88,10 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 
 /// Attempts to restore a previously authenticated user without interaction.
 ///
-/// @param callback The `GIDSignInCallback` block that is called on completion.  This block will be
-///     called asynchronously on the main queue.
-- (void)restorePreviousSignInWithCallback:(nullable void (^)(GIDGoogleUser *_Nullable user, NSError *_Nullable error))callback;
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
+///     the main queue.
+- (void)restorePreviousSignInWithCallback:(nullable void (^)(GIDGoogleUser *_Nullable user,
+                                                             NSError *_Nullable error))callback;
 
 /// Marks current user as being in the signed out state.
 - (void)signOut;
@@ -114,11 +115,12 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// @param presentingViewController The view controller used to present `SFSafariViewContoller` on
 ///     iOS 9 and 10 and to supply `presentationContextProvider` for `ASWebAuthenticationSession` on
 ///     iOS 13+.
-/// @param callback The `GIDSignInCallback` block that is called on completion.  This block will be
-///     called asynchronously on the main queue.
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
+///     the main queue.
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
        presentingViewController:(UIViewController *)presentingViewController
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback
     NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions.");
 
 /// Starts an interactive sign-in flow  on iOS using the provided configuration and a login hint.
@@ -134,12 +136,13 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 ///     iOS 13+.
 /// @param hint An optional hint for the authorization server, for example the user's ID or email
 ///     address, to be prefilled if possible.
-/// @param callback The `GIDSignInCallback` block that is called on completion.  This block will be
-///     called asynchronously on the main queue.
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
+///     the main queue.
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
        presentingViewController:(UIViewController *)presentingViewController
                            hint:(nullable NSString *)hint
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback
     NS_EXTENSION_UNAVAILABLE("The sign-in flow is not supported in App Extensions.");
 
 /// Starts an interactive sign-in flow on iOS using the provided configuration and a login hint.
@@ -155,14 +158,14 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// @param hint An optional hint for the authorization server, for example the user's ID or email
 ///     address, to be prefilled if possible.
 /// @param additionalScopes An optional array of scopes to request in addition to the basic profile scopes.
-/// @param callback The `GIDSignInCallback` block that is called on completion.  This block will be
-///     called asynchronously on the main queue.
-
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
+///     the main queue.
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
        presentingViewController:(UIViewController *)presentingViewController
                            hint:(nullable NSString *)hint
                additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback;
 
 /// Starts an interactive consent flow on iOS to add scopes to the current user's grants.
 ///
@@ -173,11 +176,12 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// @param presentingViewController The view controller used to present `SFSafariViewContoller` on
 ///     iOS 9 and 10 and to supply `presentationContextProvider` for `ASWebAuthenticationSession` on
 ///     iOS 13+.
-/// @param callback The  block that is called on completion.  This block will be called asynchronously on
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
 ///     the main queue.
 - (void)addScopes:(NSArray<NSString *> *)scopes
     presentingViewController:(UIViewController *)presentingViewController
-                    callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback
+                    callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                NSError *_Nullable error))callback
     NS_EXTENSION_UNAVAILABLE("The add scopes flow is not supported in App Extensions."); 
 
 #elif TARGET_OS_OSX
@@ -190,11 +194,12 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 ///
 /// @param configuration The configuration properties to be used for this flow.
 /// @param presentingWindow The window used to supply `presentationContextProvider` for `ASWebAuthenticationSession`.
-/// @param callback The  block that is called on completion.  This block will be called asynchronously on
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
 ///     the main queue.
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
                presentingWindow:(NSWindow *)presentingWindow
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback;
 
 /// Starts an interactive sign-in flow on macOS using the provided configuration and a login hint.
 ///
@@ -207,12 +212,13 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// @param presentingWindow The window used to supply `presentationContextProvider` for `ASWebAuthenticationSession`.
 /// @param hint An optional hint for the authorization server, for example the user's ID or email
 ///     address, to be prefilled if possible.
-/// @param callback The  block that is called on completion.  This block will be called asynchronously on
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
 ///     the main queue.
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
                presentingWindow:(NSWindow *)presentingWindow
                            hint:(nullable NSString *)hint
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback;
 
 /// Starts an interactive sign-in flow on macOS using the provided configuration and a login hint.
 ///
@@ -226,14 +232,15 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// @param hint An optional hint for the authorization server, for example the user's ID or email
 ///     address, to be prefilled if possible.
 /// @param additionalScopes An optional array of scopes to request in addition to the basic profile scopes.
-/// @param callback The  block that is called on completion.  This block will be called asynchronously on
+/// @param callback The block that is called on completion.  This block will be called asynchronously on
 ///     the main queue.
 
 - (void)signInWithConfiguration:(GIDConfiguration *)configuration
                presentingWindow:(NSWindow *)presentingWindow
                            hint:(nullable NSString *)hint
                additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
-                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+                       callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                                   NSError *_Nullable error))callback;
 
 /// Starts an interactive consent flow on macOS to add scopes to the current user's grants.
 ///
@@ -246,7 +253,8 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 ///     the main queue.
 - (void)addScopes:(NSArray<NSString *> *)scopes
        presentingWindow:(NSWindow *)presentingWindow
-               callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error))callback;
+               callback:(nullable void (^)(GIDUserAuth *_Nullable userAuth,
+                                           NSError *_Nullable error))callback;
 
 #endif
 

+ 5 - 4
GoogleSignIn/Tests/Unit/GIDSignInInternalOptionsTest.m

@@ -37,8 +37,8 @@
   id presentingWindow = OCMStrictClassMock([NSWindow class]);
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
   NSString *loginHint = @"login_hint";
-  void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error) = ^(GIDUserAuth *_Nullable userAuth, NSError * _Nullable error) {};
-  
+  void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error) =
+      ^(GIDUserAuth *_Nullable userAuth, NSError * _Nullable error) {};
   GIDSignInInternalOptions *options =
       [GIDSignInInternalOptions defaultOptionsWithConfiguration:configuration
 #if TARGET_OS_IOS || TARGET_OS_MACCATALYST
@@ -47,7 +47,7 @@
                                                presentingWindow:presentingWindow
 #endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
                                                       loginHint:loginHint
-                                                   addScopesFlow:NO
+                                                  addScopesFlow:NO
                                                        callback:callback];
   XCTAssertTrue(options.interactive);
   XCTAssertFalse(options.continuation);
@@ -63,7 +63,8 @@
 }
 
 - (void)testSilentOptions {
-  void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error) = ^(GIDUserAuth *_Nullable userAuth, NSError * _Nullable error) {};
+  void (^callback)(GIDUserAuth *_Nullable userAuth, NSError *_Nullable error) =
+      ^(GIDUserAuth *_Nullable userAuth, NSError * _Nullable error) {};
   GIDSignInInternalOptions *options = [GIDSignInInternalOptions silentOptionsWithCallback:callback];
   XCTAssertFalse(options.interactive);
   XCTAssertFalse(options.continuation);

+ 5 - 5
Samples/ObjC/SignInSample/Source/SignInViewController.m

@@ -259,8 +259,8 @@ static NSString * const kClientID =
 - (IBAction)signIn:(id)sender {
   [GIDSignIn.sharedInstance signInWithConfiguration:_configuration
                            presentingViewController:self
-                                           callback:^(GIDUserAuth * _Nullable userAuth,
-                                                      NSError * _Nullable error) {
+                                           callback:^(GIDUserAuth *_Nullable userAuth,
+                                                      NSError *_Nullable error) {
     if (error) {
       self->_signInAuthStatus.text =
           [NSString stringWithFormat:@"Status: Authentication error: %@", error];
@@ -278,7 +278,7 @@ static NSString * const kClientID =
 }
 
 - (IBAction)disconnect:(id)sender {
-  [GIDSignIn.sharedInstance disconnectWithCallback:^(NSError * _Nullable error) {
+  [GIDSignIn.sharedInstance disconnectWithCallback:^(NSError *_Nullable error) {
     if (error) {
       self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to disconnect: %@",
                                       error];
@@ -293,8 +293,8 @@ static NSString * const kClientID =
 - (IBAction)addScopes:(id)sender {
   [GIDSignIn.sharedInstance addScopes:@[ @"https://www.googleapis.com/auth/user.birthday.read" ]
              presentingViewController:self
-                             callback:^(GIDUserAuth * _Nullable userAuth,
-                                        NSError * _Nullable error) {
+                             callback:^(GIDUserAuth *_Nullable userAuth,
+                                        NSError *_Nullable error) {
     if (error) {
       self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to add scopes: %@",
                                       error];