Closed DominusDRR closed 2 years ago
Hi @DominusDRR,
Good morning.
Could you please advise on how your region is configured for your Xamarin app?
Thanks, Ashish
Hi @DominusDRR,
Good morning.
Could you please advise on how your region is configured for your Xamarin app?
Thanks, Ashish
Hi. Thanks for writting.
It seems that I found a solution few minutes ago.
I got an example for Xamarin. Forms of this link:
https://github.com/Pietervdw/xamarinforms-awscognito
When reviewing the code and seeing how a provider is created, I changed the code to as follows:
Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient provider = new Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionEndpoint.USEast1);
Now the code doesn't freeze and goes to the next line:
I need to keep going through the rest of the code to determine other possible issues
@DominusDRR Thanks for confirming. Changing this to guidance
issue. Please close this issue once you are done scanning through rest of the code, OR, confirm if we could close this now since you have identified the solution.
hanks for confirming. Changing this to
guidance
issue. Please close this issue once you are done scanning through rest of the code, OR, confirm if we could close this now since you have identified the solution.
Hi.
Confirmed, where to create a provider must be as follows: (Obviously the region must be correct)
AmazonCognitoIdentityProviderClient(new Amazon.Runtime.AnonymousAWSCredentials(), RegionEndpoint.YourRegionAWS;
Process to close the case. Thanks again.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description
Hi.
I'm using the AWS Samples C# project named aws-cognito-dot-net-desktop-app as a reference:
https://github.com/aws-samples/aws-cognito-dot-net-desktop-app
The code of this project I am using it with C # and WPF and it works correctly (app for desktop PC).
Now, I'm doing the exact same thing but with Android and C# in Visual Studio.
When you want to register a user, the task called SignUpUser is executed, but when trying to create a provider with Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient the code remains frozen in that line (deadlock)
This is an image of where the problem happens:
No exception or error message occurs.
It happens both in a real mobile phone and in a virtual phone.
It is as if some permission or something else needs to be enabled, even though internet and wifi permissions are enabled in the manifest.
Reproduction Steps
Create a project of type Xamarin (Not Xamarin Forms) with Visual Studio 2019
Copy or create the CognitoHelper class in the project, it is the same as aws-cognito-dot-net-desktop-app.
Do not forget to install all the packages that correspond to Amazon ()using Amazon.CognitoIdentity, using Amazon.S3.Model, etc)
From another class you can invoke the task of registering a user as follows:
CognitoHelper helper = new CognitoHelper(); bool success = await helper.SignUpUser("UserName", "passwword", "userEmail@gmail", "123456789");
Logs
Environment
Resolution
where to create a provider must be as follows: (Obviously the region must be correct)
AmazonCognitoIdentityProviderClient(new Amazon.Runtime.AnonymousAWSCredentials(), RegionEndpoint.YourRegionAWS)
This is a :bug: bug-report