AWSCognitoSync Class Reference

Inherits from AWSService : NSObject
Declared in AWSCognitoSyncService.h
AWSCognitoSyncService.m

Overview

Amazon Cognito Sync

Amazon Cognito Sync provides an AWS service and client library that enable cross-device syncing of application-related user data. High-level client libraries are available for both iOS and Android. You can use these libraries to persist data locally so that it’s available even if the device is offline. Developer credentials don’t need to be stored on the mobile device to access the service. You can use Amazon Cognito to obtain a normalized user ID and credentials. User data is persisted in a dataset that can store up to 1 MB of key-value pairs, and you can have up to 20 datasets per user identity.

With Amazon Cognito Sync, the data stored for each identity is accessible only to credentials assigned to that identity. In order to use the Cognito Sync service, you need to make API calls using credentials retrieved with Amazon Cognito Identity service.

If you want to use Cognito Sync in an Android or iOS application, you will probably want to make API calls via the AWS Mobile SDK. To learn more, see the Developer Guide for Android and the Developer Guide for iOS.

  configuration

The service configuration used to instantiate this service client.

@property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration

Discussion

Warning: Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSCognitoSyncService.h

+ defaultCognitoSync

Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

+ (instancetype)defaultCognitoSync

Return Value

The default service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
    AWSServiceManager.default().defaultServiceConfiguration = configuration

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                      identityPoolId:@"YourIdentityPoolId"];
      AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                           credentialsProvider:credentialsProvider];
      [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

      return YES;
  }

Then call the following to get the default service client:

Swift

 let CognitoSync = AWSCognitoSync.default()

Objective-C

 AWSCognitoSync *CognitoSync = [AWSCognitoSync defaultCognitoSync];

Declared In

AWSCognitoSyncService.h

+ registerCognitoSyncWithConfiguration:forKey:

Creates a service client with the given service configuration and registers it for the key.

+ (void)registerCognitoSyncWithConfiguration:(AWSServiceConfiguration *)configuration forKey:(NSString *)key

Parameters

configuration

A service configuration object.

key

A string to identify the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSCognitoSync.register(with: configuration!, forKey: "USWest2CognitoSync")

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                     identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSCognitoSync registerCognitoSyncWithConfiguration:configuration forKey:@"USWest2CognitoSync"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let CognitoSync = AWSCognitoSync(forKey: "USWest2CognitoSync")

Objective-C

 AWSCognitoSync *CognitoSync = [AWSCognitoSync CognitoSyncForKey:@"USWest2CognitoSync"];

Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSCognitoSyncService.h

+ CognitoSyncForKey:

Retrieves the service client associated with the key. You need to call + registerCognitoSyncWithConfiguration:forKey: before invoking this method.

+ (instancetype)CognitoSyncForKey:(NSString *)key

Parameters

key

A string to identify the service client.

Return Value

An instance of the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSCognitoSync.register(with: configuration!, forKey: "USWest2CognitoSync")

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                     identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSCognitoSync registerCognitoSyncWithConfiguration:configuration forKey:@"USWest2CognitoSync"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let CognitoSync = AWSCognitoSync(forKey: "USWest2CognitoSync")

Objective-C

 AWSCognitoSync *CognitoSync = [AWSCognitoSync CognitoSyncForKey:@"USWest2CognitoSync"];

Declared In

AWSCognitoSyncService.h

+ removeCognitoSyncForKey:

Removes the service client associated with the key and release it.

+ (void)removeCognitoSyncForKey:(NSString *)key

Parameters

key

A string to identify the service client.

Discussion

Warning: Before calling this method, make sure no method is running on this client.

Declared In

AWSCognitoSyncService.h

– bulkPublish:

Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream. Customers are limited to one successful bulk publish per 24 hours. Bulk publish is an asynchronous request, customers can see the status of the request via the GetBulkPublishDetails operation.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncBulkPublishResponse*> *)bulkPublish:(AWSCognitoSyncBulkPublishRequest *)request

Parameters

request

A container for the necessary parameters to execute the BulkPublish service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncBulkPublishResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorDuplicateRequest, AWSCognitoSyncErrorAlreadyStreamed.

Declared In

AWSCognitoSyncService.h

– bulkPublish:completionHandler:

