AWSFirehoseRecorder Class Reference
Inherits from | AWSAbstractKinesisRecorder : AWSService : NSObject |
---|---|
Declared in | AWSFirehoseRecorder.h AWSFirehoseRecorder.m |
Overview
The AWSFirehoseRecorder 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.
AWSFirehoseRecorder stores the requests unencrypted 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 AWSFirehoseRecorder.
+ defaultFirehoseRecorder
Returns a shared instance of this service client using [AWSServiceManager defaultServiceManager].defaultServiceConfiguration
. When defaultServiceConfiguration
is not set, this method returns nil.
+ (instancetype)defaultFirehoseRecorder
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 FirehoseRecorder = AWSFirehoseRecorder.default()
Objective-C
AWSFirehoseRecorder *FirehoseRecorder = [AWSFirehoseRecorder defaultFirehoseRecorder];
Declared In
AWSFirehoseRecorder.h
+ registerFirehoseRecorderWithConfiguration:forKey:
Creates a service client with the given service configuration and registers it for the key.
+ (void)registerFirehoseRecorderWithConfiguration:(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)
AWSFirehoseRecorder.register(with: configuration!, forKey: "USWest2Firehose")
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];
[AWSFirehoseRecorder registerFirehoseRecorderWithConfiguration:configuration forKey:@"USWest2FirehoseRecorder"];
return YES;
}
Then call the following to get the service client:
Swift
let FirehoseRecorder = AWSFirehoseRecorder(forKey: "USWest2FirehoseRecorder")
Objective-C
AWSFirehoseRecorder *FirehoseRecorder = [AWSFirehoseRecorder FirehoseRecorderForKey:@"USWest2FirehoseRecorder"];
Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.
Declared In
AWSFirehoseRecorder.h
+ FirehoseRecorderForKey:
Retrieves the service client associated with the key. You need to call + registerFirehoseWithConfiguration:forKey:
before invoking this method.
+ (instancetype)FirehoseRecorderForKey:(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)
AWSFirehoseRecorder.register(with: configuration!, forKey: "USWest2FirehoseRecorder")
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];
[AWSFirehoseRecorder registerFirehoseRecorderWithConfiguration:configuration forKey:@"USWest2FirehoseRecorder"];
return YES;
}
Then call the following to get the service client:
Swift
let FirehoseRecorder = AWSFirehoseRecorder(forKey: "USWest2FirehoseRecorder")
Objective-C
AWSFirehoseRecorder *FirehoseRecorder = [AWSFirehoseRecorder FirehoseRecorderForKey:@"USWest2FirehoseRecorder"];
Declared In
AWSFirehoseRecorder.h
+ removeFirehoseRecorderForKey:
Removes the service client associated with the key and release it.
+ (void)removeFirehoseRecorderForKey:(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
AWSFirehoseRecorder.h