How can we help you today?

Could not save with dataStore.save

K

Kelvin

started a topic
6 months ago

Hi.

I've written an app with Kinvey several years ago, and I wished to make some upgrades. However, I found that the coding had changed recently, so I'm trying to adapt my app into the new versions of Kinvey libraries.

The major problem is that I couldn't upload entities into my Kinvey database with the dataStore.save(Entity, KinveyClientCallback) method. It would run to onSuccess. I have checked that the values in my entity was correct. It seemed that it worked without an error, but my collection was still empty no matter how I tried.

I have implemented your use case in my environment with some additional code, and Its working.

As mention in the provided screenshot you are using StoreType.SYNC -

Configuring your datastore as a Sync datastore allows you to pull a copy of your data to the device and work with it completely offline. The library provides APIs to synchronize local data with the backend. This type of datastore is ideal for apps that need to work for long periods without a network connection.

Means your save operation was completed locally but not pushed to the backend.

Prabhatt Tiwari

I am looking into this now, I will get back to you with questions and suggestions shortly.

Regards,

Prabhat T.

P

Prabhatt Tiwari

said
6 months ago

Answer

Hi Kelvin,

I have implemented your use case in my environment with some additional code, and Its working.

As mention in the provided screenshot you are using StoreType.SYNC -

Configuring your datastore as a Sync datastore allows you to pull a copy of your data to the device and work with it completely offline. The library provides APIs to synchronize local data with the backend. This type of datastore is ideal for apps that need to work for long periods without a network connection.

Means your save operation was completed locally but not pushed to the backend.

If SYNC is not your requirement , you can use StoreType.NETWORK Instead.

Let me know if it helps.

Regards,

Prabhat T.

K

Kelvin

said
6 months ago

Hi Prabhat T.,
Thanks very much for your time and assistance.
Sorry that I didn't have time to reply in weekdays.
This should be the main reason that my code wasn't working. I'll get more understanding into it. Thank you for pointing out the problem.
Best regards,
Kelvin