AppDelegate.swift 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import FBSDKCoreKit
  15. import FirebaseCore
  16. import GoogleSignIn
  17. import UIKit
  18. @UIApplicationMain
  19. class AppDelegate: UIResponder, UIApplicationDelegate {
  20. func application(_ application: UIApplication,
  21. didFinishLaunchingWithOptions launchOptions: [UIApplication
  22. .LaunchOptionsKey: Any]?) -> Bool {
  23. configureApplicationAppearance()
  24. // [START firebase_configure]
  25. FirebaseApp.configure()
  26. // [END firebase_configure]
  27. ApplicationDelegate.shared.application(
  28. application,
  29. didFinishLaunchingWithOptions: launchOptions
  30. )
  31. return true
  32. }
  33. // [START application_open]
  34. func application(_ app: UIApplication,
  35. open url: URL,
  36. options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
  37. // [END application_open]
  38. if GIDSignIn.sharedInstance.handle(url) {
  39. return true
  40. }
  41. return ApplicationDelegate.shared.application(
  42. app,
  43. open: url,
  44. sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
  45. annotation: options[UIApplication.OpenURLOptionsKey.annotation]
  46. )
  47. }
  48. // MARK: UISceneSession Lifecycle
  49. func application(_ application: UIApplication,
  50. configurationForConnecting connectingSceneSession: UISceneSession,
  51. options: UIScene.ConnectionOptions) -> UISceneConfiguration {
  52. // Called when a new scene session is being created.
  53. // Use this method to select a configuration to create the new scene with.
  54. return UISceneConfiguration(
  55. name: "Default Configuration",
  56. sessionRole: connectingSceneSession.role
  57. )
  58. }
  59. // MARK: - Application Appearance
  60. private func configureApplicationAppearance() {
  61. UINavigationBar.appearance().tintColor = .systemOrange
  62. UITabBar.appearance().tintColor = .systemOrange
  63. }
  64. }