Start a new topic

Angularjs Sync/cache issue

Im using kinvey with Angularjs for a cordova project. Both my android test devices(Samsung S4 and Samsung Note 8) run android version 4.2.2 as well as the emulator. The issue I'm experiencing is that the Sync sync : `{enable : true, online: false}` does not work on the physical devices but works fine on the browser and emulator while testing. The App is not really an offline app but I do want to take advantage of the caching functionality which works great with the sync options above but only in the browser(Safari and Chrome). First are my sync options correct because with `{enable : true, online: true}` the app always goes online and never fetches from the cache, this is the case even on the browser while testing. Am I missing something or is my setup wrong? what solution options can I explore? the docs say if sync is enabled the app is assumed to be online by default which in my case is correct and data will be cached and pulled from the cache if available otherwise its pulled from online but this is not the case, the app always goes online. Thank you in advance your responses.

By default, the app will go online for every call, *except* when you have no network connection. You can try manually disconnecting your device from the network, and see what happens.

Or, you can specify the offline flag explicitly to see if data is pulled from cache (note, in order to have data available offline, at least one call to Kinvey must have completed successfully):


Kinvey.DataStore.find('collection-name', null, { offline: true });

Thank you for the suggestion, I will give it a try and let you know how it goes.
I am also still having a problem with Angular / Android / Sync enabled (those three in combination). Not sure if related - could be - could not be!

Not had time to fully work it out but I am sure there is something amiss somewhere (works fine on IOS with sync enabled, and fine on Android when sync is disabled)

If you get it working, please come back and say!

Take a look at I think that may have the answer (if you are struggling with the same thing, which I think you are)
Thanks @"A B"‌ this fixed it. leaving you another thank you incase someone lands here with the same problem.
Login or Signup to post a comment