Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Using the Refresh Sync Down Target

Many apps download records, cache all of them, and then let users edit them from the SmartStore cache when connectivity drops. Local “offline” work is quick and efficient—a great user experience—but, when connectivity resumes, it's important to refresh the cached records with server updates.

To maximize performance and efficiency, Mobile SDK provides a refresh sync down target. The refresh target supports a single call that doesn't require preparatory coding. You create an instance of the target with a soup name, an object type, and a list of fields. You then pass the target instance to a sync down method. The refresh target gathers IDs of the pertinent soup records, queries the server for the current field values, and then refreshes the soup.

Refresh Target APIs

The refresh sync down target is available on iOS and Android for native, React native, and hybrid apps.

iOS

Class:
Swift Objective-C
Factory method:
Swift
Here's an example:
Objective-C

Android

Class:
Constructor:

JavaScript (Hybrid, React Native)

Function: