我目前无法使用 AWS Mobile Helper 在 Swift 中调用 lambda。
我已成功配置我的项目以使用 Cognito 用户池和 Cognito 联合身份识别用户。
但是现在调用 lambda 函数会导致崩溃:
terminating with uncaught exception of type NSException
崩溃前有以下日志:
AWSiOSSDK v2.4.11 [Debug] AWSInfo.m line:122 | -[AWSServiceInfo initWithInfoDictionary:checkRegion:] | Couldn't read the region configuration from Info.plist for the client. Please check your `Info.plist` if you are providing the SDK configuration values through `Info.plist`.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The service configuration is `nil`. You need to configure `Info.plist` or set `defaultServiceConfiguration` before using this method.'
这是代码:
let lambda = AWSLambda.defaultLambda()
lambda.invoke(myRequest, completionHandler: {
(myAnswer: AWSLambdaInvocationResponse?, error: NSError?) in
print("ERROR HERE: \(error)")
let payload = myAnswer?.payload
print("PAYLOAD HERE: \(payload)")
})