ios - AWS 用户池设置 (Swift)

标签 ios swift amazon-web-services

我正在尝试使用 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/

相关文章:

ios - 将 View Controller 推送到选项卡 Controller 中的 View 控件

ios - "Type of expression is ambiguous without more context"在 Swift 2 中的数组初始化

ios - NSURLSession 数据任务请求 :completion: unrecognized selector sent to instance

objective-c - swift 中的 keysSortedByValueUsingComparator

amazon-web-services - "Fn::Join"在配置文件中指什么?

ios - AFNetworking (iOS) - 响应不是 NSDictionary

iphone - 如何使用苹果的 KML 查看器示例代码显示多边形

ios - 如何修复 "An NSManagedObject of class ' ClassName' must have a valid NSEntityDescription"when using CoreData from a framework

mysql - 运行不相关查询的 AWS RDS MySQL 只读副本

amazon-web-services - 如何限制SQS队列中的消息数?