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?