ParseClientConfiguration

Objective-C

@interface ParseClientConfiguration : NSObject <NSCopying>

Swift

class ParseClientConfiguration : NSObject, NSCopying

The ParseClientConfiguration represents the local configuration of the SDK to connect to the server with.

These configurations can be stored, copied, and compared, but cannot be safely changed once the SDK is initialized.

Use this object to construct a configuration for the SDK in your application, and pass it to Parse.+initializeWithConfiguration:.

Connecting to Parse

  • The Parse.com application id to configure the SDK with.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *applicationId;

    Swift

    var applicationId: String? { get }
  • The Parse.com client key to configure the SDK with.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *clientKey;

    Swift

    var clientKey: String? { get }
  • The URL of the server that is being used by the SDK. Defaults to https://api.parse.com/1

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull server;

    Swift

    var server: String { get }
  • The custom upload controller that synchronously uploads PFFiles using its own policy.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) id<PFFileUploadController> fileUploadController;

Enabling Local Datastore

  • Whether or not to enable pinning in the SDK.

    The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readonly,
              getter=isLocalDatastoreEnabled) BOOL localDatastoreEnabled;

    Swift

    var isLocalDatastoreEnabled: Bool { get }

Enabling Extensions Data Sharing

  • When set, enables data sharing with an application group identifier.

    After enabling - Local Datastore, PFUser.+currentUser, PFInstallation.+currentInstallation and all eventually commands are going to be available to every application/extension in a group that have the same Parse applicationId.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *applicationGroupIdentifier;

    Swift

    var applicationGroupIdentifier: String? { get }
  • When set, controls the bundle identifier of the parent bundle to connect to.

    Warning

    This property should only be set from inside an extension environment.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *containingApplicationBundleIdentifier;

    Swift

    var containingApplicationBundleIdentifier: String? { get }

Network Properties

  • The NSURLSessionConfiguration configuration used by the SDK.

    The default value is NSURLSessionConfiguration.defaultSessionConfiguration

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSURLSessionConfiguration *_Nonnull URLSessionConfiguration;

    Swift

    var urlSessionConfiguration: URLSessionConfiguration { get }
  • The maximum number of retry attempts to make upon a failed network request.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger networkRetryAttempts;

    Swift

    var networkRetryAttempts: UInt { get }

Creating a Configuration

  • Create a new SDK configuration object. This will create a temporarily modifiable configuration, and pass it to a block to be initialized.

    Example usage:

    [ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
        configuration.applicationId = ...;
        configuration.clientKey = ...;
        configuration.localDatastoreEnabled = ...;
    }];
    

    Declaration

    Objective-C

    + (nonnull instancetype)configurationWithBlock:
        (nonnull void (^)(id<ParseMutableClientConfiguration> _Nonnull))
            configurationBlock;

    Swift

    convenience init(block configurationBlock: @escaping (ParseMutableClientConfiguration) -> Void)

    Parameters

    configurationBlock

    A block used to modify the created configuration.

    Return Value

    A newly created configuration.