Saturday 26 September 2020

Cannot list AWS S3 public folder items when using Android Amplify?

I am using the new Amplify aws sdk on my Android app and trying to list items from AWS S3 bucket just as mentioned in the Storage Amplify docs:

Amplify.Storage.list(
            "/",
            { result ->
                Log.i("MyAmplifyApp", "Total Items : " + result.items.size)
                result.getItems().forEach { item ->
                    Log.i("MyAmplifyApp", "Item: " + item.getKey())
                }
            },
            { error ->
                Log.e("MyAmplifyApp", "List failure", error)
                Toast.makeText(this, "Something went wrong. Please try again.", Toast.LENGTH_SHORT)
                    .show()
            }
        )

No matter what path i try i get back 0 items, any clue? (no error printed in logcat)

Note: user role/policy has acccess rights to s3 + using unauthenticated users or even authenticated users (cognito auth flow goes fine) + path exists + bucket exists and has objects.

Thanks in Advance!!!



from Cannot list AWS S3 public folder items when using Android Amplify?

No comments:

Post a Comment