开发者

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

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 3 years ago.

Improve this question开发者_运维技巧

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.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