Start a new topic

DeleteAsync cannot delete user permanently

I am now using Xamarin forms to develop app. I need to delete a user permanently if his/her email is not confirmed. The sample code is like that 
User userABC = await User.LoginAsync("abc", "123"); // log in is always successful 
string status = theUser.Metadata.EmailVerification.Status; 
if (status != "confirmed") { 
await _client.ActiveUser.DeleteAsync(userABC.Id, true); // _client is my client object 
_client.ActiveUser?.Logout(); 
return false; } 

The problem is that DeleteAsync only disable the user despite I set "true" for the second parameter. I also tried delete a different user, like this, in which the ID "5dddfaf3af335900184d0f13" is directly copied from the user database await _client.ActiveUser.DeleteAsync("5dddfaf3af335900184d0f13", true); It only disable the user with ID being "5dddfaf3af335900184d0f13", not "hard" delete the user. BTW, I set "always" for create, read, update and delete for the user roles. Can you tell me how to delete a user permanently? Thank you. Jackie

Dear Pranav,


Thank you for the prompt reply. As for API console, you mean the Kinvey Console right? I can destroy (permanently delete) a user in the app's console page. But if I use Xamarin SDK, I can only disable a user regardless the parameter is true or false. I tried to check the KinveyDeleteResponse. The return value of DeleteAsync is null.


KinveyDeleteResponse res;

res = await _client.ActiveUser.DeleteAsync(userABC.Id, true); // res is null


I figured out the user was only disabled by checking the User collection in Kinvey console.


Thank you.

J


Hi J S,


Do you still see this user in the User collection on the Kinvey console even after removing it permanently as explained on this link? How did you figure out that it is only disabling the user instead of permanently deleting it from User collection? I tried removing a user from the API console as mentioned on this link and it worked fine. Can you check and confirm that it is working fine on API console but NOT from the Xamarin SDK?


Thanks,

Pranav

Login or Signup to post a comment