Initiates a bulk publish of all existing datasets for an Identity Pool to the configured stream. Customers are limited to one successful bulk publish per 24 hours. Bulk publish is an asynchronous request, customers can see the status of the request via the GetBulkPublishDetails operation.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)bulkPublish:(AWSCognitoSyncBulkPublishRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncBulkPublishResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the BulkPublish service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorDuplicateRequest, AWSCognitoSyncErrorAlreadyStreamed.

Declared In

AWSCognitoSyncService.h

– deleteDataset:

Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (AWSTask<AWSCognitoSyncDeleteDatasetResponse*> *)deleteDataset:(AWSCognitoSyncDeleteDatasetRequest *)request

Parameters

request

A container for the necessary parameters to execute the DeleteDataset service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncDeleteDatasetResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorResourceConflict.

Declared In

AWSCognitoSyncService.h

– deleteDataset:completionHandler:

Deletes the specific dataset. The dataset will be deleted permanently, and the action can't be undone. Datasets that this dataset was merged with will no longer report the merge. Any subsequent operation on this dataset will result in a ResourceNotFoundException.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (void)deleteDataset:(AWSCognitoSyncDeleteDatasetRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncDeleteDatasetResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the DeleteDataset service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorResourceConflict.

Declared In

AWSCognitoSyncService.h

– describeDataset:

Gets meta data about a dataset by identity and dataset name. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

- (AWSTask<AWSCognitoSyncDescribeDatasetResponse*> *)describeDataset:(AWSCognitoSyncDescribeDatasetRequest *)request

Parameters

request

A container for the necessary parameters to execute the DescribeDataset service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncDescribeDatasetResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– describeDataset:completionHandler:

Gets meta data about a dataset by identity and dataset name. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

- (void)describeDataset:(AWSCognitoSyncDescribeDatasetRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncDescribeDatasetResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the DescribeDataset service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– describeIdentityPoolUsage:

Gets usage details (for example, data storage) about a particular identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncDescribeIdentityPoolUsageResponse*> *)describeIdentityPoolUsage:(AWSCognitoSyncDescribeIdentityPoolUsageRequest *)request

Parameters

request

A container for the necessary parameters to execute the DescribeIdentityPoolUsage service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncDescribeIdentityPoolUsageResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– describeIdentityPoolUsage:completionHandler:

Gets usage details (for example, data storage) about a particular identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)describeIdentityPoolUsage:(AWSCognitoSyncDescribeIdentityPoolUsageRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncDescribeIdentityPoolUsageResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the DescribeIdentityPoolUsage service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– describeIdentityUsage:

Gets usage information for an identity, including number of datasets and data usage.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (AWSTask<AWSCognitoSyncDescribeIdentityUsageResponse*> *)describeIdentityUsage:(AWSCognitoSyncDescribeIdentityUsageRequest *)request

Parameters

request

A container for the necessary parameters to execute the DescribeIdentityUsage service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncDescribeIdentityUsageResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– describeIdentityUsage:completionHandler:

Gets usage information for an identity, including number of datasets and data usage.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (void)describeIdentityUsage:(AWSCognitoSyncDescribeIdentityUsageRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncDescribeIdentityUsageResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the DescribeIdentityUsage service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– getBulkPublishDetails:

Get the status of the last BulkPublish operation for an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncGetBulkPublishDetailsResponse*> *)getBulkPublishDetails:(AWSCognitoSyncGetBulkPublishDetailsRequest *)request

Parameters

request

A container for the necessary parameters to execute the GetBulkPublishDetails service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncGetBulkPublishDetailsResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h

– getBulkPublishDetails:completionHandler:

Get the status of the last BulkPublish operation for an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)getBulkPublishDetails:(AWSCognitoSyncGetBulkPublishDetailsRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncGetBulkPublishDetailsResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the GetBulkPublishDetails service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h

– getCognitoEvents:

Gets the events and the corresponding Lambda functions associated with an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncGetCognitoEventsResponse*> *)getCognitoEvents:(AWSCognitoSyncGetCognitoEventsRequest *)request

Parameters

request

A container for the necessary parameters to execute the GetCognitoEvents service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncGetCognitoEventsResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– getCognitoEvents:completionHandler:

Gets the events and the corresponding Lambda functions associated with an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)getCognitoEvents:(AWSCognitoSyncGetCognitoEventsRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncGetCognitoEventsResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the GetCognitoEvents service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– getIdentityPoolConfiguration:

Gets the configuration settings of an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncGetIdentityPoolConfigurationResponse*> *)getIdentityPoolConfiguration:(AWSCognitoSyncGetIdentityPoolConfigurationRequest *)request

