PFConfig

@interface PFConfig : NSObject

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.

  • Returns the most recently fetched config.

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

    Declaration

    Objective-C

    + (nonnull PFConfig *)currentConfig;

    Return Value

    Current, last fetched instance of PFConfig.

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

    Declaration

    Objective-C

    + (id)getConfigInBackground;

    Return Value

    The task, that encapsulates the work being done.

  • Gets the PFConfig asynchronously and executes the given callback block.

    Declaration

    Objective-C

    + (void)getConfigInBackgroundWithBlock:(nullable PFConfigResultBlock)block;

    Parameters

    block

    The block to execute. It should have the following argument signature: ^(PFConfig *config, NSError *error).

  • Returns the object associated with a given key.

    Declaration

    Objective-C

    - (nullable id)objectForKey:(nonnull NSString *)key;

    Parameters

    key

    The key for which to return the corresponding configuration value.

    Return Value

    The value associated with key, or nil if there is no such value.

  • Returns the object associated with a given key.

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

    See

    objectForKey:

    Declaration

    Objective-C

    - (nullable id)objectForKeyedSubscript:(nonnull NSString *)keyedSubscript;

    Parameters

    keyedSubscript

    The keyed subscript for which to return the corresponding configuration value.

    Return Value

    The value associated with key, or nil if there is no such value.