Aws-sdk-ios: AWS 2.4.9 and deploying iOS SDK from API Gateway console

Created on 4 Oct 2016  路  9Comments  路  Source: aws-amplify/aws-sdk-ios

How do I deploy an IOS SDK for my app that is compatible with a specific AWS SDK version?

I'm trying to use AWS 2.4.9 buy Xcode complains that my Client API is missing members.
E.g., Value of type 'XxClient' has no member 'invokeHHTPRequest'
E.g., Cannot assign to property: 'configuration' is a get-only property

Most helpful comment

it is infact documented in the README that comes with the downloaded zip. Here is the part that calls out the bridging header setting

1. Add all files (`*.swift` and `*.h` files) under the `generated-src` directory to your Xcode project. The generated-src already includes the Bridging header file (Bridging_Header.h), include that file in your build settings for xcode target. If you already have a bridging header then add 

        #import "AWSApiGatewayBridge.h"

to your list of imports in the bridging header.

All 9 comments

are you using objective C or swift? I believe its swift. Can you make sure you have followed readme instructions?

I'm having the same issue with Swift 3 Xcode 8 IOS10. Following the README instructions for the Framework implementation. Do you guys have an updated version of the generated SDK for IOS10?

I am having the same issue with Swift 3, Xcode 8 and iOS10. I have Embedded the Binaries for AWSCore.framework and AWSAPIGateway.framework and added the Script Phase after the Embed Frameworks phase. The value of type xxClient has no member 'invokeHTTPRequest'.

Yes @karthiksaligrama I'm using Swift.
I've followed the instructions.

The file generated by AWS Gateway API as part of my iOS deployment includes two imports:

`import AWSCore
import AWSAPIGateway`

But it just looks like the AWS deployment is writing out older code and is not compatible with AWS 2.4.9.

E.g.,

`   init(configuration: AWSServiceConfiguration) {
    super.init()

    self.configuration = configuration
    var URLString: String = "https://########.execute-api.us-east-1.amazonaws.com/dev"
    if URLString.hasSuffix("/") {
        URLString = URLString.substringToIndex(URLString.startIndex.advancedBy(URLString.lengthOfBytesUsingEncoding(NSUTF8StringEncoding) - 1))
    }
    self.configuration.endpoint = AWSEndpoint(region: configuration.regionType, service: .APIGateway, URL: NSURL(string: URLString)!)
    let signer: AWSSignatureV4Signer = AWSSignatureV4Signer(credentialsProvider: configuration.credentialsProvider, endpoint: configuration.endpoint)
    self.configuration.baseURL = configuration.endpoint.URL
    self.configuration.requestInterceptors = [AWSNetworkingRequestInterceptor(), signer]
}`

In 2.4.9 self.configuration and self.configuration.endpoint are both defined as readonly by 2.4.9 -- so why is Gateway API deployment writing code that tries to set them?

Shouldn't Gateway API be writing code such as:

`AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration`

I don't know how endpoiint would be set but setting this will also need to be updated.

Undocumented but the clue is in the filename chosen by AWS: AWSApiGatewayBridge.h.

In your "projectname-Bridging-Header.h" file add this line: #import "AWSApiGatewayBridge.h"

Sorted!

it is infact documented in the README that comes with the downloaded zip. Here is the part that calls out the bridging header setting

1. Add all files (`*.swift` and `*.h` files) under the `generated-src` directory to your Xcode project. The generated-src already includes the Bridging header file (Bridging_Header.h), include that file in your build settings for xcode target. If you already have a bridging header then add 

        #import "AWSApiGatewayBridge.h"

to your list of imports in the bridging header.

thanks for replying @karthiksaligrama
apologies for overlooking this -- I must be downloading a different version.
I went to https://github.com/aws/aws-sdk-ios and clicked "Clone or download > Download ZIP"
I'm then looking at README.md in the root of the zip file. It has no mention of 'bridge'.

I'm talking about the README that comes with the downloaded zip from API gateway not github

Sorted. I'll switch from github for AWS code and stick to your API gateway.
thank!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohab2014 picture mohab2014  路  4Comments

mackoj picture mackoj  路  5Comments

pawlowskialex picture pawlowskialex  路  4Comments

anbarasu0504 picture anbarasu0504  路  3Comments

premiumbosslimited picture premiumbosslimited  路  3Comments