LuxChat  2.0
Instant messenger for iOS
Instance Methods | Class Methods | List of all members
PFConfig Class Reference

#import <PFConfig.h>

Inheritance diagram for PFConfig:

Instance Methods

(nullable id) - objectForKey:
 
More...
 
(nullable id) - objectForKeyedSubscript:
 

Class Methods

(PFConfig *) + currentConfig
 
More...
 
(BFTask< PFConfig * > *) + getCurrentConfigInBackground
 
(BFTask< PFConfig * > *) + getConfigInBackground
 
More...
 
(void) + getConfigInBackgroundWithBlock:
 
(nullable PFConfig *) + PF_SWIFT_UNAVAILABLE
 
More...
 
(nullable PFConfig *) + getConfig:
 

Detailed Description

PFConfig is a representation of the remote configuration object. It enables you to add things like feature gating, a/b testing or simple "Message of the day".

Method Documentation

+ (PFConfig *) currentConfig



Returns the most recently fetched config.

If there was no config fetched - this method will return an empty instance of PFConfig.

Returns
Current, last fetched instance of PFConfig.
+ (nullable PFConfig *) getConfig: (NSError **)  error

Gets the PFConfig object synchronously from the server and sets an error if it occurs.

Parameters
errorPointer to an NSError that will be set if necessary.
Returns
Instance of PFConfig if the operation succeeded, otherwise nil.

Provided by category PFConfig(Synchronous).

+ (BFTask<PFConfig *> *) getConfigInBackground



Gets the PFConfig asynchronously and sets it as a result of a task.

Returns
The task, that encapsulates the work being done.
+ (void) getConfigInBackgroundWithBlock: (nullable PFConfigResultBlock)  block

Gets the PFConfig asynchronously and executes the given callback block.

Parameters
blockThe block to execute. It should have the following argument signature: ^(PFConfig *config, NSError *error).
+ (BFTask<PFConfig *> *) getCurrentConfigInBackground

Returns the task that encapsulates the most recently fetched config.

If there was no config fetched - this method will return an empty instance of PFConfig.

Returns
Task that encapsulates current, last fetched instance of PFConfig.
- (nullable id) objectForKey: (NSString *)  key



Returns the object associated with a given key.

Parameters
keyThe key for which to return the corresponding configuration value.
Returns
The value associated with key, or nil if there is no such value.
- (nullable id) objectForKeyedSubscript: (NSString *)  keyedSubscript

Returns the object associated with a given key.

This method enables usage of literal syntax on PFConfig. E.g. NSString *value = config[@"key"];

See also
- objectForKey:
Parameters
keyedSubscriptThe keyed subscript for which to return the corresponding configuration value.
Returns
The value associated with key, or nil if there is no such value.
+ (nullable PFConfig *) PF_SWIFT_UNAVAILABLE



Gets the PFConfig object synchronously from the server.

Returns
Instance of PFConfig if the operation succeeded, otherwise nil.

Provided by category PFConfig(Synchronous).


The documentation for this class was generated from the following file: