Skip to content

Commit

Permalink
The AWS Mobile SDK for iOS 2.2.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi Zhu committed Jul 14, 2015
1 parent 352e8dc commit a2a4fc6
Show file tree
Hide file tree
Showing 31 changed files with 477 additions and 101 deletions.
4 changes: 2 additions & 2 deletions AWSAPIGateway.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSAPIGateway'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSAPIGateway/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSAutoScaling.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSAutoScaling'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSAutoScaling/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSCloudWatch.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSCloudWatch'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSCloudWatch/*.{h,m}'
end
2 changes: 1 addition & 1 deletion AWSCore.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSCore'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand Down
2 changes: 1 addition & 1 deletion AWSCore/Networking/AWSNetworking.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#import "AWSService.h"

NSString *const AWSNetworkingErrorDomain = @"com.amazonaws.AWSNetworkingErrorDomain";
NSString *const AWSiOSSDKVersion = @"2.2.1";
NSString *const AWSiOSSDKVersion = @"2.2.2";

#pragma mark - AWSHTTPMethod

Expand Down
16 changes: 11 additions & 5 deletions AWSCore/Serialization/AWSURLRequestRetryHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ - (instancetype)initWithMaximumRetryCount:(uint32_t)maxRetryCount {
}

- (BOOL)isClockSkewError:(NSError *)error {
if (error.code == AWSGeneralErrorRequestTimeTooSkewed
|| error.code == AWSGeneralErrorInvalidSignatureException
|| error.code == AWSGeneralErrorRequestExpired
|| error.code == AWSGeneralErrorAuthFailure) {
return YES;
if ([error.domain isEqualToString:AWSGeneralErrorDomain]) {
switch (error.code) {
case AWSGeneralErrorRequestTimeTooSkewed:
case AWSGeneralErrorInvalidSignatureException:
case AWSGeneralErrorRequestExpired:
case AWSGeneralErrorAuthFailure:
case AWSGeneralErrorSignatureDoesNotMatch:
return YES;
default:
break;
}
}

return NO;
Expand Down
25 changes: 18 additions & 7 deletions AWSCore/Utility/AWSCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,25 @@ + (NSTimeInterval)aws_getRuntimeClockSkew {
@implementation NSDictionary (AWS)

- (NSDictionary *)aws_removeNullValues {
NSMutableDictionary *mutableDictionary = [NSMutableDictionary new];
[self enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if (obj != [NSNull null]) {
[mutableDictionary setObject:obj forKey:key];
}
}];
return [self aws_recursivelyRemoveNullEntries:self];
}

return mutableDictionary;
- (NSDictionary *)aws_recursivelyRemoveNullEntries:(NSDictionary *)inputDictionary {

NSMutableDictionary *resultMutableDictionary = [NSMutableDictionary new];

for (NSString *key in inputDictionary) {
id value = inputDictionary[key];
if ([value isEqual:[NSNull null]]) {
continue;
}
if([value isKindOfClass:[NSDictionary class]]) {
[resultMutableDictionary setObject:[self aws_recursivelyRemoveNullEntries:value] forKey:key];
} else {
[resultMutableDictionary setObject:value forKey:key];
}
}
return resultMutableDictionary;
}

-(id) aws_objectForCaseInsensitiveKey:(id)aKey {
Expand Down
25 changes: 25 additions & 0 deletions AWSCoreTests/AWSUtilityTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,31 @@ - (void)testCategoryNSJSONSerialization {
XCTAssertNil(data);
}

- (void)testCategoryNSDictionaryRemoveNullValues {
NSDictionary *testDictionary = @{
@"key1":@"value1",
@"key2":[NSNull null],
@"key3":@{
@"subkey1":@"subkeyvalue1",
@"subkey2":[NSNull null]
},
@"key4":@{
@"onlyKey":[NSNull null]
}
};
NSDictionary *expectedResultDic = @{
@"key1":@"value1",
@"key3":@{
@"subkey1":@"subkeyvalue1",
},
@"key4":@{
}
};
NSDictionary *resultDic = [testDictionary aws_removeNullValues];
XCTAssertEqualObjects(expectedResultDic, resultDic);


}
- (void)testLogger {
XCTAssertEqualObjects([[AWSLogger defaultLogger] logLevelLabel:AWSLogLevelUnknown], @"?");
XCTAssertEqualObjects([[AWSLogger defaultLogger] logLevelLabel:AWSLogLevelNone], @"?");
Expand Down
4 changes: 2 additions & 2 deletions AWSDynamoDB.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSDynamoDB'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSDynamoDB/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSEC2.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSEC2'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSEC2/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSElasticLoadBalancing.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSElasticLoadBalancing'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSElasticLoadBalancing/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSKinesis.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSKinesis'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSKinesis/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSLambda.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSLambda'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSLambda/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSMachineLearning.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSMachineLearning'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSMachineLearning/*.{h,m}'
end
4 changes: 2 additions & 2 deletions AWSMobileAnalytics.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AWSMobileAnalytics'
s.version = '2.2.1'
s.version = '2.2.2'
s.summary = 'Amazon Web Services SDK for iOS.'

s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/aws/aws-sdk-ios.git',
:tag => s.version}
s.requires_arc = true
s.dependency 'AWSCore', '2.2.1'
s.dependency 'AWSCore', '2.2.2'

s.source_files = 'AWSMobileAnalytics/*.{h,m}', 'AWSMobileAnalytics/**/*.{h,m}'
s.private_header_files = 'AWSMobileAnalytics/Internal/*.h'
Expand Down
2 changes: 1 addition & 1 deletion AWSMobileAnalytics/AWSMobileAnalyticsConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (instancetype)init {
_attributes = [NSDictionary dictionary];
_useHttps = YES;
_environment = [AWSMobileAnalyticsEnvironment new];
_transmitOnWAN = NO;
_transmitOnWAN = YES;
_enableEvents = YES;
_identificationStrategy = AWSAppIdentificationStrategyPrivate;
_serviceConfiguration = [AWSServiceManager defaultServiceManager].defaultServiceConfiguration;
Expand Down
24 changes: 23 additions & 1 deletion AWSMobileAnalytics/AWSMobileAnalyticsService.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,35 @@ typedef void(^AWSInitializationCompletionBlock)(AWSMobileAnalytics *mobileAnalyt
@property (nonatomic, strong, readonly) id<AWSMobileAnalyticsEventClient> eventClient;

/**
Creates an `AWSMobileAnalytics` instance with the specified `appId` using the default `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
Creates an `AWSMobileAnalytics` instance with the specified `appId` using the default `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
@param appId AppId from Amazon Mobile Analytics Management Console.
@returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
*/
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId;

/**
Creates an `AWSMobileAnalytics` instance with the specified `appId` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `identityPoolId` is ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually. This method defaults to initialize both mobile analytics and cognito in the AWSUSEast1 region.
@param appId AppId from Amazon Mobile Analytics Management Console.
@param identityPoolId The identity pool id for this provider. Value is used to communicate with Amazon Cognito as well as namespace values stored in the keychain.
@returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
*/
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId
identityPoolId:(NSString *)identityPoolId;

/**
Creates an `AWSMobileAnalytics` instance with the specified `appId` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `identityPoolId` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually. This method defaults to initialize both mobile analytics and cognito in the AWSUSEast1 region.
@param appId AppId from Amazon Mobile Analytics Management Console.
@param identityPoolId The identity pool id for this provider. Value is used to communicate with Amazon Cognito as well as namespace values stored in the keychain.
@param completionBlock A AWSInitializationCompletionBlock that allows developers to handle custom logic after initialization but before the session begins.
@returns The AWSMobileAnalytics instance with the specified appId or nil if serviceConfiguration is invalid or appId is empty.
*/
+ (instancetype)mobileAnalyticsForAppId:(NSString *)appId
identityPoolId:(NSString *)identityPoolId
completionBlock:(AWSInitializationCompletionBlock)completionBlock;

/**
Creates an `AWSMobileAnalytics` instance with the specified `appId` using provided `configuration` if the instance does not already exists for the `appId`. If an instance exists for the given `appId`, returns the existing instance. `configuration` and `completionBlock` are ignored if an instance exists for the given `appId`. The strong reference to the instance is maintained by `AWSMobileAnalytics`, and the developer does not need to retain it manually.
Expand Down
Loading

0 comments on commit a2a4fc6

Please sign in to comment.