Deleting Account Flow for Android
casan141saas
A user can delete an account from the app at any point of time.
The user’s on-boarded record with the CA solution remains intact even after the user deletes all the accounts from the app.
This section covers the following topics:
For information about the APIs mentioned in these topics, see API Reference for Android.
Steps in the Deleting Account Flow
The following steps take place when the user deletes an account:
- The user opens the app.
- The user taps the ACTION ON ACCOUNT button.
- The app displays the accounts.
- The user long-taps the account that she wants to delete.

- The user taps the Delete Account option.
- The app displays a confirmation prompt.

- After the user taps YES, the account is deleted.
Deleting Account Flow Diagram
The following flow diagram shows the sequence of API calls that take place when the user deletes an account for which CA Strong Authentication has been activated.
Android - Deleting Account

Deleting Multiple Accounts Flow Diagram
The following flow diagram shows the sequence of API calls that take place when the user deletes multiple accounts for which CA Strong Authentication has been activated.
Delete Multiple Accounts - Android

Sample Code for the Deleting Account Flow
The following is sample code for the Deleting Account flow:
//Create an object of the AuthenticationHandler class.AuthenticationHandler handler = new AuthenticationHandler(<YourActivityName>.this);//Create a AccountDeletionResponse object to hold the response of the deleteAccount API.AccountDeletionResponse response = handler.deleteAccount(AccountDetailsObject);if (response.getStatus.equals(“SUCCESS”)) { //Delete the account whose details are given in the response object.} else { //Display a message corresponding to the status.}
Sample Code for the Deleting Multiple Accounts Flow
The following is sample code for the Deleting Multiple Accounts flow:
//Create an object of the AuthenticationHandler class.AuthenticationHandler handler = new AuthenticationHandler(<YourActivityName>.this);//If user selects all existing accounts to be deleted//If removePinSetup = true, then remove all the accounts and also the PIN that the user had set up//Else removePinSetup = false, then remove all the accounts but retain the PIN//If removeFromServer = true, then remove the accounts from the CA Strong Authentication server.//If removeFromServer = false, then do not remove the accounts from the CA Strong Authentication server. Only remove the accounts from the SDK.//boolean deletionStatus = handler.unenrollAccounts(removePinSetup, removeFromServer);//If user selects some existing accounts to be deletedboolean deletionStatus = handler.unenrollAccounts(accountDetails, removeFromServer); if (deletionStatus) { //Display a message stating that the specified accounts have been deleted.} else { //Display a message stating that the specified accounts could not be deleted.}