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.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
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.
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.
Download the aws-ios-sdk or integrate it into your project using cocoapods. (Using cocoapods is really helpful).
Add -Objc flag to your other linker flags of your build target.
Make sure your build phases has Foundation.framework and libz.dylib added.
On AWS Console create your app and go to the Cognito settings.
Create a new identity pool.
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.
This will provide you a startup code, use this exactly in your iOS code.
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.
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.