Peter Andrews 4 лет назад
Родитель
Сommit
dcefc1329c

+ 1 - 1
GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h

@@ -171,7 +171,7 @@ typedef void (^GIDDisconnectCallback)(NSError *_Nullable error);
 /// Disconnects the current user from the app and revokes previous authentication. If the operation
 /// succeeds, the OAuth 2.0 token is also removed from keychain.
 ///
-/// @param callback The optional `GIDSignInCallback` block that is called on completion.
+/// @param callback The optional `GIDDisconnectCallback` block that is called on completion.
 - (void)disconnectWithCallback:(nullable GIDDisconnectCallback)callback;
 
 @end

+ 6 - 5
Sample/Source/AppDelegate.m

@@ -33,16 +33,17 @@ static NSString * const kClientID =
     didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   // Set app's client ID for |GIDSignIn|.
   GIDSignIn.sharedInstance.clientID = kClientID;
-  // Restore any previous sign-in session before displaying main view.
+  // Restore any previous sign-in session at app launch before displaying main view.  If the restore
+  // 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) {
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     SignInViewController *masterViewController =
-        [[SignInViewController alloc] initWithNibName:@"SignInViewController"
-                                               bundle:nil];
+        [[SignInViewController alloc] initWithNibName:@"SignInViewController" bundle:nil];
     self.navigationController =
-        [[UINavigationController alloc]
-            initWithRootViewController:masterViewController];
+        [[UINavigationController alloc] initWithRootViewController:masterViewController];
     self.window.rootViewController = self.navigationController;
     [self.window makeKeyAndVisible];
   }];