Whenever I enter the CloudKit and check the logs in the development database I can see NO EVENTS at all. Neither in history or live events.
Although I can see on telemetrics that records have been created, modified, deleted and even some conflicts have occurred.
Do I have to enable something actively to send logs? or they should be showing up by default?
Thank you very much.
Related
I had an email to say that my Firebase database would be de-activated in 14 days unless it receives traffic or I update my security rules. When I login to my Firebase account I don't see any options to maintain my database. The only option I get when I select the "Realtime Database" menu item is "Create Database".
How can I see and maintain an existing database?
firebaser here
This message is sent to owners of databases that:
Have world readable security rules AND
Have not received any traffic in 6 months.
As the message says: to prevent the database from being deactivated you can:
Either change its security rules,
Or for it to start receiving traffic.
Note: your data will not be deleted either way.
I actually quickly checked one of my own projects that got disabled, and I see this in the console:
Clicking the Re-enable buttons seems to have reenabled the database without either of the two actions mentioned in the email. But I do expect the database to be disabled again, based on my lack of addressing the root cause.
If you're not seeing this same screen for your project, I'd:
Reload the Firebase console, and navigate to the database from there.
If that still doesn't show you the same screen, reach out to Firebase support for personalized help in troubleshooting.
But realtime traffic users are still appearing and latest release shows that users are adopting the new version, so clearly it's still reporting correctly? But all of the data dropped to 0 overnight. Any ideas?
I'm currently building an app that allows user to share events and check in their guests simultaneously using multiple phones. I managed to set up CKQuerySubscription and update, delete and create works fine but only on the primary phone (the one sharing the event).
I recently found out that for a non-primary user to get notifications, it has to get notifications from CKDatabaseNotification which i set up and it works as I am getting remote notifications when I make changes through CloudKit Dashboard.
But the notification i get (CKDatabaseNotification) does not come with anything that would allow me to find what records changed. I've tried casting it as CKNotification as suggested on this link but as expected it fails.
I have a custom zone set up and my questions are as below:
How do I get any information about what changed from a CKDatabaseNotification?
Am I even doing that the right way? I've read somewhere else as well that some people managed to set up subscription through CKQuerySubscription on a shared database as long as it is on a custom zone, which I have but my codes told me subscription failed.
The CKDatabaseNotification will only tell you that something has changed, not what it is. The recommended path forward is you use a CKFetchDatabaseChangesOperation to find out what record zones have changes. Then you use the record zone IDs from that operation in a CKFetchRecordZoneChangesOperation to get all the changes.
There's a bit more information in the CloudKit Quick Start Guide
I'm cherry picking some relevant info below:
After app launch or the receipt of a push, your app uses CKFetchDatabaseChangesOperation and then CKFetchRecordZoneChangesOperation to ask the server for only the changes since the last time it updated.
The key to these operations is the previousServerChangeToken object,
which tells the server when your app last spoke to the server,
allowing the server to return only the items that were changed since
that time.
First your app will use a CKFetchDatabaseChangesOperation to find out
which zones have changed
Then
Next your app uses a CKFetchRecordZoneChangesOperation object with the
set of zone IDs you just collected to do the following:
• Create and update any changed records
• Delete any records that no longer exist
• Update the zone change tokens
The WWDC video CloudKit Best Practices addresses this topic as well.
For Example, I have pull replication running, which is syncing documents of user login, but whenever user entering the username and logging in, the document of the particular user is not yet synced and it is showing no user found. So how to overcome this. Please help me out.
Thanks in advance!
To find out whether all the documents are synced or not one need to start the sync in one shot mode.
In this continuous is set to false for pull replication. Push is always in continuous mode. So when the sync is started in one shot then when the replication status changes to Stopped then it means either the sync have finished or there is an error while syncing data.
In case of an error haserror() function can be used to find out if the error is there or not. If there is an error then one need to restart one shot replication else the replication can be put in continuous mode and app can be used. Do note only one shot will have a status as Stopped
following is the link where it is stated :-
https://developer.couchbase.com/documentation/mobile/1.4/guides/couchbase-lite/native-api/replication/index.html
On firebases documentation it says:
Even with persistence enabled, transactions are not persisted across
app restarts. So you cannot rely on transactions done offline being
committed to your Firebase Realtime Database. To provide the best user
experience, your app should show that a transaction has not been saved
into your Firebase Realtime Database yet, or make sure your app
remembers them manually and executes them again after an app restart.
https://firebase.google.com/docs/database/ios/offline-capabilities
Yet I went into my App with an iphone 6 simulator, while offline, changed some data, then switched to iphone 7 simulator to make sure 6 simulator stopped, and then went back to the 6 simulator with my internet connection now turned on, and the change I had previously made while offline synced no problem.
What problem does this documentation point to that I need to take into account. I can't afford to make something where users are frustrated with changes they thought saved getting lost, but to my eyes there is no issue?
I think the key word there is "Transactions" which are a very specific kind of write operation. (See description here).
If you're just doing a regular ol' write to the database and not sticking it inside a transaction block, your write should be saved, even across an app restart.