SignInViewController.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2021 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <UIKit/UIKit.h>
  17. @import GoogleSignIn;
  18. // A view controller for the Google Sign-In button which initiates a standard
  19. // OAuth 2.0 flow and provides an access token and a refresh token. A "Sign out"
  20. // button is provided to allow users to sign out of this application.
  21. @interface SignInViewController : UITableViewController
  22. @property(weak, nonatomic) IBOutlet GIDSignInButton *signInButton;
  23. // A label to display the result of the sign-in action.
  24. @property(weak, nonatomic) IBOutlet UILabel *signInAuthStatus;
  25. // A label to display the signed-in user's display name.
  26. @property(weak, nonatomic) IBOutlet UILabel *userName;
  27. // A label to display the signed-in user's email address.
  28. @property(weak, nonatomic) IBOutlet UILabel *userEmailAddress;
  29. // An image view to display the signed-in user's avatar image.
  30. @property(weak, nonatomic) IBOutlet UIImageView *userAvatar;
  31. // A button to sign out of this application.
  32. @property(weak, nonatomic) IBOutlet UIButton *signOutButton;
  33. // A button to disconnect user from this application.
  34. @property(weak, nonatomic) IBOutlet UIButton *disconnectButton;
  35. // A button to add scopes for this application.
  36. @property(weak, nonatomic) IBOutlet UIButton *addScopesButton;
  37. // A button to inspect the authorization object.
  38. @property(weak, nonatomic) IBOutlet UIButton *credentialsButton;
  39. // A dynamically-created slider for controlling the sign-in button width.
  40. @property(weak, nonatomic) UISlider *signInButtonWidthSlider;
  41. // Called when the user presses the "Sign out" button.
  42. - (IBAction)signOut:(id)sender;
  43. // Called when the user presses the "Disconnect" button.
  44. - (IBAction)disconnect:(id)sender;
  45. // Called when the user presses the "Credentials" button.
  46. - (IBAction)showAuthInspector:(id)sender;
  47. @end