In Realm Browser and in my App I can watch how rows get deleted, modified and created when I log in with a Sync User, like it is getting synced slowly, when I login my app I would like to know when this sync ends, or better, get only the latest data at once and not the whole history of it.
I don't know if is a setting in Realm Object Server (Ubuntu) or in my App (iOS Swift)
Realm Mobile Platform syncs your data automatically in background, it allows you to work with the Realm url the same way you work with the local one.
So you can just use any type of Notifications to handle any data changes.
Related
I came across a wonderful feature of Firebase offline feature. I integrated that in my app just by writing one line of code in my main.dart file after initializing Firebase await FirebaseDatabase.instance.setPersistenceEnabled(true);
Question 1 :
I couldn't able to understand the database.keepSynced(true) function because without using this line of code, my app is persisting old as well as fetching new updated data, so what this exactly does ?
Question 2 :
How could I prevent the write operations when a user is offline, because I read that after setting persistence enabled, it makes a queues of write operations and update them when user gets online, so how could I stop this ?
Question 3 :
Is this persistence feature going to work in IOS device as well or need some permission settings first ?
Thanks
When you call FirebaseDatabase.instance.setPersistenceEnabled(true) you're allowing Firebase to create a local file on the device where it persists any data it's recently read, and all writes that are pending while the device is offline.
When you call keepSynced(true) on a node, you are telling the SDK to always keep that node synchronized. It essentially creates a onValue listener on the node without any handler code, so you're purely doing this to keep the data synchronized for when the device does go offline.
By combining keepSynced(true) with setPersistenceEnabled(true), you're specifying that you want the app to continue working when it's offline across restarts, and which data is needed for that.
If you call keepSynced(true) on the root of your database, you're telling the SDK to synchronize all data in the database to the disk cache. While this may initially be a quick way to get offline mode for your app working, it typically won't scale when you more people start using your app.
If you only want to allow write operations while the client has a connection to the database backend, you can register a local listener to the .info/connected node, which is a true value when there is a connection and false otherwise.
Note that Firebase doesn't require this, as it queues the pending writes and executes them when the connection is restored. In general, I'd recommend working with the system here instead of against it, and also trying to make your app work gracefully in the offline scenario. In many cases there is no need to disable functionality while the app is offline.
Offline disk persistence is available on Android and iOS, but not on web.
I have no code but only a special question regarding Cloud Firestorage by Google.
Im using currently a listener for my Firestorage within my react-native-app which I also use expo for.
I know that as long as I stay in the app and tab out of the window, all data downloaded by the listener is getting stored in a temporary cache so when I come back to the screen with the listener, the listener doesnt need to download all data again but rather the missing sample.
My question would be: Does this also apply if I close the app entirely, for example for multiple days so that my token for authentification expires and I need to log myself in again into the app or rather into my Firebase?
(I want to prevent downloading all data the listener points to only because I restarted the app.)
As explained here the firestore persistance for the web is disk persistance so it survies App and devices restarts. Multiple days should also be fine.
I have a Web App tha is using firestore and very heavily offline capabilities. We never had issues with that.
I am using OneSignal in my Flutter application to receive notifications. I have created my own table within Flutter to save notifications but I cannot save messages that have been sent whilst the app has been terminated. However, I have found that the OneSignal package has it's own database installed on the device which captures everything no matter what state the application is in! So, to avoid duplicating data I want to use this database instead. It is located outside of the flutter app folder which is my issue (see image below).
How do I access this database? Does anybody know if it is the same on iOS (I haven't been able to check at this time).
Many thanks.
It's important to understand that if an app has been terminated, any onReceived handler will not be fired. We don't recommend using the local db at all. Your best bet is to use the respective notification extender services for each platform. Though you will have to write native code for this! Cheers
Edit:
ANDROID - NotificationExtenderService - This can be setup to receive silent notifications when your app is not running or to override how notifications are shown in the notification shade. See the Background Data and Notification Overriding section to set this up.
I'm thinking moving an Android app's persistent data to Firebase Database. Currently I use Sqlite with a Python HTTP REST service.
In the app, I have a big list of cities, called citiesList. Since the list is quite big and hardly updated, I don't want the app fetch the list whenever it goes online.
My current strategy is provide a citiesListVersion. When the app goes online, it checks citiesListVersion. If the server's citiesListVersion is newer, the app will fetch citiesList from server. Otherwise, the app continues working with the cached data.
My question is: can I keep my current strategy when moving to Firebase Database? As I understand, Firebase tries to sync data whenever the app goes online.
I am trying to test the Trigger.io reload function on my app, and have created a new stream but there are no active users for any of these channels.
Does code need to be added in the app to subscribe users to the reload streams?
Currently there is a 15 minute delay in the reported user numbers.
However, if you have just installed a version of your app on a test device or run it in the emulator, you will be able to Reload it immediately even if the number of users showing up against the stream is still 0.
You do need to use the forge.reload.switchStream method in the app to put the user in the right stream. Or you can use the 'default' stream that is already there to reload all users without needing to add any extra code in your app.