Skip to content

Official mirror of version 2 of the AWS Mobile SDK for iOS. For more information, see our web site:

License

Notifications You must be signed in to change notification settings

yarneo/aws-sdk-ios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Version 2 of the AWS SDK for iOS

##Setting Up

To get started with the AWS SDK for iOS, you can set up the SDK and start building a new project, or you can integrate the SDK in an existing project. You can also run the samples to get a sense of how the SDK works.

The AWS Mobile SDK for iOS supports the following versions of software:

  • Xcode 7 and later
  • iOS 7 and later

You can check out the SDK source code.

##Include the SDK for iOS in an Existing Application

The sample apps are standalone projects that are already set up for you. You can also integrate the SDK for iOS with an existing application. If you have an existing app in which you'd like to use AWS, there are two ways to import the AWS Mobile SDK for iOS into your project:

###CocoaPods

  1. The AWS Mobile SDK for iOS is available through CocoaPods. If you have not installed CocoaPods, install CocoaPods by running the command:

     $ sudo gem install cocoapods
     $ pod setup
    
  2. In your project directory (the directory where your *.xcodeproj file is), create a plain text file named Podfile (without any file extension) and add the following lines.

     source 'https://github.com/CocoaPods/Specs.git'
     
     pod 'AWSCore'
     pod 'AWSAutoScaling'
     pod 'AWSCloudWatch'
     pod 'AWSDynamoDB'
     pod 'AWSEC2'
     pod 'AWSElasticLoadBalancing'
     pod 'AWSIoT'
     pod 'AWSKinesis'
     pod 'AWSLambda'
     pod 'AWSMachineLearning'
     pod 'AWSMobileAnalytics'
     pod 'AWSS3'
     pod 'AWSSES'
     pod 'AWSSimpleDB'
     pod 'AWSSNS'
     pod 'AWSSQS'
     pod 'AWSCognito'
    

    image

  3. Then run the following command:

     $ pod install
    
  4. Open up *.xcworkspace with Xcode and start using the SDK.

    image

    Note: Do NOT use *.xcodeproj. If you open up a project file instead of a workspace, you receive an error:

     ld: library not found for -lPods-AWSiOSSDKv2
     clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

###Frameworks

  1. Download the SDK from our AWS Mobile SDK page. The SDK is stored in a compressed file archive named aws-ios-sdk-#.#.# (where #.#.# represents the version number, so for version 2.0.0, the filename is aws-ios-sdk-2.0.0).

    Note: The size of AWSiOSSDKv2.framework is > 65MB; however, it does not add > 65MB to your app binary when imported to your project because:

    • Only objects that you use in your app are included in your app binary from the framework

      AWSiOSSDKv2.framework contains a static library, and object code in the library is incorporated in your app binary file at build time. When the -ObjC and -all_load linker flags are NOT used, Xcode is smart enough to figure out what objects from the framework are necessary for your app and include just those objects. AWSiOSSDKv2.framework is packaged so that you do not need to include these linker flags. (If you are using a third-party framework that requires you to include the -ObjC or -all_load linker flags, you can use -force_load instead to include those frameworks.)

      For example, if you only use Amazon DynamoDB in your app and none of the other supported services, your app won't include object code for those other services. Unless you use every single object from the framework, only a portion of the code from the framework will be included in your app.

    • The framework contains five architectures, while apps on a device need at most three

      We currently compile the AWS Mobile SDK for iOS for five architectures: armv7, armv7s, arm64, i386, and x86_64. If you want to optimize your app for 64-bit devices including iPhone 6 and iPhone 5S, you need to build your app with arm64 support. 32-bit iOS devices that the AWS SDK for iOS supports use the armv7 and armv7s architectures.

      The 64-bit iPhone simulators use x86_64, and 32-bit simulators use i386 because they run on the Mac. We support these architectures so that the developers can run their apps with our framework on the simulator for testing. x86_64 and i386 support is essential for testing, but the code is unnecessary for apps on the App Store. Even if you use every single object from the AWS Mobile SDK, the app that you submit to Apple never includes about two fifths of the code included in the framework.

    • Apps on the App Store are compressed

      After you submit your app to Apple, it is encrypted for DRM purposes and re-compressed. This leads to an even smaller footprint.

  2. With your project open in Xcode, Control+click Frameworks and then click Add files to "<project name>"....

  3. In Finder, navigate to the AWS<#ServiceName#>.framework files and select them.

    • AWSCore.framework
    • AWSAutoScaling.framework
    • AWSCloudWatch.framework
    • AWSDynamoDB.framework
    • AWSEC2.framework
    • AWSElasticLoadBalancing.framework
    • AWSIoT.framework
    • AWSKinesis.framework
    • AWSLambda.framework
    • AWSMachineLearning.framework
    • AWSMobileAnalytics.framework
    • AWSS3.framework
    • AWSSES.framework
    • AWSSimpleDB.framework
    • AWSSNS.framework
    • AWSSQS.framework
    • extras/AWSCognito.framework - for Amazon Cognito Sync
  4. Open a target for your project, select Build Phases, expand Link Binary With Libraries, click the + button, and add libsqlite3.tbd, libz.tbd, CFNetwork.framework, Security.framework, SystemConfiguration.framework, and UIKit.framework.

##Update the SDK to a Newer Version

When we release a new version of the SDK, you can pick up the changes as described below.

###CocoaPods

  1. Run the following command in your project directory. CocoaPods automatically picks up the new changes.

     $ pod update
    

    Note: If your pod is having an issue, you can delete Podfile.lock and Pods/ then run pod install to cleanly install the SDK.

    image

###Frameworks

  1. In Xcode select the following frameworks and hit delete on your keyboard. Then select Move to Trash:

    • AWSCore.framework
    • AWSAutoScaling.framework
    • AWSCloudWatch.framework
    • AWSDynamoDB.framework
    • AWSEC2.framework
    • AWSElasticLoadBalancing.framework
    • AWSIoT.framework
    • AWSKinesis.framework
    • AWSLambda.framework
    • AWSMachineLearning.framework
    • AWSMobileAnalytics.framework
    • AWSS3.framework
    • AWSSES.framework
    • AWSSimpleDB.framework
    • AWSSNS.framework
    • AWSSQS.framework
    • AWSCognito.framework
  2. Follow the installation process above to include the new version of the SDK.

##Preparing your apps for iOS 9 The release of iOS 9 includes changes that might impact how your apps interact with some AWS services. If you compile your apps with Apple’s iOS 9 SDK (or Xcode 7), Apple’s App Transport Security (ATS) feature may affect the ability of apps to connect to certain AWS service endpoints. In order to ensure affected apps continue to successfully connect to AWS endpoints, you’ll need to configure them to interact properly with Apple’s ATS by adding these properties to your info.plist file: