Download the AWS SDK for iOS 0.2.2
|New Sample Code
The awsBrowser (AWSiOSDemo) now contains demos for making Async requests. The code to make the Async request works the same for all services but only requests to S3 and SimpleDB are shown.
Async requests require the use of a delegate that implements the AmazonServiceRequestDelegate protocol. In the sample application, the request delegates are named: S3RequestDelegate and SdbRequestDelegate.
The following samples show the creation and assignment of the delegate to a request object.
S3RequestDelegate s3Delegate = [[S3RequestDelegate alloc] init];
AmazonS3Client *s3 = [[AmazonS3Client alloc] initWithAccessKey:@"Access Key Here" withSecretKey:@"Secret Key Here"];
S3CreateBucketRequest *cbr = [[[S3CreateBucketRequest alloc] initWithName:@"Your Bucket Name Here"] autorelease];
[s3 createBucket:cbr]; // Statement returns nil immediately.
SdbRequestDelegate sdb = [[SdbRequestDelegate alloc] init];
AmazonSimpleDBClient *sdbClient = [[AmazonSimpleDBClient alloc] init];
SimpleDBSelectRequest *selectRequest = [[[SimpleDBSelectRequest alloc] initWithSelectExpression:selectExpression] autorelease];
[sdb select:selectRequest]; // Statement returns nil immediately.
As the request is processed various methods on the delegate will be invoked.
- didReceiveResponse: Sent when body data has been read. May be called multiple times.
- didReceiveData: Sent when body data has been read. May be called multiple times.
- didCompleteWithResponse: Sent when the entire response has been read and processed. The object sent to this method is the same object returned when making a non-asynchronous request.
- didSendData: Sent when the request transmitted data.
- didFailWithError: Sent when there was a basic failure with the underlying connection.
- didFailWithServiceException: Sent when the service responded with an error message.
|| Description & Resolution
||Async requests now properly do not block in the main Run Loop. Responses to requests are sent to the assigned delegate.
||The iOS SDK now enables explicit control for logging. By default logging is turned off, to enable full logging include the following in your code:
Supported API Versions
This release of the SDK supports the following API versions:
|| API Version
|Amazon Elastic Compute Cloud (EC2)
|Amazon Simple Email Service (SES)
|Amazon Simple Notification Service (SNS)
|Amazon Simple Queue Service
|Amazon Simple Storage Service (S3)
|Elastic Load Balancing
|Amazon S3 over 3G
||Uploading large objects to Amazon S3 using 3G can fail frequently. Upgrading your iOS device to v4.3 helps reduce the failure rate. We are actively working with Apple to find a resolution to this problem.
|Amazon S3 client does not work around known Amazon S3 issues.
||The Amazon S3 library does not currently work around two known issues with the Amazon S3 API:
- Bucket names can include '+' symbols in the name, but the '+' symbol does not get replaced in URL encodings and can result in spaces in bucket names instead.
- It is possible to create an object with a key which includes characters that are not valid XML characters, which will cause an error in the response to the AmazonS3Client listObjects method. Refer to http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingKeys.html for guidelines on Amazon S3 keys.