AppDelegate.swift 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // TODO: Reenable Facebook login integration.
  28. // ApplicationDelegate.shared.application(
  29. // application,
  30. // didFinishLaunchingWithOptions: launchOptions
  31. // )
  32. return true
  33. }
  34. // [START application_open]
  35. func application(_ app: UIApplication,
  36. open url: URL,
  37. options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
  38. // [END application_open]
  39. if GIDSignIn.sharedInstance.handle(url) {
  40. return true
  41. }
  42. return ApplicationDelegate.shared.application(
  43. app,
  44. open: url,
  45. sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
  46. annotation: options[UIApplication.OpenURLOptionsKey.annotation]
  47. )
  48. }
  49. // MARK: UISceneSession Lifecycle
  50. func application(_ application: UIApplication,
  51. configurationForConnecting connectingSceneSession: UISceneSession,
  52. options: UIScene.ConnectionOptions) -> UISceneConfiguration {
  53. // Called when a new scene session is being created.
  54. // Use this method to select a configuration to create the new scene with.
  55. return UISceneConfiguration(
  56. name: "Default Configuration",
  57. sessionRole: connectingSceneSession.role
  58. )
  59. }
  60. // MARK: - Application Appearance
  61. private func configureApplicationAppearance() {
  62. UINavigationBar.appearance().tintColor = .systemOrange
  63. UITabBar.appearance().tintColor = .systemOrange
  64. }
  65. }