AWSKinesisRecorder Class Reference

Inherits from AWSAbstractKinesisRecorder : AWSService : NSObject
Declared in AWSKinesisRecorder.h
AWSKinesisRecorder.m

Overview

The AWSKinesisRecorder is a high level client meant for storing put record requests on the user’s device. This allows developers to retain requests when the device is offline. It can also increase performance and battery efficiency since the Wi-Fi or cell network does not need to be woken up as frequently.

AWSKinesisRecorder stores the requests unencripted and does not perform additional security measures outside of what the iOS offers by default. Therefore, it is recommended not to store highly sensitive information using AWSKinesisRecorder.

+ defaultKinesisRecorder

Returns a shared instance of this service client using [AWSServiceManager defaultServiceManager].defaultServiceConfiguration. When defaultServiceConfiguration is not set, this method returns nil.

+ (instancetype)defaultKinesisRecorder

Return Value

A shared instance of this 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 KinesisRecorder = AWSKinesisRecorder.default()

Objective-C

 AWSKinesisRecorder *KinesisRecorder = [AWSKinesisRecorder defaultKinesisRecorder];

Declared In

AWSKinesisRecorder.h

+ registerKinesisRecorderWithConfiguration:forKey:

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

+ (void)registerKinesisRecorderWithConfiguration:(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)
     AWSKinesisRecorder.register(with:configuration!, forKey: "USWest2KinesisRecorder")

     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];

     [AWSKinesisRecorder registerKinesisRecorderWithConfiguration:configuration forKey:@"USWest2KinesisRecorder"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let KinesisRecorder = AWSKinesisRecorder(forKey: "USWest2KinesisRecorder")

Objective-C

 AWSKinesisRecorder *KinesisRecorder = [AWSKinesisRecorder KinesisRecorderForKey:@"USWest2KinesisRecorder"];

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

Declared In

AWSKinesisRecorder.h

+ KinesisRecorderForKey:

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

+ (instancetype)KinesisRecorderForKey:(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)
     AWSKinesisRecorder.register(with: configuration!, forKey: "USWest2KinesisRecorder")

     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];

     [AWSKinesisRecorder registerKinesisRecorderWithConfiguration:configuration forKey:@"USWest2KinesisRecorder"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let KinesisRecorder = AWSKinesisRecorder(forKey: "USWest2KinesisRecorder")

Objective-C

 AWSKinesisRecorder *KinesisRecorder = [AWSKinesisRecorder KinesisRecorderForKey:@"USWest2KinesisRecorder"];

Declared In

AWSKinesisRecorder.h

+ removeKinesisRecorderForKey:

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

+ (void)removeKinesisRecorderForKey:(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

AWSKinesisRecorder.h