If you create global stores, you’re required to perform cleanup when the app exits. Also, if you create multiple user stores, you can perform cleanup if you’re no longer using particular stores. SmartStore provides methods deleting named and global stores. For hybrid apps, SmartStore also provides functions for getting a list of named stores.
iOS Native Apps
Mobile SDK for iOS defines the following SFSmartStore methods for removing stores.
SmartStore defines the following functions for removing stores. Each function takes success and error callbacks. The removeStore() function also requires either a StoreConfig object that specifies the store name, or just the store name as a string.
Sometimes an app must remove all data in a store without logging out the current user. In this case, keep in mind that the sync manager object sets up a table to track syncs. If you delete this table, the manager can’t continue. Therefore, the recommended way to reset SmartStore to a zero-data state is as follows:
1. Drop the sync managers associated with the current user.