Each Firebase project includes only one JSON tree for data. Best practices dictate that tests should be run on a separate database from production data. What is the simplest way to achieve this?
Some things I considered:
GoogleService-Info.plist
files in Xcode and switch between them based on my app's Configuration.The best way to prevent duplicate nodes in firebase realtime database or duplicate documents in firebase firestore database is to keep a check in the app itself to verify that the record to be inserted doesn't already exist in the database by querying for data using key field in where clause.
We have a lot of large customers who use Firebase in production. The main metric to be aware of are the concurrent users. Basically, how many devices are connected to the app at the same time.
We can filter data in one of three ways: by child key, by key, or by value. A query starts with one of these parameters, and then must be combined with one or more of the following parameters: startAt , endAt , limitToFirst , limitToLast , or equalTo .
Create multiple Firebase projects. Each project has its own plist file.
FIRApp
has a custom configuration option. Download the plist for your testing/debug project, rename it and load like below.
#if DEBUG NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-dev" ofType:@"plist"]; FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; [FIRApp configureWithOptions:options]; #else [FIRApp configure]; #endif
A more detailed explanation can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With