AppDelegate.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "AppDelegate.h"
  17. #import "SignInViewController.h"
  18. @import GoogleSignIn;
  19. @implementation AppDelegate
  20. // DO NOT USE THIS CLIENT ID. IT WILL NOT WORK FOR YOUR APP.
  21. // Please use the client ID created for you by Google.
  22. static NSString * const kClientID =
  23. @"589453917038-qaoga89fitj2ukrsq27ko56fimmojac6.apps.googleusercontent.com";
  24. #pragma mark Object life-cycle.
  25. - (BOOL)application:(UIApplication *)application
  26. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  27. // Set app's client ID for |GIDSignIn|.
  28. [GIDSignIn sharedInstance].clientID = kClientID;
  29. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  30. SignInViewController *masterViewController =
  31. [[SignInViewController alloc] initWithNibName:@"SignInViewController"
  32. bundle:nil];
  33. self.navigationController =
  34. [[UINavigationController alloc]
  35. initWithRootViewController:masterViewController];
  36. self.window.rootViewController = self.navigationController;
  37. [self.window makeKeyAndVisible];
  38. return YES;
  39. }
  40. - (BOOL)application:(UIApplication *)app
  41. openURL:(NSURL *)url
  42. options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  43. return [[GIDSignIn sharedInstance] handleURL:url];
  44. }
  45. @end