0
我目前无法使用AWS Mobile Helper在Swift中调用lambda。如何使用AWS Mobile Hub Helper调用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)")
})
谢谢布鲁斯的简图。我已经阅读过你的精彩PDF。这是否意味着我必须实现其他的东西只是为了调用lambda函数? – Domsware
我跟随你的示例,将东西添加到Info.plist。事情更进一步,但仍然有一个崩溃,并且这个日志:'***终止应用程序由于未捕获的异常'NSInternalInconsistencyException',原因:'服务配置是'nil'。在使用这种方法之前,您需要配置Info.plist或设置defaultServiceConfiguration。'' – Domsware
我比较了您的示例和AWS给出的示例,尝试了解缺少的要点。他们真的不同! – Domsware