OMCFetchFileBuilder Class Reference

Inherits from NSObject
Declared in OMCFetchFileBuilder.h

Overview

Fetch file builder to get OMCMobileFile

– getSyncPolicy

  • Gets currently set SyncPolicy
- (OMCSyncPolicy *)getSyncPolicy

Return Value

OMCSyncPolicy object, if not set will return default SyncPolicy.

Declared In

OMCFetchFileBuilder.h

– setSyncPolicy:

  • Sets SyncPolicy
- (void)setSyncPolicy:(OMCSyncPolicy *)syncPolicy

Parameters

syncPolicy

will set the passed policy as current SyncPolicy

Declared In

OMCFetchFileBuilder.h

– setSyncPolicyFetchFromServer

Sets Fetch policy in SyncPolicy as FETCH_POLICY_FETCH_FROM_SERVICE_IF_ONLINE, other policies in SyncPolicy will remain same.

- (void)setSyncPolicyFetchFromServer

Declared In

OMCFetchFileBuilder.h

– setRequestHeaders:

Sets extra request headers. No need of Headers for authorization or content-type. They will be added by default.

- (void)setRequestHeaders:(NSDictionary *)headers

Parameters

headers

Extra request headers

Declared In

OMCFetchFileBuilder.h

– executeFetchOnSuccess:OnError:

  • Execute the Get request. Based on the set policy, it will go to the server, to the local cache, or to both.
- (void)executeFetchOnSuccess:(OMCFetchFileSuccess)successBlk OnError:(OMCSyncErrorBlock)errorBlk

Parameters

successBlk

block that will be called after the request has successfully finished with the mobile resource.

errorBlk

block that will be called after the request has finished with an error.

Declared In

OMCFetchFileBuilder.h