How AWS-Cognito and DynamoDB will work for mobile development - iOS-Swift

I try to use AWS Cognito and AWS DynamoDB for my mobile application, also went through AWS documentation, but as I understand it, I use to get a new service that is somehow related to another, please help with the fact that it’s correct an approach. I am trying to clarify whether it is possible that I understood things wrong:

So, I have two screens: register , and another login

According to me, when a user logs in by placing their credentials, I create an id identifier and the data set that was successfully created here is the foe iOS Swift code:

 @IBAction func submitButtonAction(sender: UIButton)
 {
    var username = self.inputTfUn.text
    var pass = self.inputPAss.text

    let credentialProvider :AWSCognitoCredentialsProvider
    let syncClient :AWSCognito

    credentialProvider = AWSCognitoCredentialsProvider(regionType: AWSRegionType.USEast1, identityPoolId: "**your idetity id**")

    let configuration = AWSServiceConfiguration(region :AWSRegionType.USEast1, credentialsProvider: credentialProvider)

    AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration
    syncClient = AWSCognito.defaultCognito()


    credentialProvider.refresh().continueWithBlock { (task) -> AnyObject! in

    print(credentialProvider.identityId)

    let dataset = syncClient.openOrCreateDataset("UserData")

        dataset.setString(self.inputTfUn.text, forKey: "username")
        dataset.setString(self.inputPAss.text, forKey: "password")

        dataset.synchronize().continueWithBlock({ (task) -> AnyObject! in

            if(task.error == nil){
                print("success")
            }
            return nil
        })


    return nil
    }

}

`

when clicked send to AWS cognito:

cognito.

, , . DynamoDB. , , , , - . , ... , , - .

AWS Cognito AWS Dynamo DB.

+4
1

, Cognito ( ) . , Cognito. Cognito, .

, Amazon, Facebook, Google, Twitter OpenID Connect . , , .

Cognito AWS.

, , Cognito: http://docs.aws.amazon.com/cognito/devguide/identity/developer-authenticated-identities/

+2

Source: https://habr.com/ru/post/1617229/


All Articles