gpt4 book ai didi

ios - 亚马逊 AWS AWSCognitoCredentialsProvider 初始化错误

转载 作者:行者123 更新时间:2023-11-28 09:11:21 25 4
gpt4 key购买 nike

我正在尝试通过在 iOS 8 Swift 应用程序的应用程序委托(delegate)中添加以下代码片段来初始化以创建默认服务配置。

按照亚马逊教程的指示 here我正在使用以下代码行:

//AWS Service Config
let credentialsProvider = AWSCognitoCredentialsProvider(
regionType: AWSRegionType.USEast1, identityPoolId: "us-east-13453454-92d1-234234-234234-3434")

let defaultServiceConfiguration = AWSServiceConfiguration(
region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)

AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = defaultServiceConfiguration

但是代码不会编译,因为 xCode 说我“调用中缺少参数‘identityId’的参数”

首先,这段代码直接来自亚马逊的教程,而且我没有 identiyID,只有一个 identitypoolid(在我的代码中被打乱)。

我该怎么做才能解决这个问题?

最佳答案

我不确定你是否使用了正确的初始化程序,试试 -

  let credentialsProvider = AWSCognitoCredentialsProvider.credentialsWithRegionType(
AWSRegionType.USEast1,
accountId: cognitoAccountId,
identityPoolId: cognitoIdentityPoolId,
unauthRoleArn: cognitoUnauthRoleArn,
authRoleArn: nil)
let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)
AWSServiceManager.defaultServiceManager().setDefaultServiceConfiguration(defaultServiceConfiguration)

关于ios - 亚马逊 AWS AWSCognitoCredentialsProvider 初始化错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29243064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com