我正在尝试使用 AWS Cognito 用户池为我的 swift iOS 应用程序添加登录/注册功能。我已经用 Cocoapods 设置了我的 xcworkspace。在我的 App Delegate 中,我设置了我的凭证提供程序和服务配置,如下所示。
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let credentialsProvider = AWSCognitoCredentialsProvider(regionType: AWSRegionType.USEast1, identityPoolId: cognitoIdentityPoolId)
let defaultServiceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)
AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = defaultServiceConfiguration
return true
}
但是当我尝试设置用户池配置时:
let configurationUserPool = AWSCognitoIdentityUserPoolConfiguration(clientId: "###", clientSecret: "#########", poolId: "###")
我收到“使用未解析的标识符 AWSCognitoIdentityUserPoolConfiguration”的编译错误,我不明白这是因为我导入了 AWSCore 和 AWSCognito
任何帮助或见解将不胜感激
最佳答案
导入 AWSCognitoIdentityProvider
还必须添加到项目中并导入到您的 AppDelegate 类中,以便可以访问该方法。
关于ios - AWS 用户池设置 (Swift),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37839195/