Delete user account
Invoke the deleteUser
API to delete a user from the Auth category. This action will also sign your user out.
If your application uses a Cognito User Pool, which is the default configuration for the Amazon Cognito plugin, this action will delete the user from the Cognito User Pool. It will have no effect if you are federating with a Cognito Identity Pool alone.
Amplify.Auth.deleteUser( () -> Log.i("AuthQuickStart", "Delete user succeeded"), error -> Log.e("AuthQuickStart", "Delete user failed with error " + error.toString()));
Amplify.Auth.deleteUser( { Log.i("AuthQuickStart", "Delete user succeeded") }, { Log.e("AuthQuickStart", "Delete user failed with error", it) })
try { Amplify.Auth.deleteUser() Log.i("AuthQuickStart", "Delete user succeeded")} catch (error: AuthException) { Log.e("AuthQuickStart", "Delete user failed with error", error)}
RxAmplify.Auth.deleteUser() .subscribe( () -> Log.i("AuthQuickStart", "Delete user succeeded"), error -> Log.e("AuthQuickStart", "Delete user failed with error " + error.toString()) );