PNClientState Class Reference
Inherits from | NSObject |
---|---|
Declared in | PNClientState.h |
Overview
When client use \b state API which allow to pull and push client state, this manager stores all information locally. Locally cached data used by \b PubNub subscriber and presence modules to deliver actual cient state information to \b PubNub network.
@author Sergey Mamontov
Initialization and Configuration
Information
– state
Retrieve state information stored in cache.
- (NSDictionary *)state
Return Value
Cached dictionary which store reference between remote data object names and values bound for client. \c nil will be returned in case if state cache is empty.
Availability
4.0
Discussion
State cache updated every time when client successfully subscribe on remote data object feeds with pre-defined state or modify state using corresponding API group.
Declared In
PNClientState.h
– stateMergedWith:forObjects:
Provide merged client state using new \c state information which should be bound to remote data \c object.
- (NSDictionary *)stateMergedWith:(NSDictionary *)state forObjects:(NSArray *)objects
Parameters
state |
State which should be merged into client state stored in cache. |
---|---|
objects |
List of object names for which merged data is composed. In case if merged state will have names of objects not presented in \c objects their data will be removed. |
Availability
4.0
Declared In
PNClientState.h
– setState:forObject:
- (void)setState:(NSDictionary *)state forObject:(NSString *)object
Parameters
state |
State which should replace cached information. |
---|---|
object |
Name of the object for which new data should be applied. |
Availability
4.0
Declared In
PNClientState.h
Extension Methods
client
Weak reference on client for which state cache manager created.
@property (nonatomic, weak) PubNub *client
Availability
4.0
Declared In
PNClientState.m