【发布时间】:2019-02-11 20:16:57
【问题描述】:
我正在尝试使用 iOS 应用程序实现 lambda 函数。我按照 AWS 上本教程中的所有步骤操作:https://docs.aws.amazon.com/aws-mobile/latest/developerguide/how-to-ios-lambda.html。
但是当我添加以下行时:
let lambdaInvoker = AWSLambdaInvoker.default()
它会抛出这个错误:
*** 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.'
我将 awsconfiguration.json 文件添加到项目中,内容如下:
{
"Version": "1.0",
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "us-east-1:05aab771-99b5-4a9b-8448-de92fe86ba56",
"Region": "us-east-1"
}
}
},
"IdentityManager" : {
"Default" : {
}
}
}
应用程序在导入 AWSLambda 和 mobileClient 时运行良好,我可以使用 Cognito 验证凭证(我收到“欢迎使用 AWS”消息)
有什么想法吗??
【问题讨论】:
标签: ios swift amazon-web-services aws-lambda