Invoking the Sync Down Method with a Custom Target

iOS: 

Pass an instance of your custom SFSyncDownTarget class to the SFMobileSyncSyncManager sync down method:

Swift

1func syncDown(target: SyncDownTarget,
2            soupName: String,
3            onUpdate: ()) -> SyncState
Objective-C

1- (SFSyncState*)
2    syncDownWithTarget:(SFSyncDownTarget*)target
3              soupName:(NSString*)soupName
4           updateBlock:
5              (SFSyncSyncManagerUpdateBlock)updateBlock;
Android:

Pass an instance of your custom SyncDownTarget class to the SyncManager sync down method:

1SyncState syncDown(SyncDownTarget target, SyncOptions options, String soupName, SyncUpdateCallback callback);

Hybrid: 

 

  1. Create a target object with the following property settings:
    • Set type to "custom".
    • Set at least one of the following properties:
      iOS (if supported):

      Set iOSImpl to the name of your iOS custom class.

      Android (if supported):

      Set androidImpl to the package-qualified name of your Android custom class.

    The following example supports both iOS and Android:
    1var target =
    2{type:"custom",
    3 androidImpl:
    4 "com.salesforce.samples.notesync.ContentSoqlSyncDownTarget",
    5 iOSImpl:"SFContentSoqlSyncDownTarget",
    6
    7};
  2. Pass this target to the hybrid sync down method:
    1cordova.require("com.salesforce.plugin.MobileSync").syncDown(target, …);

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.