From 614f491167d0f23dfed326a533e2161fd62bd681 Mon Sep 17 00:00:00 2001 From: pinlu Date: Wed, 10 Aug 2022 11:14:05 -0700 Subject: [PATCH] Fix Sample App build failure Use the `completion` to replace `callback` according to the latest API change. --- Samples/ObjC/SignInSample/Source/AppDelegate.m | 4 ++-- Samples/ObjC/SignInSample/Source/SignInViewController.m | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Samples/ObjC/SignInSample/Source/AppDelegate.m b/Samples/ObjC/SignInSample/Source/AppDelegate.m index 45927392..de742b5c 100644 --- a/Samples/ObjC/SignInSample/Source/AppDelegate.m +++ b/Samples/ObjC/SignInSample/Source/AppDelegate.m @@ -30,8 +30,8 @@ - (BOOL)application:(UIApplication *)application // succeeds, we'll have a currentUser and the view will be able to draw its UI for the signed-in // state. If the restore fails, currentUser will be nil and we'll draw the signed-out state // prompting the user to sign in. - [GIDSignIn.sharedInstance restorePreviousSignInWithCallback:^(GIDGoogleUser * _Nullable user, - NSError * _Nullable error) { + [GIDSignIn.sharedInstance restorePreviousSignInWithCompletion:^(GIDGoogleUser *user, + NSError *error) { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; SignInViewController *masterViewController = [[SignInViewController alloc] initWithNibName:@"SignInViewController" bundle:nil]; diff --git a/Samples/ObjC/SignInSample/Source/SignInViewController.m b/Samples/ObjC/SignInSample/Source/SignInViewController.m index 009e698c..5f422f6a 100644 --- a/Samples/ObjC/SignInSample/Source/SignInViewController.m +++ b/Samples/ObjC/SignInSample/Source/SignInViewController.m @@ -259,8 +259,7 @@ - (void)updateButtons { - (IBAction)signIn:(id)sender { [GIDSignIn.sharedInstance signInWithConfiguration:_configuration presentingViewController:self - callback:^(GIDGoogleUser * _Nullable user, - NSError * _Nullable error) { + completion:^(GIDGoogleUser *user, NSError *error) { if (error) { self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Authentication error: %@", error]; @@ -278,7 +277,7 @@ - (IBAction)signOut:(id)sender { } - (IBAction)disconnect:(id)sender { - [GIDSignIn.sharedInstance disconnectWithCallback:^(NSError * _Nullable error) { + [GIDSignIn.sharedInstance disconnectWithCompletion:^(NSError *error) { if (error) { self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to disconnect: %@", error]; @@ -293,8 +292,7 @@ - (IBAction)disconnect:(id)sender { - (IBAction)addScopes:(id)sender { [GIDSignIn.sharedInstance addScopes:@[ @"https://www.googleapis.com/auth/user.birthday.read" ] presentingViewController:self - callback:^(GIDGoogleUser * _Nullable user, - NSError * _Nullable error) { + completion:^(GIDGoogleUser *user, NSError *error) { if (error) { self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to add scopes: %@", error];