|
|
@ -33,6 +33,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
#import "SelectUserViewController.h" |
|
|
|
#import "SelectUserViewController.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#import "SecondViewController.h" |
|
|
|
|
|
|
|
|
|
|
|
@implementation SelectUserViewController |
|
|
|
@implementation SelectUserViewController |
|
|
|
|
|
|
|
|
|
|
|
- (void)viewDidLoad { |
|
|
|
- (void)viewDidLoad { |
|
|
@ -42,10 +44,16 @@ |
|
|
|
self.signOutButton.hidden = YES; |
|
|
|
self.signOutButton.hidden = YES; |
|
|
|
|
|
|
|
|
|
|
|
// As instructed in https://developers.google.com/identity/sign-in/ios/sign-in |
|
|
|
// As instructed in https://developers.google.com/identity/sign-in/ios/sign-in |
|
|
|
GIDSignIn.sharedInstance.delegate = self; |
|
|
|
GIDSignIn *signIn = GIDSignIn.sharedInstance; |
|
|
|
GIDSignIn.sharedInstance.uiDelegate = self; |
|
|
|
signIn.delegate = self; |
|
|
|
|
|
|
|
signIn.uiDelegate = self; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// As instructed in https://developers.google.com/identity/sign-in/ios/additional-scopes |
|
|
|
|
|
|
|
if (![signIn.scopes containsObject:kTestScope]) { |
|
|
|
|
|
|
|
signIn.scopes = [signIn.scopes arrayByAddingObject:kTestScope]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[GIDSignIn.sharedInstance signInSilently]; |
|
|
|
[signIn signInSilently]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)signIn:(GIDSignIn *)signIn |
|
|
|
- (void)signIn:(GIDSignIn *)signIn |
|
|
@ -67,8 +75,10 @@ didSignInForUser:(GIDGoogleUser *)user |
|
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapSignOut { |
|
|
|
- (IBAction)didTapSignOut { |
|
|
|
[GIDSignIn.sharedInstance signOut]; |
|
|
|
[GIDSignIn.sharedInstance signOut]; |
|
|
|
|
|
|
|
|
|
|
|
self.mainLabel.text = @"Please sign in."; |
|
|
|
self.mainLabel.text = @"Please sign in."; |
|
|
|
self.subLabel.text = @""; |
|
|
|
self.subLabel.text = @""; |
|
|
|
|
|
|
|
|
|
|
|
self.signInButton.hidden = NO; |
|
|
|
self.signInButton.hidden = NO; |
|
|
|
self.signOutButton.hidden = YES; |
|
|
|
self.signOutButton.hidden = YES; |
|
|
|
} |
|
|
|
} |
|
|
|