Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let credentialsProvider = AWSCognitoCredentialsProvider(regionType: config.region, identityPoolId: config.identityPoolId)
- let configuration = AWSServiceConfiguration(region: config.region, credentialsProvider: credentialsProvider)
- AWSServiceManager.default().defaultServiceConfiguration = configuration
- func setupGatewayClient() {
- guard let configuration = AWSServiceManager.default().defaultServiceConfiguration else {
- return
- }
- gatewayClient = AWSAPIGatewayClient()
- gatewayClient.configuration = configuration.copy() as! AWSServiceConfiguration
- let URLString: String = <My endpont URL>
- let endpoint = AWSEndpoint(region: configuration.regionType, service: .APIGateway, url: URL(string: URLString))
- gatewayClient.configuration.endpoint = endpoint
- let signer: AWSSignatureV4Signer = AWSSignatureV4Signer(credentialsProvider: configuration.credentialsProvider, endpoint: endpoint)
- if let endpoint = endpoint {
- gatewayClient.configuration.baseURL = endpoint.url
- }
- gatewayClient.configuration.requestInterceptors = [AWSNetworkingRequestInterceptor(), signer]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement