Can Firebase Storage rules validate against Realtime Database data? - firebase-realtime-database

I've seen from this post (https://firebase.blog/posts/2022/09/announcing-cross-service-security-rules) that you can validate Storage rules against Firestore data, however, I can't find any information if you can do it for Realtime Database.

Riiight at the bottom of the post, the last paragraph says:
So there you have it. That’s our shiny new feature. Try it out and let
us know what you think. For the next milestone, we plan to support
cross-service rules queries to the Realtime database! Stay tuned!
So.. not yet :)

Related

What type of database should I use in diary app in ios?

It is also the first time to develop,
I want to make a diary app, but I don't know which database to use because I don't have basic knowledge of the database.
When I click on the calendar, I would like to post on that date
And I also need a picture that needs to be imported.
I can look for it even if I post this. I think it would be the fastest to ask. Thank you for reading my POST and hope everyone who reads has a nice day
Quick Answer: I would recommend persisting data on the users device instead of a cloud based database by using Core Data for the following reasons:
The content may be private or sensitive in nature, keeping it on the device is safer
Media attachments can become costly at scale, saving to device removes that burden from the developer
some cons of this route include the following:
Potential loss of Analytics by not using a cloud database such as Google Firebase
Cloud storage can be backed up in case the user loses their device (assuming they are not backed up via iCloud)
For a more thorough answer I recommend you provide more in terms of your objectives and audience.

Local Cache of CloudKit Records

There's a chapter called Maintaining Local Cache of CloudKit Records in CloudKit documentation on Apple's web site. However, everywhere online people say it's close to impossible to store offline data with CloudKit. I'm relatively new iOS developer. Did anybody tried implementing offline data storage (on device) as per Apple's docs?
If you want true, offline-first data for your app, then yes, you need to add a database of some kind.
Every time you update a record, save it to your database and push the updated record to CloudKit. You can also subscribe to CloudKit changes and update your local database as record changes come in.
Core Data and SQLite are common options. I happen to use the Realm database, which I consider to be a bit simpler to use than Core Data or SQLite. I set it up so that my app's UI only interacts with the offline data in the database (so that it's always available). CloudKit and my Realm database work together to keep the data up-to-date, but my UI never tries to rely on the presence of transitory CloudKit records.
I hope that helps.

Use case for offline data storage keeping in sync with Parse backend

I am currently working on Parse integration for one of my iOS applications where in I need to pull some records (Customer Feedback from existing table) from Parse and show them in mob-app.With Parse iOS SDK 1.6.1 I realized that I could also use LocalDataStore to provide include the offline support, however going through the following articles appCoda , raywenderlich and Parse documents I could not figure out a solution which could solve the use case I am dealing with.
Step 1: Show all records pulling from server (Initially Sync - but I also realized that I need to enable [Parse enableLocalDatastore]; which is now interfering with initial data pull )
Step 2: Allow user to perform certain modification and sync this data back with server.
Step 3:Keep the local data store in sync with online data all the time (provided I have internet as and when needed).
I was able to implement the ALL-ONLINE version of the app and achieve all features as needed but I would also like to include the Offline support. A few question that raises doubt are
does LocalDataStore only support offline usage of the application that
has to be manually synced with Parse backend ?
The data fetch from Parse localDataStore via [query fromLocalDatastore]; doesn't return anything on first call (I know because there isn't anything on device). Do I need to write the logic to pull down data from backend every time and keep local datastore in sync ?)
Can someone correct me if I am using it the wrong way? or give me some pointers for correct usage, then it will be really helpful.
Yes, you have to query the data online first(without "[query fromLocalDatastore];"). And "pin' it for local usage.
Usefull hint can be to use "UpdatedAt" to get only the new stuff.
Once done, you can get data online and offline. The sync should be automatic.
'Red flag' : Don't forget to update to sdk 1.6.2, as they solve a lot of big bugs related to LocalDataStore.

iOS backend service manual data storage

I've searched about best iPhone backend services and best recommended are parse.com, stackmob... But what I'm interested is which one is best for storing own data by hand and then using that data for iOS ?
As I read the docs on all of these sites they are always refering to saving games data or any other data from the iPhone to the backend. But I would like to store my own data manually (so on www.parse.com website for example) on that backend and then use it/retrieve it on iPhone. Is that good aproach? Are those backends even used for those kind of stuff or should I create my own database for that?
If they are used, which one is the best? From all the recommendations and reviews looks like parse.com is prolly the best one.
Thanks.
Hmm, manually typing into Parse.com could be tedious although it is allowed with a clean UI. I suggest you put all your data in an Excel sheet, write an Excel formula to generate CURL commands and run the CURL command in a terminal that would save the data to your Parse.com account.
https://www.parse.com/docs/rest#objects-creating
EDIT
This question is old and parse.com is dead but there are many more options now.
Firebase
Use Swift Vapor/Perfect to create your own backend on AWS
Parse.com is good you can update data manually in parse.com table.
steps create parse.com account-> create your app -> click on the dashboard-> left side click to add class analogous to table-> add rows in your class manually or through API->fill data in columns.
Best part you don't have to pay till you generate enough traffic. so if your app is not a success you save on back-end development.
If on a later date you want higher capacity you can upgrade or you can export your database and port it to your own server.

How do I perform Core Data Migration to an existing app, if all I'm changing is the SQL Db's content?

I've checked a lot of sites and answers and I can't find any solutions specific to my problem.
I don't need to change the schema for my Core data model, all I need is to modify (add some) content to the current backing SQL Database.
Any direction on this will be welcome. Thanks.
PS: I tried Apple docs and they were about as useful to me as sunshine on Mecury.
Also go easy please, I'm a beginner.
Thanks.
UPDATE;
To shed more light on my issue, my app works as thus. I have preloaded static information on the app that can't be changed by the user, each day has new content. Every month, I push an update with entirely new content specific to that month. However, when my app entered production, upon the update I pushed for this month, my users were complaining that they couldn't access the month's data. This led to me spamming them with Push notifications to have them delete the app and do a fresh install to access the new data.
How can I fix this issue? my schema stays the same, only the data changes.
If I understand correctly you want to pre-fill a Core Data database ?
If you don't care about pre-existing data on existing app, you can make an iPhone or Mac app with the same model, and let it generate the database, like explain here (Any way to pre populate core data?) it's also the way recommended in a really great book if you want to learn more about Core Data (http://pragprog.com/book/mzcd2/core-data).
Do not ever make SQL request directly, Core Data work in his own magic way.
Don't work on the SQLite-Database directly. Change all your Data through NSManagedObjectContext! To find a good strategy look up examples from Batch-Importing.
Update: You could actually have two PersistentStores (one with just static data (readonly) and the other one with user-generated data). You could interchange the readonly which you prefilled with a commandline util and downloaded from a server. You cannot have direct relationships between those two store though.
I would say that it depends on the amount of data in this prefilled store wether you should go this way or just use a plist and reference some string constants in your user data store. Try to do it with a plist as this is the simpler approach.

Resources