Hello! I am one step away from launching my first app! I need to implement a method for users to block one another within my app. I think I can make this possible by configuring Firebase Firestore Database rules. As of now I have a method for users to add the user_id of the user they want to block to an array, but I need make it so they now can’t see content from that user.
**
** Main question*
How can I reference my Firestore Database data within the Rules of my database… I have looked everywhere and watched a lot of YouTube
I’m trying to allow users to block one another through Read conditions.
**
Few hours ago I had the same error during taking my first steps with Firebase. I had no idea how to find solution but after few hours of debugging I noticed that the problem occurs when I had initialized project with Firebase using dependency manager built-in in the Xcode and then I tried to initialize Firestore using CocoaPods. To be more specific, first thing I do was Firebase installation using this one:
$ pod init
$ vim Podfile // adding 'firebase/firestore' dependency or specific line from https://github.com/firebase/firebase-ios-sdk
$ pod install
$ open <ProjectName>.xcworkspace
In the next step, I tried to check basic Firestore operations like creating collection and documents with data and when I run the app - I got similar error. It was an exception during app run.
I think in my case the problematic thing was possible duplicates because of supplying the project with a Firebase (with all dependencies) twice.
So, I removed dependency installed from the Xcode manager. In my Info.plist there is no dependencies:
Exactly. That is why I shared this information and described the problem for other people who could make the same mistake in the future
When I followed your video I decided to do an initial step on my own, based on instruction provided by Firebase. After that, when I noticed a difference, I decided to do it in the same way as is presented in the CWC tutorial. That is why I had two versions installed from different places.
One difference in Firebase between current version and the version from the end of 2020 (when the CWC video was recorded) is presented underneath:
Current version (screen from the official documentation):