Deleting Account Flow for iOS
casan142saas
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 iOS.
Steps in the Deleting Account Flow
The following steps take place when the user deletes an account:
- The user opens the app.
- The user left-swipes the account that she wants to delete.
- The app displays the Generate OTP and Delete options.

- The user taps the Delete option.
- The app displays a message prompting the user to confirm that she wants to delete the account.

- When the user taps Yes, the account is deleted. A message stating that the account has been deleted is displayed.
Deleting Account Flow Diagram
The following flow diagram shows the sequence of API calls that take place when an account for which CA Strong Authentication has been activated is deleted from the app.
iOS - 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.
iOS - Deleting Multiiple Accounts

Sample Code for the Deleting Account Flow
The following is sample code for deleting an account for which CA Strong Authentication has been activated:
//Code snippet for the Deleting Account flow //Get the AccountDetails object selected by the userAccountDetails *deleteAccount=[accountDetails objectAtIndex:indexPathToBeDeleted.row];//Call Delete Account API hereAuthenticationHandler * m3dsHandler = [[AuthenticationHandler alloc] init];AccountDeletionResponse * accountDeletionResponse = [m3dsHandler deleteAccount:deleteAccount];if(accountDeletionResponse != nil && [[accountDeletionResponse status] isEqualToString:@"SUCCESS"]) {//Handle Success Scenario} else {//Handle Failure Scenario}
Sample Code for the Deleting Multiple Accounts Flow
The following is sample code for the Deleting Multiple Accounts flow:
//Code snippet for the Deleting Multiple Accounts flowAuthenticationHandler * authenticationHandler = [[AuthenticationHandler alloc] init];//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.//BOOL deletionStatus = [authenticationHandler unenrollAccounts:true removeFromRemoteAll:true];// If user selects some existing accounts to be deletedBOOL deletionStatus = [authenticationHandler unenrollAccounts:accountsSelectedByUser removeFromRemote:true];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.}