AWSFirehoseRecorder

Objective-C

@interface AWSFirehoseRecorder : AWSAbstractKinesisRecorder

Swift

class AWSFirehoseRecorder : AWSAbstractKinesisRecorder

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. @discussion 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.

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

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

    Declaration

    Objective-C

    + (nonnull instancetype)defaultFirehoseRecorder;

    Swift

    class func `default`() -> Self

    Return Value

    A shared instance of this service client.

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

    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.

    Declaration

    Objective-C

    + (void)registerFirehoseRecorderWithConfiguration:(id)configuration
                                               forKey:(nonnull NSString *)key;

    Swift

    class func register(withConfiguration configuration: Any!, forKey key: String)

    Parameters

    configuration

    A service configuration object.

    key

    A string to identify the service client.

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

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

    Declaration

    Objective-C

    + (nonnull instancetype)FirehoseRecorderForKey:(nonnull NSString *)key;

    Swift

    convenience init(forKey key: String)

    Parameters

    key

    A string to identify the service client.

    Return Value

    An instance of the service client.

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

    Warning

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

    Declaration

    Objective-C

    + (void)removeFirehoseRecorderForKey:(nonnull NSString *)key;

    Swift

    class func remove(forKey key: String)

    Parameters

    key

    A string to identify the service client.