OMCFetchObjectBuilder Class Reference
Inherits from | NSObject |
---|---|
Declared in | OMCFetchObjectBuilder.h |
– getSyncPolicy
- Gets currently set SyncPolicy
- (OMCSyncPolicy *)getSyncPolicy
Return Value
OMCSyncPolicy object. If not set, will return default SyncPolicy.
Declared In
OMCFetchObjectBuilder.h
– setSyncPolicy:
- Sets SyncPolicy
- (void)setSyncPolicy:(OMCSyncPolicy *)syncPolicy
Parameters
syncPolicy |
will set the passed policy as current SyncPolicy |
---|
Declared In
OMCFetchObjectBuilder.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
OMCFetchObjectBuilder.h
– setRequestHeaders:
Sets extra request headers. No need to specify headers for authorization and content-type, as they will be added by default.
- (void)setRequestHeaders:(NSDictionary *)headers
Parameters
headers |
Extra request headers |
---|
Declared In
OMCFetchObjectBuilder.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:(OMCObjectSuccess _Nullable)successBlk OnError:(OMCSyncErrorBlock _Nullable)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
OMCFetchObjectBuilder.h