我想通过在iOS 8 Swift应用程序的应用程序委托中添加以下代码片段来初始化以创建默认服务配置。亚马逊AWS AWSCognitoCredentialsProvider初始化错误
遵医嘱亚马逊教程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’”
首先,这段代码直接来自Amazon的教程,也没有identiyID,只是一个identitypoolid(在我的代码中混杂)。
我能做些什么来解决这个问题?
这听起来像你可能没有最新版本iOS的SDK的。请确保您使用的是最新版本,因为并非所有版本都支持简化的构造函数。 – 2015-03-24 23:29:34