SFMobileSyncSyncManager Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | SFMobileSyncSyncManager.h |
Overview
This class provides methods for doing synching records to/from the server from/to the smartstore.
Other Methods
+ sharedInstance:
Singleton method for accessing the sync manager instance for the given user. This instance uses the default store.
+ (instancetype)sharedInstance:(SFUserAccount *)userParameters
user |
User to which this manager instance’s data is scoped. |
|---|
Declared In
SFMobileSyncSyncManager.h
+ sharedInstanceForUser:storeName:
+ sharedInstanceForStore:userAccount:
+ sharedInstanceForStore:
Singleton method for accessing sync manager instance by SmartStore store.
+ (nullable instancetype)sharedInstanceForStore:(SFSmartStore *)storeParameters
store |
SmartStore instance whose sync manager is being requested. |
|---|
Declared In
SFMobileSyncSyncManager.h
+ removeSharedInstance:
Remove the shared instance associated with the given user.
+ (void)removeSharedInstance:(SFUserAccount *)userParameters
user |
User associated with the store. |
|---|
Declared In
SFMobileSyncSyncManager.h
+ removeSharedInstanceForStore:userAccount:
Remove the shared instance associated with the given store name and user.
+ (void)removeSharedInstanceForStore:(nullable NSString *)storeName userAccount:(SFUserAccount *)userAccountDeclared In
SFMobileSyncSyncManager.h
+ removeSharedInstanceForStore:
Remove the shared instance associated with the specified store.
+ (void)removeSharedInstanceForStore:(SFSmartStore *)storeParameters
store |
SmartStore instance whose sync manager is to be removed. |
|---|
Declared In
SFMobileSyncSyncManager.h
+ removeSharedInstances
Remove all shared instances.
+ (void)removeSharedInstancesDeclared In
SFMobileSyncSyncManager.h
– stop
Stop the sync manager.
It can take a while for active syncs to actually stop.
Call isStopped() to see if the sync manager is fully paused.
- (void)stopDeclared In
SFMobileSyncSyncManager.h
– restart:updateBlock:error:
Restart this sync manager.
- (BOOL)restart:(BOOL)restartStoppedSyncs updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlock error:(NSError **)errorParameters
restartStoppedSyncs |
Pass YES to restart all stopped syncs. |
|---|---|
updateBlock |
Block to be called with updates. |
error |
Reports any error (optional). |
Return Value
YES if restarted successfully.
Declared In
SFMobileSyncSyncManager.h
– checkAcceptingSyncs:
Check whether a sync manager is running.
- (BOOL)checkAcceptingSyncs:(NSError **)errorParameters
error |
Reports any error (optional). |
|---|
Return Value
YES if the sync manager is running, or NO if it’s stopping or stopped.
Declared In
SFMobileSyncSyncManager.h
– getSyncStatus:
Return status of the sync with the given sync ID.
- (nullable SFSyncState *)getSyncStatus:(NSNumber *)syncIdParameters
syncId |
Sync ID. |
|---|
Declared In
SFMobileSyncSyncManager.h
– getSyncStatusByName:
Return status of the sync with the given name.
- (nullable SFSyncState *)getSyncStatusByName:(NSString *)syncNameParameters
syncName |
Sync name. |
|---|
Declared In
SFMobileSyncSyncManager.h
– hasSyncWithName:
Return YES if a sync with the given name exists.
- (BOOL)hasSyncWithName:(NSString *)syncNameParameters
syncName |
Sync name. |
|---|
Return Value
YES a sync with the given name exists.
Declared In
SFMobileSyncSyncManager.h
– deleteSyncById:
Delete the sync with the given ID.
- (void)deleteSyncById:(NSNumber *)syncIdParameters
syncId |
Sync ID. |
|---|
Declared In
SFMobileSyncSyncManager.h
– deleteSyncByName:
Delete the sync with the given name.
- (void)deleteSyncByName:(NSString *)syncNameParameters
syncName |
Sync name. |
|---|
Declared In
SFMobileSyncSyncManager.h
– createSyncDown:options:soupName:syncName:
Create a sync down without running it.
- (SFSyncState *)createSyncDown:(SFSyncDownTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName syncName:(nullable NSString *)syncNameParameters
target |
Sync down target that will manage the sync down process. |
|---|---|
options |
Options associated with this sync down. |
soupName |
Soup name where the local entries are stored. |
syncName |
Name for this sync (optional). |
Return Value
Sync state associated with this sync down.
Declared In
SFMobileSyncSyncManager.h
– syncDownWithTarget:soupName:updateBlock:
Create and run a sync down that overwrites modified records.
- (nullable SFSyncState *)syncDownWithTarget:(SFSyncDownTarget *)target soupName:(NSString *)soupName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlockParameters
target |
Sync down target that will manage the sync down process. |
|---|---|
soupName |
Soup name where the local entries are stored. |
updateBlock |
Block to be called with updates. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– syncDownWithTarget:options:soupName:updateBlock:
Create and run a sync down.
- (nullable SFSyncState *)syncDownWithTarget:(SFSyncDownTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlockParameters
target |
Sync down target that manages the sync down process. |
|---|---|
options |
Options associated with this sync down. Use this parameter to specify how the sync should handle modified records in the store. |
soupName |
Soup name where the local entries are stored. |
updateBlock |
Block to be called with updates. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– syncDownWithTarget:options:soupName:syncName:updateBlock:error:
Create and run a named sync down.
- (nullable SFSyncState *)syncDownWithTarget:(SFSyncDownTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName syncName:(nullable NSString *)syncName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlock error:(NSError **)errorParameters
target |
Sync down target that will manage the sync down process. |
|---|---|
options |
Options associated with this sync down. Use this parameter to specify how the sync should handle modified records in the store. |
soupName |
Soup name where the local entries are stored. |
syncName |
Name for this sync. |
updateBlock |
Block to be called with updates. |
error |
Sets error if sync could not be created. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– reSync:updateBlock:error:
Perform a resync.
- (nullable SFSyncState *)reSync:(NSNumber *)syncId updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlock error:(NSError **)errorParameters
syncId |
Sync ID. |
|---|---|
updateBlock |
Block to be called with updates. |
error |
Sets error if sync could not be started. |
Return Value
Sync state associated with this sync, or nil if it could not be started.
Declared In
SFMobileSyncSyncManager.h
– reSyncByName:updateBlock:error:
Perform a resync by name.
- (nullable SFSyncState *)reSyncByName:(NSString *)syncName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlock error:(NSError **)errorParameters
syncName |
Sync name. |
|---|---|
updateBlock |
Block to be called with updates. |
error |
Sets error if sync could not be started. |
Return Value
Sync state associated with this sync, or nil if it could not be started.
Declared In
SFMobileSyncSyncManager.h
– createSyncUp:options:soupName:syncName:
Create a sync up without running it.
- (SFSyncState *)createSyncUp:(SFSyncUpTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName syncName:(nullable NSString *)syncNameParameters
target |
Sync up target that will manage the sync up process. |
|---|---|
options |
Options associated with this sync up. Use this parameter to specify how the sync should handle modified records on the server. |
soupName |
Soup name where the local entries are stored. |
syncName |
Name for this sync. |
Return Value
Sync state associated with this sync up.
Declared In
SFMobileSyncSyncManager.h
– syncUpWithOptions:soupName:updateBlock:
Create and run a sync up with the default SFSyncUpTarget.
- (nullable SFSyncState *)syncUpWithOptions:(SFSyncOptions *)options soupName:(NSString *)soupName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlockParameters
options |
Options associated with this sync up. Use this parameter to specify how the sync should handle modified records on the server. |
|---|---|
soupName |
Soup name where the local entries are stored. |
updateBlock |
Block to be called with updates. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– syncUpWithTarget:options:soupName:updateBlock:
Create and run a sync up with the configured SFSyncUpTarget.
- (nullable SFSyncState *)syncUpWithTarget:(SFSyncUpTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlockParameters
target |
Sync up target that will manage the sync up process. |
|---|---|
options |
Options associated with this sync up. Use this parameter to specify how the sync should handle modified records on the server. |
soupName |
Soup name where the local entries are stored. |
updateBlock |
Block to be called with updates. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– syncUpWithTarget:options:soupName:syncName:updateBlock:error:
Create and run a named sync up.
- (nullable SFSyncState *)syncUpWithTarget:(SFSyncUpTarget *)target options:(SFSyncOptions *)options soupName:(NSString *)soupName syncName:(nullable NSString *)syncName updateBlock:(SFSyncSyncManagerUpdateBlock)updateBlock error:(NSError **)errorParameters
target |
Sync up target that will manage the sync up process. |
|---|---|
options |
Options associated with this sync up. Use this parameter to specify how the sync should handle modified records on the server. |
soupName |
Soup name where the local entries are stored. |
syncName |
Name for this sync. |
updateBlock |
Block to be called with updates. |
error |
Sets error if sync could not be created. |
Return Value
Sync state associated with this sync, or nil if it could not be created.
Declared In
SFMobileSyncSyncManager.h
– cleanResyncGhosts:completionStatusBlock:error:
Remove local copies of records that have been deleted on the server or do not match the query results on the server anymore.
- (BOOL)cleanResyncGhosts:(NSNumber *)syncId completionStatusBlock:(SFSyncSyncManagerCompletionStatusBlock)completionStatusBlock error:(NSError **)errorParameters
syncId |
Sync ID. |
|---|---|
completionStatusBlock |
Completion status block. |
error |
Sets error if clean operation could not be started. |
Return Value
YES if cleanResyncGhosts started successfully.
Declared In
SFMobileSyncSyncManager.h
– cleanResyncGhostsByName:completionStatusBlock:error:
Remove local copies of records that have been deleted on the server or do not match the query results on the server anymore.
- (BOOL)cleanResyncGhostsByName:(NSString *)syncName completionStatusBlock:(SFSyncSyncManagerCompletionStatusBlock)completionStatusBlock error:(NSError **)errorParameters
syncName |
Sync Name. |
|---|---|
completionStatusBlock |
Completion status block. |
error |
Sets error if clean operation could not be started. |
Return Value
YES if cleanResyncGhosts started successfully.
Declared In
SFMobileSyncSyncManager.h