Unity AWS S3 GetPreSignedURLAsync is not working on android

0

Hi, Using Unity AWS libraries, AmazonS3Client.GetPreSignedURLAsync () is working well on windows but not on android. The callback is never called. Any ideas what is going on?

First the auth is using cognito:

 _credentials = new CognitoAWSCredentials(IdentityPoolId, _CognitoPoolRegion);
 _s3Client = new AmazonS3Client(_credentials, _S3ClientRegion);

The code using it :

GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
{
    BucketName = bucketName,
    Key = url,
    Expires = DateTime.Now.AddHours(S3_ASSET_EXPIRATION_HOURS)
};
Debug.Log("AWS asking to sign: " + url);
Debug.Log("AWS " + Credentials != null ? Credentials.ToString() : "Null");
Debug.Log("AWS " + Credentials.IdentityPoolId);

S3Client.GetPreSignedURLAsync(request, (response)  => {

    // *** This is never called on Android

    Debug.Log("AWS Signed response: " + response.Response.HttpStatusCode);
    
    if (response.Exception == null)
    {
        Debug.Log("AWS: Found signed URL " + response.Response.Url);
        tcs.SetResult(response.Response.Url);
    }
    else
    {
        tcs.SetResult("");
        Debug.LogError("[GetUrl] GetPresignedURL failed with exception: " + response.Exception.ToString());
    }
});

Thanks !

  • Note that I tried using GetObjectAsync() and I have the same behaviour.

질문됨 2년 전283회 조회
1개 답변
0

I finally found that the Unity SDK is not working . I changed to the .NET 2.1 SDK from nuGet and now it is working. So there is definitely something wrong with the Unity Asynchronous SDK.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