OMCMobileResource Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | OMCMobileResource.h |
uri
Uri of the resource
@property (nonatomic, readonly) NSString *uriDeclared In
OMCMobileResource.h
lastSyncTime
lastSyncTime of the resource
@property (nonatomic, readonly) double lastSyncTimeDeclared In
OMCMobileResource.h
pinned
Resource’s pinned status
@property (nonatomic, readonly) BOOL pinnedDeclared In
OMCMobileResource.h
hasConflicts
Resource’s conflict status
@property (nonatomic, readonly) BOOL hasConflictsDeclared In
OMCMobileResource.h
hasOfflineUpdates
Resource’s offline/local updates status
@property (nonatomic, readonly) BOOL hasOfflineUpdatesDeclared In
OMCMobileResource.h
hasOfflineCommitError
Resource’s error status after committing offline updates
@property (nonatomic, readonly) BOOL hasOfflineCommitErrorDeclared In
OMCMobileResource.h
– pinResource:
Pin the resource
- (NSError *)pinResource:(SyncPinPriority)pinPriorityParameters
pinPriority |
specifies the priority |
|---|
Return Value
NSError* if resource not found, otherwise nil.
Declared In
OMCMobileResource.h
– unpinResource
- Unpin the resource
- (NSError *)unpinResourceReturn Value
NSError* if resource not found, otherwise nil.
Declared In
OMCMobileResource.h
– currentOfflineState
- Resource’s current offline/local updated state, with specific information of which offline operation is pending, if any.
- (SyncOfflineState)currentOfflineStateReturn Value
SyncOfflineState offline state
Declared In
OMCMobileResource.h
– setRequestHeaders:
Sets extra request headers. Afterwards, you need to call reloadResource from the service or SaveResource to use these extra request headers. No need to specify headers for authorization and content-type, since they will be added by default.
- (void)setRequestHeaders:(NSDictionary *)headersParameters
headers |
Extra request headers |
|---|
Declared In
OMCMobileResource.h
– getResponseHeaders
Returns response headers which have been retrieved from the server
- (NSDictionary *)getResponseHeadersReturn Value
NSDictionary* response headers
Declared In
OMCMobileResource.h
– setSyncPolicy:
Sets Sync Policy. Afterwards you need to call reloadResource or SaveResource to use this Sync Policy.
- (void)setSyncPolicy:(OMCSyncPolicy *)policyParameters
policy |
OMCSyncPolicy object |
|---|
Declared In
OMCMobileResource.h
– getCurrentSyncPolicy
Returns currently associated Sync Policy for this resource.
- (OMCSyncPolicy *)getCurrentSyncPolicyReturn Value
policy OMCSyncPolicy object
Declared In
OMCMobileResource.h
– reloadResource:
Reloads the data that was last downloaded from the service. Any offline updates are not discarded.
- (void)reloadResource:(OMCMobileResourceSuccess _Nullable)successBlkParameters
successBlk |
callback block for success |
|---|
Declared In
OMCMobileResource.h
– reloadResource:reloadFromService:onSuccess:
Reloads the data that was last downloaded from the service. Can provide the ability to discard any offline updates for the resource or can go to the service if online to get the latest.
- (void)reloadResource:(BOOL)discardOfflineUpdates reloadFromService:(BOOL)reloadFromService onSuccess:(OMCMobileResourceSuccess _Nullable)successBlkParameters
discardOfflineUpdates |
If true will delete all offline updates from the cache. |
|---|---|
reloadFromService |
If true will reload from the service if online or from the cache if offline. |
successBlk |
callback block for success, will return the reloaded resource. |
Declared In
OMCMobileResource.h