Skip to main content

How to add delete account tab

IOS apps need to provide a way for users to delete their account. This tutorial will guide you through the steps of adding a delete account tab to your app on theme.

Solution 1: Add alert on your custom delete account button​

If you have your own custom delete account button on theme, you can add an alert to it. The button should only be visible on iOS and should trigger a confirmation alert when pressed.

import { Alert } from 'react-native';

Alert.alert(
'Delete Account',
'Are you sure you want to delete your account? ',
[
{
text: 'Cancel',
style: 'cancel',
},
{
text: 'Delete',
onPress: () => onAction({ action: 'DELETE_ACCOUNT' }),
style: 'destructive',
},
],
{ cancelable: true }
);

Solution 2: use default delete account tab​

You can use the default delete account tab. To do this, you need to add the following tab item to your myAccount page

{
name: 'appmaker/ActionButton',
clientId: 'delete-account-confirmation-button-yes',
attributes: {
appmakerAction: {
action: 'DELETE_ACCOUNT',
},
content: 'Delete account anyway',
baseSize: true,
wholeContainerStyle: {
backgroundColor: '#FECACA',
},
fontColor: '#B91C1C',
},
contextValues: true,
},