Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the AWS SDK for IOS? [closed]

Tags:

iphone

Iam developing one application.In that i want to use the amazon web services.I downloaded the AWS SDK for IOS.But i dont know how to write the code for access the AWS.In this i want to use the AWS S3.SO please tell me how to do this.

like image 854
Naresh Venkat Avatar asked Oct 03 '11 06:10

Naresh Venkat


3 Answers

Here's a simple sample app showing how to up/download files from Amazon S3 from your iOS App using Access & Secret Key credentials, i.e. NOT using Cognito which is only available in two regions at the moment: http://bit.ly/awss3v2ios

like image 102
patschiboy Avatar answered Oct 05 '22 02:10

patschiboy


This is how I did it.

  1. Download the aws-ios-sdk or integrate it into your project using cocoapods. (Using cocoapods is really helpful).

  2. Add -Objc flag to your other linker flags of your build target.

  3. Make sure your build phases has Foundation.framework and libz.dylib added.

  4. On AWS Console create your app and go to the Cognito settings.

  5. Create a new identity pool.

  6. In step 2 of this process, it'll ask you to provide IAM role. I tried using existing role but was not successful, so create a new IAM role and click update role.

  7. This will provide you a startup code, use this exactly in your iOS code.

  8. If you want to have full access to S3 (upload, download, change access settings, remove), then go to IAM section from the AWS console and add the S3 role policy to the role.

  9. Now the AWS-Console setup is done and you can continue with accessing the S3 from your iOS code. You can find the necessary code in the sample app.

like image 26
brainforked Avatar answered Oct 05 '22 02:10

brainforked


I was also strucked in this and sharing you my findings.You can easily integrate the AWS iOS sdk in your app. You have to create the cognito id to use this. Also for testing purpose you can test it directly with your credentials. However using credentials in the app is avoided.You can download the sample app and also get detailed description from here. Click here.

like image 23
Henry Avatar answered Oct 05 '22 02:10

Henry