AWS S3 Integration in iOS app

Posted by ongraph · September 5, 2014 · 4 Min read

Table of contents

Handling multiple files or larger files can sometimes be difficult, particularly in a way that is asynchronous and allows for accurate progress and retries. To help developers handle these kinds of operations, we added the S3TransferManager class.

Requirements: The basis requirements are Xcode 5 and later and iOS 7 and later.

Learn Some Basic Concept Before S3 Integration:

Sign Up for Amazon S3: To use AmazonS3, you need an AWS account. You can create an account on the following link by following instructions given on the screen.

Here apart from creating account you need to create a new identity pool. Obtain the AccountID, PoolID, and RoleUnauth constants. These things are necessary.Make sure the role has full permissions for the bucket you created.

Cocoa-Pods: CocoaPods is the dependency manager for Objective-C projects. It has thousands of libraries and can help you scale your projects elegantly.You have to install cocoa-pods for using s3 service.The dependencies for your projects are specified in a single text file called a Podfile. CocoaPods will resolve dependencies between libraries, fetch the resulting source code, then link it together in an Xcode workspace to build your project. For more information on Cocoa-pods you can go to the following link.

Create A Bucket: After creating an account and installing cocoa -pods you need to create a bucket . A bucket is a container which you can use to save your objects . Everything in the bucket is stored as objects. For creating bucket you need to sign up with the same account you created and after that click create bucket. For more information you can go to the following link.

NOTE: Making a bucket is free but you will be charged when you store you objects. You can see the price details on the following link.


Steps for S3 Integration:

Download the Sdk: You can Download the SDK from The SDK is stored in a compressed file archive named (where '#.#.#' represents the version number, so for version 2.0.0, the filename is aws-ios-sdk-2.0.0).

or you can also download the sdk from


Get AWS Credentials with Amazon Cognito or AWS Identity and Access Management: These are the credentials you get it after creating an account from Amazon S3.

Include the sdk for iOS: Just Ctrl+click on the frameworks and add files to the <project name>.

#import <AWSiOSSDKv2/S3.h> just write this line in .pch file.

Open a target for your project, select Build Phases, expand Link Binary With Libraries, click the + button, and add libsqlite3.dylib and libz.dylib.

In the target for your project, select Build Settings, go to Linking and ensure that it's expanded. Add the -ObjC linker flag to Other Linker Flags.

If your project does not already include them, drag the following frameworks, located in the third-party directory, into your project.

  • Bolts.framework (If your application uses the Facebook SDK, you won't need this framework, as it's already included with the Facebook SDK.)
  • CSURITemplate.framework
  • GZIP.framework
  • Mantle.framework
  • Reachability.framework
  • TMCache.framework
  • UICKeyChainStore.framework
  • XMLDictionary.framework

Drag and drop the following JSON files, located in the service-definitions directory, into your project.


To import dependencies, you can either add frameworks, as described above, or you can use CocoaPods. If you use CocoaPods, you'll need a podfile in your application folder, to which you'll add dependencies.

For example, to use the iOS SDK and Amazon Cognito Sync, you'd add the following to your podfile:

pod 'AWSiOSSDKv2'

pod 'AWSCognitoSync'

Then you would run the pod install command. CocoaPods will generate a workspace for you.

Open Constants.m and update the following lines with the appropriate constants:

NSString *const AWSAccountID = @”Your-AccountID”;
NSString *const CognitoPoolID = @”Your-PoolID”;
NSString *const CognitoRoleUnauth = @”Your-RoleUnauth”;
NSString *const S3BucketName = @”Your-S3-Bucket-Name”;

You have to change these properties from your credentials which you got the Amazon Cognito.

Share this Article