
#Facebook chat app for mac swift tutorial how to#
The following code sample shows how to do this with Facebook: let token = FBSDKAccessToken.currentAccessToken().tokenStringĬredentialsProvider.logins = To get an identity, you can update the credentials provider login map with a token acquired after logging in with an external provider. USEast1, credentialsProvider: credentialsProvider)Īfault().defaultServiceConfiguration = configuration Let configuration = AWSServiceConfiguration(region. USEast1, identityPoolId: "YOUR_IDENTITY_POOL_ID") let credentialsProvider = AWSCognitoCredentialsProvider(regionType.

The default service configuration can only be set once. Following that, initialize a configuration object with the credentials provider to access other AWS services. You can get credentials in Swift by initializing AWSCognitoCredentialsProvider with a region and an identity pool ID. To use Amazon Cognito in a Swift class, add the following to the top of the class: import AWSCore The following should be added to your Podfile: pod 'AWSCognito'

You can use Cocoapods to import Amazon Cognito into your Swift project. Importing Amazon Cognito into a Swift project

These releases are all compliant with Swift 2.0. Today we have released Swift sample code in the Amazon Cognito console so that developers can choose the language they prefer for iOS development. Swift, the newest programming language for iOS, OS X, and WatchOS is flexible and easy to learn.
