0
0
iOS Swiftmobile~10 mins

Firebase setup for iOS in iOS Swift - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the Firebase module in your Swift file.

iOS Swift
import [1]
Drag options to blanks, or click blank then click option'
AUIKit
BSwiftUI
CFoundation
DFirebase
Attempts:
3 left
💡 Hint
Common Mistakes
Importing UIKit instead of Firebase.
Forgetting to import Firebase before using its features.
2fill in blank
medium

Complete the code to configure Firebase in the AppDelegate's didFinishLaunchingWithOptions method.

iOS Swift
FirebaseApp.[1]()
Drag options to blanks, or click blank then click option'
Ainitialize
Bconfigure
Cstart
Dsetup
Attempts:
3 left
💡 Hint
Common Mistakes
Using start() or initialize() instead of configure().
Not calling this method in didFinishLaunchingWithOptions.
3fill in blank
hard

Fix the error in the code to add the GoogleService-Info.plist file to the project correctly.

iOS Swift
In Xcode, drag the [1] file into the [2] folder in the project navigator.
Drag options to blanks, or click blank then click option'
AGoogleService-Info.plist
BAppDelegate.swift
CSupporting Files
DAssets.xcassets
Attempts:
3 left
💡 Hint
Common Mistakes
Adding the plist file to the wrong folder like Assets.xcassets.
Not adding the plist file to the project at all.
4fill in blank
hard

Fill both blanks to complete the code that initializes Firebase in the SceneDelegate.

iOS Swift
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
  guard let _ = (scene as? [1]) else { return }
  FirebaseApp.[2]()
}
Drag options to blanks, or click blank then click option'
AUIWindowScene
BUIApplication
Cconfigure
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Casting scene to UIApplication instead of UIWindowScene.
Using start() instead of configure().
5fill in blank
hard

Fill all three blanks to complete the code that imports Firebase, configures it, and prints a success message.

iOS Swift
import [1]

@main
struct MyApp: App {
  init() {
    FirebaseApp.[2]()
    print("[3]")
  }

  var body: some Scene {
    WindowGroup {
      ContentView()
    }
  }
}
Drag options to blanks, or click blank then click option'
AFirebase
Bconfigure
CFirebase configured successfully
DUIKit
Attempts:
3 left
💡 Hint
Common Mistakes
Importing UIKit instead of Firebase.
Forgetting to call configure().
Not printing a confirmation message.