Unable to compile AWS CustomIdentityProvider on xcode 8 beta 6
Cast to NSDictionary instead of a Swift Dictionary:
return AWSTask(result: tokens! as NSDictionary)
Unable to compile AWS CustomIdentityProvider on xcode 8 beta 6
Cast to NSDictionary instead of a Swift Dictionary:
return AWSTask(result: tokens! as NSDictionary)
AWS and Changes in Swift 3
Nevermind, it turned out XCode just wasn't showing me the option to make the changes I needed. The automatic fix implemented slightly different versions of the required functions and everything ended up working.
AWS Cognito Swift credentials provider logins is deprecated: Use AWSIdentityProviderManager
After looking around I finally found out I wasn't the only one with this issue. AWS updated their sdk without changing their main documentation.
The solution is to implement the AWSCognitoIdentityProviderManager in a custom class and feed that to the credentials provider.
Heres the code provided by simaomi in the github discussion below (its more of a quick fix):
import Foundation
import AWSCore
import AWSCognito
import AWSCognitoIdentityProvider
class CustomIdentityProvider: NSObject, AWSCognitoIdentityProviderManager{
var tokens : [NSString : NSString]?
init(tokens: [NSString : NSString]) {
self.tokens = tokens
}
@objc func logins() -> AWSTask {
return AWSTask(result: tokens)
}
}
let customProviderManager = CustomIdentityProvider(tokens: logins!)
self.credentialsProvider = AWSCognitoCredentialsProvider(
regionType: Constants.COGNITO_REGIONTYPE,
identityPoolId: Constants.COGNITO_IDENTITY_POOL_ID,
identityProviderManager: customProviderManager)
the sdk example shows how you should really implement the solution
Look here for the discussion:
https://github.com/aws/aws-sdk-ios/issues/357
and here for updated sdk examples:
https://github.com/awslabs/aws-sdk-ios-samples/tree/developer-authenticated-identities-2-4/CognitoSync-Sample
Related Topics
How to Animate Dark Mode Change in iOS
Googlemap API Gives Wrong Coordinates for Direction Between Two Points
iOS App Breakpoints on Running
Hkanchoredobjectquery Not Returning Reliably in Background
Is There an iOS API for Accessing Call Logs
iOS 8 [Uiapplication Sharedapplication].Scheduledlocalnotifications Empty
Save Scrollviews Position and Scroll Back to It Later (Offset to Position)
How to Post Data Using Afnetworking 2.0
Uiactivityviewcontroller Subject Not Working for Outlook
Fastlane Boarding with Two-Factor Authentication
Should I Use Realm Objective-C or Realm Swift in My Mixed Objective-C/Swift Project
What Exactly Does ': Class' Do in a Protocol Declaration
Auto Layout How to Hide 1 View in a View with 3 Equal Width Views
Uiviewrepresentable Automatic Size - Passing UIkit UIview Size to Swiftui
How to Set Size Leftbarbuttonitem