1

Is it possible to use the AWS mobile services (Cognito, Analytics, etc) without linking all the SDK in an Xcode project?

Background: * While I am not new to AWS nor mobile programming, the following case is challenging: We are shipping a mobile "framework" (not app) that uses our AWS for some parts (Authentication, logs). And, as the AWS SDK has to be linked in the app project itself, this will require us asking all the clients (developers) to download and link it in their own projects.

What is used in the framework is just one request for authentication and one for logging (success/failure, disconnection), so no need for all the SDK. I wonder if there is a possibility to request AWS services without linking against the SDK?

I know it's possible to put then under an umbrella SDK, or do some cherry picking from their git repository, but both of these seem like overkill.

As the request itself is a simple URL with Get/Post, is there a possibility (or tutorial) on constructing the request manually via NSURLConnexion/NSURLSession, etc?

Thank you

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Einho
  • 311
  • 3
  • 15

3 Answers3

2

Talking to the AWS APIs is actually not that hard. The main difficulty is signing your http requests, and that's not nearly as bad as it sounds. Which leaves xml parsing accounting for most of the unpleasantness.

I've done it in go. The most informative part is probably the signing tests.

Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
0

Indeed, it is possible. You will have to code calls to AWS at the REST level. Everything you need is in the documentation of AWS.

For instance, if you needed to execute actions on EC2, here's what you'd have to code:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#structure-of-a-get-request

Daniel777
  • 851
  • 8
  • 20
0

You can call the HTTP APIs directly. Since the AWS Mobile SDK for iOS and Android are open source, you can look at them directly. Find the AWS Mobile SDK for iOS Source on Github, and the AWS Mobile SDK for Android on Github. Since you mentioned you need authentication request on iOS I am guessing you're looking for the Cognito Identity in AWSCore source.

Scott Willeke
  • 8,884
  • 1
  • 40
  • 52
  • However, do keep in mind the SDKs do work for you that you'll need to re-implement. As a simple example, for Cognito the SDK will cache the [Cognito Identity ID automatically](https://github.com/aws/aws-sdk-ios/blob/176a8a0397d4a2fa3110e158f511d12f4fef86b1/AWSCore/Authentication/AWSIdentityProvider.m#L164). If you don't use the SDK, you'll have to know the services and be careful to handle things like this yourself. – Scott Willeke May 18 '15 at 18:20
  • Could you help me to fix..http://stackoverflow.com/questions/36057383/how-to-post-data-in-amazon-web-services-swift – Avijit Nagare Mar 22 '16 at 13:43