// // AppDelegate.swift // EventLocator // // Created by Saim on 19/11/2019. // Copyright © 2019 Saim. All rights reserved. // import UIKit import GoogleMaps import GooglePlaces import Firebase import FirebaseAuth import UserNotifications @available(iOS 13.0, *) @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. //Configure Google maps GMSServices.provideAPIKey(Constants.GMaps_API_Key) GMSPlacesClient.provideAPIKey(Constants.GMaps_API_Key) //Configure Firebase FirebaseApp.configure() //Firebase anonymous signin Auth.auth().signInAnonymously() { (authResult, error) in if error == nil { guard let user = authResult?.user else { return } ApiManager.createUser(user.uid, "ios") } } return true } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.alert, .sound]) } // MARK: UISceneSession Lifecycle func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { // Called when a new scene session is being created. // Use this method to select a configuration to create the new scene with. return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) } func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. } }