AWS iOS SDK v2 と Facebook iOS SDK v2.2 を使用しています。Facebook トークンを AWS 資格情報プロバイダーの「ログイン」として使用しようとしています。問題は、iOS Swift でログインを設定する方法がわからないことです。以下は私のコードです:
if (FBSession.activeSession().state == FBSessionState.CreatedTokenLoaded) {
// If there's one, just open the session silently, without showing the user the login UI
FBSession.openActiveSessionWithReadPermissions(["public_profile", "email", "user_friends"], allowLoginUI: false, completionHandler: { (fbSession, fbSessionState, error) -> Void in
// Handler for session state changes
// This method will be called EACH time the session state changes,
// also for intermediate states and NOT just when the session open
if (error == nil) && (fbSessionState == FBSessionState.Open) {
var token: String = fbSession.accessTokenData.accessToken
var logins: NSDictionary = NSDictionary(dictionary: ["AWSCognitoLoginProviderKey.Facebook" : token])
self.credentialsProvider.logins = logins
self.credentialsProvider.refresh()...}
しかし、ログイン辞書が正しいとは思いません...私は試しました
[AWSCognitoLoginProviderKey.Facebook : トークン]
しかし、XCodeはNSCopyingに準拠していないと言っています。
ヒントは大歓迎です!ありがとう!!!