ioscore-datasimperium

How to populate an empty CoreData database from remote Simperium store?


I'm running the SimpletodoFinal.xcodeproj included with the Simperium samples. The sample works fine, and I can see items synced between the iOS simulator and the web app connected to Simperium's data store.

I add a few items and ensure changes are sync'd. Then I quit the iOS app and remove the app's sqlite database and start the app again. This would seem to be the use case when an existing user brings a new device online.

The problem I'm having is that the app is empty. The remote data is not synced down to populate the new database. Anyone know why this might be? Do I somehow need to trigger a manual sync on startup?

Thank you.


Solution

  • Nuking the sqlite store alone might cause issues, since Simperium also relies on a couple metadata stores to determine the current sync status.

    Please, try calling the method [simperium signOutAndRemoveLocalData:YES] instead, that is the preferred way of deleting everything.