Matt Dyor
New Android Development


New Android Development


Starting with iOS

Matt Dyor's photo
Matt Dyor
·Mar 26, 2023·

1 min read

Play this article

To run on a physical device:

  • Connect the device

  • Turn on Developer Mode on iPhone (Settings > Privacy & Security > Developer Mode)

  • Trust the Developer App on iPhone ( Settings > General > VPN & Device Management)

  • Establish a Team in XCode (Project > Signing & Capabilities > Team)

Getting Firestore up and running

  • out dated

  • Need to drag the GoogleService-Info.plist to your project directory

  • Need to Add SDK

    • In Xcode, with your app project open, navigate to File > Add Packages

    • When prompted, enter the Firebase iOS SDK repository URL ``

    • Choose at least the Firestore packages (but not all of the packages and not the combined packages)

  • Add the following code to the App file

import SwiftUI
import FirebaseCore
import FirebaseFirestore
//import FirebaseFirestoreSwift

class AppDelegate: NSObject, UIApplicationDelegate {
  func application(_ application: UIApplication,
                   didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    return true

func addDoc(){
    let db = Firestore.firestore()
    //db.collection("Documents").addDocument(data: ["name": "ming"])
    let docRef = db.collection("Restaurants").document("hello")
    docRef.setData(["name": "Favorite Restaurant!!"]) { error in
        if let error = error {
            print("Error writing document: \(error)")
        } else {
            print("Document successfully written!")

struct FirestoreApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
    var body: some Scene {
        WindowGroup {
Share this