Parameters

request

A container for the necessary parameters to execute the GetIdentityPoolConfiguration service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncGetIdentityPoolConfigurationResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– getIdentityPoolConfiguration:completionHandler:

Gets the configuration settings of an identity pool.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)getIdentityPoolConfiguration:(AWSCognitoSyncGetIdentityPoolConfigurationRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncGetIdentityPoolConfigurationResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the GetIdentityPoolConfiguration service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– listDatasets:

Lists datasets for an identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

ListDatasets can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use the Cognito Identity credentials to make this API call.

- (AWSTask<AWSCognitoSyncListDatasetsResponse*> *)listDatasets:(AWSCognitoSyncListDatasetsRequest *)request

Parameters

request

A container for the necessary parameters to execute the ListDatasets service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncListDatasetsResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– listDatasets:completionHandler:

Lists datasets for an identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

ListDatasets can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use the Cognito Identity credentials to make this API call.

- (void)listDatasets:(AWSCognitoSyncListDatasetsRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncListDatasetsResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the ListDatasets service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– listIdentityPoolUsage:

Gets a list of identity pools registered with Cognito.

ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncListIdentityPoolUsageResponse*> *)listIdentityPoolUsage:(AWSCognitoSyncListIdentityPoolUsageRequest *)request

Parameters

request

A container for the necessary parameters to execute the ListIdentityPoolUsage service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncListIdentityPoolUsageResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– listIdentityPoolUsage:completionHandler:

Gets a list of identity pools registered with Cognito.

ListIdentityPoolUsage can only be called with developer credentials. You cannot make this API call with the temporary user credentials provided by Cognito Identity.

- (void)listIdentityPoolUsage:(AWSCognitoSyncListIdentityPoolUsageRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncListIdentityPoolUsageResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the ListIdentityPoolUsage service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– listRecords:

Gets paginated records, optionally changed after a particular sync count for a dataset and identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

ListRecords can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

- (AWSTask<AWSCognitoSyncListRecordsResponse*> *)listRecords:(AWSCognitoSyncListRecordsRequest *)request

Parameters

request

A container for the necessary parameters to execute the ListRecords service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncListRecordsResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h

– listRecords:completionHandler:

Gets paginated records, optionally changed after a particular sync count for a dataset and identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

ListRecords can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

- (void)listRecords:(AWSCognitoSyncListRecordsRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncListRecordsResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the ListRecords service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h

– registerDevice:

Registers a device to receive push sync notifications.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (AWSTask<AWSCognitoSyncRegisterDeviceResponse*> *)registerDevice:(AWSCognitoSyncRegisterDeviceRequest *)request

Parameters

request

A container for the necessary parameters to execute the RegisterDevice service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncRegisterDeviceResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– registerDevice:completionHandler:

Registers a device to receive push sync notifications.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (void)registerDevice:(AWSCognitoSyncRegisterDeviceRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncRegisterDeviceResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the RegisterDevice service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– setCognitoEvents:

Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask *)setCognitoEvents:(AWSCognitoSyncSetCognitoEventsRequest *)request

Parameters

request

A container for the necessary parameters to execute the SetCognitoEvents service method.

Return Value

An instance of AWSTask. On successful execution, task.result will be nil. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– setCognitoEvents:completionHandler:

Sets the AWS Lambda function for a given event type for an identity pool. This request only updates the key/value pair specified. Other key/values pairs are not updated. To remove a key value pair, pass a empty value for the particular key.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)setCognitoEvents:(AWSCognitoSyncSetCognitoEventsRequest *)request completionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the SetCognitoEvents service method.

completionHandler

The completion handler to call when the load request is complete. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– setIdentityPoolConfiguration:

Sets the necessary configuration for push sync.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (AWSTask<AWSCognitoSyncSetIdentityPoolConfigurationResponse*> *)setIdentityPoolConfiguration:(AWSCognitoSyncSetIdentityPoolConfigurationRequest *)request

Parameters

request

A container for the necessary parameters to execute the SetIdentityPoolConfiguration service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncSetIdentityPoolConfigurationResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorConcurrentModification.

Declared In

AWSCognitoSyncService.h

– setIdentityPoolConfiguration:completionHandler:

Sets the necessary configuration for push sync.

This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.

- (void)setIdentityPoolConfiguration:(AWSCognitoSyncSetIdentityPoolConfigurationRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncSetIdentityPoolConfigurationResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the SetIdentityPoolConfiguration service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorConcurrentModification.

Declared In

AWSCognitoSyncService.h

– subscribeToDataset:

Subscribes to receive notifications when a dataset is modified by another device.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (AWSTask<AWSCognitoSyncSubscribeToDatasetResponse*> *)subscribeToDataset:(AWSCognitoSyncSubscribeToDatasetRequest *)request

Parameters

request

A container for the necessary parameters to execute the SubscribeToDataset service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncSubscribeToDatasetResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– subscribeToDataset:completionHandler:

Subscribes to receive notifications when a dataset is modified by another device.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (void)subscribeToDataset:(AWSCognitoSyncSubscribeToDatasetRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncSubscribeToDatasetResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the SubscribeToDataset service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– unsubscribeFromDataset:

Unsubscribes from receiving notifications when a dataset is modified by another device.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (AWSTask<AWSCognitoSyncUnsubscribeFromDatasetResponse*> *)unsubscribeFromDataset:(AWSCognitoSyncUnsubscribeFromDatasetRequest *)request

Parameters

request

A container for the necessary parameters to execute the UnsubscribeFromDataset service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncUnsubscribeFromDatasetResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– unsubscribeFromDataset:completionHandler:

Unsubscribes from receiving notifications when a dataset is modified by another device.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

- (void)unsubscribeFromDataset:(AWSCognitoSyncUnsubscribeFromDatasetRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncUnsubscribeFromDatasetResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the UnsubscribeFromDataset service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorInternalError, AWSCognitoSyncErrorInvalidConfiguration, AWSCognitoSyncErrorTooManyRequests.

Declared In

AWSCognitoSyncService.h

– updateRecords:

Posts updates to records and adds and deletes records for a dataset and user.

The sync count in the record patch is your last known sync count for that record. The server will reject an UpdateRecords request with a ResourceConflictException if you try to patch a record with a new value but a stale sync count.

For example, if the sync count on the server is 5 for a key called highScore and you try and submit a new highScore with sync count of 4, the request will be rejected. To obtain the current sync count for a record, call ListRecords. On a successful update of the record, the response returns the new sync count for that record. You should present that sync count the next time you try to update that same record. When the record does not exist, specify the sync count as 0.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (AWSTask<AWSCognitoSyncUpdateRecordsResponse*> *)updateRecords:(AWSCognitoSyncUpdateRecordsRequest *)request

Parameters

request

A container for the necessary parameters to execute the UpdateRecords service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSCognitoSyncUpdateRecordsResponse. On failed execution, task.error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorLimitExceeded, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorResourceConflict, AWSCognitoSyncErrorInvalidLambdaFunctionOutput, AWSCognitoSyncErrorLambdaThrottled, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h

– updateRecords:completionHandler:

Posts updates to records and adds and deletes records for a dataset and user.

The sync count in the record patch is your last known sync count for that record. The server will reject an UpdateRecords request with a ResourceConflictException if you try to patch a record with a new value but a stale sync count.

For example, if the sync count on the server is 5 for a key called highScore and you try and submit a new highScore with sync count of 4, the request will be rejected. To obtain the current sync count for a record, call ListRecords. On a successful update of the record, the response returns the new sync count for that record. You should present that sync count the next time you try to update that same record. When the record does not exist, specify the sync count as 0.

This API can be called with temporary user credentials provided by Cognito Identity or with developer credentials.

- (void)updateRecords:(AWSCognitoSyncUpdateRecordsRequest *)request completionHandler:(void ( ^ _Nullable ) ( AWSCognitoSyncUpdateRecordsResponse *_Nullable response , NSError *_Nullable error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the UpdateRecords service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSCognitoSyncErrorDomain domain and the following error code: AWSCognitoSyncErrorInvalidParameter, AWSCognitoSyncErrorLimitExceeded, AWSCognitoSyncErrorNotAuthorized, AWSCognitoSyncErrorResourceNotFound, AWSCognitoSyncErrorResourceConflict, AWSCognitoSyncErrorInvalidLambdaFunctionOutput, AWSCognitoSyncErrorLambdaThrottled, AWSCognitoSyncErrorTooManyRequests, AWSCognitoSyncErrorInternalError.

Declared In

AWSCognitoSyncService.h