21.7 C
Canberra
Tuesday, October 21, 2025

ios – Similar Firebase Firestore guidelines work on Simulator however not on a stay database


I configure Firebase in AppDelegate utilizing adaptor like this:

@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

Then in AppDelegate:

 func software(_ software: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        FirebaseApp.configure()
       
        return true
    }

I’ve these Firestore guidelines (each regionally and within the Firebase Console):

rules_version='2'

service cloud.firestore {
  match /databases/{database}/paperwork {
    match /{doc=**} {
      enable learn, write: if true;
    }
  }
}

I fetch information like this:

db.assortment("objects").getDocuments { snapshot, error in
if let error = error {
   print("Error fetching objects: (error)")
   return
}
// deal with snapshot...

Once I use the iOS Simulator, I connect with the Firestore emulator like this:

Firestore.firestore().useEmulator(withHost: localIp, port: 8080)
let settings = Firestore.firestore().settings
settings.isSSLEnabled = false
Firestore.firestore().settings = settings

The issue is: fetching information works superb within the Simulator, however with the web database, I get the next error:

12.1.0 – [FirebaseFirestore][I-FST000001] Pay attention for question at explore_items failed: Lacking or inadequate permissions.

If I activate debug logging, I get this:

12.1.0 - [FirebaseFirestore][I-FST000001]: : {
  database: "initiatives/myproject/databases/(default)"
  add_target {
    question {
      guardian: "initiatives/myproject/databases/(default)/paperwork"
      structured_query {
        from {
          collection_id: "objects"
        }
        order_by {
          discipline {
            field_path: "__name__"
          }
          path: ASCENDING
        }
      }
    }
    target_id: 2
  }
}

and:

12.1.0 - [FirebaseFirestore][I-FST000001] response: : {
  target_change {
    target_change_type: REMOVE
    target_ids: 2
    trigger {
      code: 7
      message: "Lacking or inadequate permissions."
    }
  }
}

However that is probably not useful…

What may very well be inflicting this?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles