2016-06-15 96 views
3

我正在嘗試使用AWS Cognito用戶池爲我的swift iOS應用程序添加登錄/註冊功能。我用Cocoapods建立了我的xcworkspace。在我的App Delegate中,我已經設置了我的Credentials Provider和Service Configuration,如下所示。AWS用戶池設置(Swift)

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

任何幫助或洞察力將不勝感激感謝

+0

通過安裝並導入AWSCognitoIdentityProvider – jackets14

回答

2

進口AWSCognitoIdentityProvider

還必須將其添加到項目中並導入到AppDelegate類中,以便可以訪問該方法。

相關問題