AWSMobileClient Class Reference

Inherits from NSObject
Declared in AWSMobileClient.h
AWSMobileClient.m

Overview

AWSMobileClient helps you initialize the SDK, fetch the Cognito Identity and resume any previously signed-in session. It also registers the SignIn providers based on the information provided in awsconfiguration.json file.

+ sharedInstance

Returns the AWSMobileClient singleton instance configured using the information provided in awsconfiguration.json or Info.plist file.

+ (instancetype)sharedInstance

Discussion

Swift

let mobileClient = AWSMobileClient.sharedInstance()

Objective-C

AWSMobileClient *mobileClient = [AWSMobileClient sharedInstance];

Declared In

AWSMobileClient.h

– interceptApplication:openURL:sourceApplication:annotation:

Configure third-party services from application delegate with url, application that called this provider, and any annotation info.

- (BOOL)interceptApplication:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation

Parameters

application

instance from application delegate.

url

called from application delegate.

sourceApplication

that triggered this call.

annotation

from application delegate.

Return Value

true if call was handled by this component.

Swift

AWSMobileClient .sharedInstance() .interceptApplication(application, open: url, sourceApplication: sourceApplication, annotation: annotation)

Objective-C

AWSMobileClient *mobileClient = [AWSMobileClient sharedInstance]; [mobileClient interceptApplication:application openURL:url sourceApplication:srcApplication annotation:annotation];

Declared In

AWSMobileClient.h

– interceptApplication:didFinishLaunchingWithOptions:

Configures the different AWSMobile SDK Clientsfrom application delegate with options.

- (BOOL)interceptApplication:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions

Parameters

application

instance from application delegate.

launchOptions

from application delegate.

Swift

AWSMobileClient .sharedInstance() .interceptApplication(application, didFinishLaunchingWithOptions:launchOptions)

Objective-C

AWSMobileClient *mobileClient = [AWSMobileClient sharedInstance]; [mobileClient interceptApplication:application didFinishLaunchingWithOptions:launchOptions];

Declared In

AWSMobileClient.h

– interceptApplication:didFinishLaunchingWithOptions:resumeSessionWithCompletionHandler:

Configures the different AWSMobile SDK Clientsfrom application delegate with options.

- (BOOL)interceptApplication:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions resumeSessionWithCompletionHandler:(void ( ^ ) ( id result , NSError *error ))completionHandler

Parameters

application

instance from application delegate.

launchOptions

from application delegate.

completionHandler

completion handler for resuming auth session.

Swift

AWSMobileClient .sharedInstance() .interceptApplication(application, didFinishLaunchingWithOptions:launchOptions, resumeSessionWithCompletionHandler:completionHandler)

Objective-C

AWSMobileClient *mobileClient = [AWSMobileClient sharedInstance]; [mobileClient interceptApplication:application didFinishLaunchingWithOptions:launchOptions resumeSessionWithCompletionHandler:completionHandler];

Declared In

AWSMobileClient.h

– setSignInProviders:

Set the signInProviderConfig

- (void)setSignInProviders:(nullable NSArray<AWSSignInProviderConfig*> *)signInProviderConfig

Parameters

signInProviderConfig

the signInProviderConfiguration with permissions. *

Declared In

AWSMobileClient.h

– getCredentialsProvider

Retrieve the Credentials Provider.

- (AWSCognitoCredentialsProvider *)getCredentialsProvider

Return Value

AWSCognitoCredentialsProvider

Declared In

AWSMobileClient.h

– setCredentialsProvider:

Set the CredentialsProvider supplied by the user.

- (void)setCredentialsProvider:(AWSCognitoCredentialsProvider *)credentialsProvider

Parameters

credentialsProvider

The CredentialsProvider supplied by the user

Declared In

AWSMobileClient.h