Complete the code to import the Firebase module in Swift.
import [1]
Firebase is imported using import Firebase to access its backend services.
Complete the code to initialize Firebase in the AppDelegate's didFinishLaunchingWithOptions method.
FirebaseApp.[1]()Firebase is initialized by calling FirebaseApp.configure() in the app launch method.
Fix the error in the code to save data to Firestore database.
let db = Firestore.firestore() db.collection("users").document("user1").setData([1])
Firestore expects a dictionary with keys as strings and values, so use ["name": "Alice", "age": 25].
Fill both blanks to read data from Firestore and print the user's name.
let db = Firestore.firestore() db.collection("users").document("user1").getDocument { (document, error) in if let document = document, document.exists { let data = document.[1]() print(data[[2]] as? String ?? "No name") } }
Use data() to get the document data dictionary, then access the "name" key.
Fill all three blanks to authenticate a user with email and password using Firebase Auth.
Auth.auth().[1](withEmail: [2], password: [3]) { authResult, error in if let error = error { print("Error: \(error.localizedDescription)") } else { print("User signed in") } }
Use signIn method with email and password strings to sign in a user.