0
votes

I downloaded Amazon's samples: CognitoSyncDemo https://github.com/awslabs/aws-sdk-android-samples/tree/master/CognitoSyncDemo and tried to run it in unauthenticated mode. I followed Amazon's guide: created AWS account; created Identities Pool in Cognito; added roles in IAM.

But when I ran the sample app, populate some data into dataset and tried to sync them, it popup that : Failed due to Failed to list records in dataset: XXX(XXX is my dataset name).

The role policy I created for unauthenticate is as follows:

{
    "Version": "2012-10-17",
    "Statement": [{
        "Action": [
            "mobileanalytics:PutEvents",
            "cognito-sync:*",
            "sns:*"
        ],
        "Effect": "Allow",
        "Resource": [
            "*"
        ]
    }]
}

I am not sure if it was the role's problem.

Does anyone had such problem as well when you ran the CognitoSyncDemo provided by Amazon?

1

1 Answers

0
votes

The role policy looks sane. The details you provided are not enough to see what else is causing the problem, so this is a list of things you should verify:

  • From your Identity Pool in the Cognito Console, go to "Edit Identity Pool" and make sure that "Enable Access to unauthenticated Identities" is checked.
  • Make sure that the region (US-East or EU-West) in your AWS Console matches the region set in your app's code.
  • Make sure you have entered the correct roles ARN's in the app's source, together with the identity pool id and your AWS account.