Skip to content

Commit

Permalink
chore(MobileClient): Removing deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaland committed Nov 4, 2024
1 parent b7504ff commit 6b9a326
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 106 deletions.
60 changes: 0 additions & 60 deletions AWSAuthSDK/Sources/AWSMobileClient/Internal/_AWSMobileClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,60 +94,6 @@ NS_ASSUME_NONNULL_BEGIN
sourceApplication:(nullable NSString *)sourceApplication
annotation:(id)annotation;

/**
Configures the different AWSMobile SDK Clientsfrom application delegate with options.
@param application instance from application delegate.
@param launchOptions from application delegate.
@param 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];
*/
- (BOOL)interceptApplication:(UIApplication *)application
didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions
resumeSessionWithCompletionHandler:(void (^)(id result, NSError *error))completionHandler;

/**
Configures the different AWSMobile SDK Clientsfrom application delegate with options.
@param application instance from application delegate.
@param launchOptions from application delegate.
*Swift*
AWSMobileClient
.sharedInstance()
.interceptApplication(application, didFinishLaunchingWithOptions:launchOptions)
*Objective-C*
AWSMobileClient *mobileClient = [AWSMobileClient sharedInstance];
[mobileClient interceptApplication:application
didFinishLaunchingWithOptions:launchOptions];
*/
- (BOOL)interceptApplication:(UIApplication *)application
didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions;

/**
Set the signInProviderConfig
@param signInProviderConfig the signInProviderConfiguration with permissions.
**/
- (void)setSignInProviders:(nullable NSArray<AWSSignInProviderConfig *> *)signInProviderConfig;


-(void)showSignInScreen:(UINavigationController *)navController
signInUIConfiguration:(SignInUIOptions *)signInUIConfiguration
Expand All @@ -159,12 +105,6 @@ didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions;
*/
- (void)setCredentialsProvider:(AWSCognitoCredentialsProvider *)credentialsProvider;

/**
* Retrieve the Credentials Provider.
* @return AWSCognitoCredentialsProvider
*/
- (AWSCognitoCredentialsProvider *)getCredentialsProvider;

/**
* Indicates whether the user is signed-in or not.
* @return true if user is signed-in
Expand Down
44 changes: 0 additions & 44 deletions AWSAuthSDK/Sources/AWSMobileClient/Internal/_AWSMobileClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,31 +111,6 @@ - (BOOL)interceptApplication:(UIApplication *)application
annotation:annotation];
}

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

AWSDDLogInfo(@"didFinishLaunching:withOptions:resumeSessionWithCompletionHandler:");

if (self.signInProviderConfig == nil) {
[self registerConfigSignInProviders];
} else {
[self registerUserSignInProviders:self.signInProviderConfig];
}

BOOL didFinishLaunching = [[AWSSignInManager sharedInstance]
interceptApplication:application
didFinishLaunchingWithOptions:launchOptions];;

if (!_isInitialized) {
AWSDDLogInfo(@"Resuming any previously signed-in session");
[[AWSSignInManager sharedInstance] resumeSessionWithCompletionHandler:completionHandler];
_isInitialized = YES;
}

return didFinishLaunching;
}

-(void)showSignInScreen:(UINavigationController *)navController
signInUIConfiguration:(SignInUIOptions *)signInUIConfiguration
completionHandler:(void (^)(NSString * _Nullable signInProviderKey, NSString * _Nullable signInProviderToken, NSError * _Nullable error))completionHandler {
Expand Down Expand Up @@ -293,25 +268,6 @@ - (BOOL)isLoggedIn {
return [[AWSSignInManager sharedInstance] isLoggedIn];
}

- (AWSCognitoCredentialsProvider *)getCredentialsProvider {
return [[AWSIdentityManager defaultIdentityManager] credentialsProvider];
}

- (void)setSignInProviders:(nullable NSArray<AWSSignInProviderConfig *> *)signInProviderConfig {
self.signInProviderConfig = signInProviderConfig;
}

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

return [self interceptApplication:application
didFinishLaunchingWithOptions:launchOptions
resumeSessionWithCompletionHandler:^(id result, NSError *error) {
AWSDDLogInfo(@"Welcome to AWS! You are connected successfully.");
AWSDDLogInfo(@"result = %@,error = %@", result, error);
}];
}

@end


Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class AWSMobileClientCustomEndpointTest: AWSMobileClientTestBase {
}

override func setUp() {
_ = AWSMobileClient.default().getCredentialsProvider()
continueAfterFailure = false
}

Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

## Unreleased

-Features for next release
### Misc. Updates
- **AWSMobileClient**
- **Breaking API change** Removing the following deprecated methods:
- `interceptApplication(_:didFinishLaunchingWithOptions:)`
- `interceptApplication(_:didFinishLaunchingWithOptions:resumeSessionWithCompletionHandler:)`
- `setSignInProviders(_:)`
- `getCredentialsProvider()`

## 2.37.2

Expand Down

0 comments on commit 6b9a326

Please sign in to comment.