This knowledge article contains important information about:
Your iOS or Android Mobile Publisher for Experience Cloud app is impacted if its associated Experience Cloud site allows guest users to self-register.
Apple may reject Mobile Publisher for Experience Cloud apps associated with those sites that are submitted to the App Store, after June 30, 2022. Similarly, Google may reject Mobile Publisher for Experience Cloud apps associated with those sites that are submitted to Google Play, after December 7, 2023.
In both cases, your app can be rejected even if the submission consists of an update to an app that's already published.
Before June 30, 2022 for iOS apps and before December 7, 2023 for Android apps, you need to allow your users to initiate the deletion of their data from within the Experience Cloud site. The process is:
Use the Customizable User Settings component to show users a button to initiate the deletion of their data on their site’s My Settings page.
It’s recommended that you customize the Deactivate Account Button label, and other Deactivate Account user settings, in the component’s property editor to use the term Delete rather than Deactivate. This customization ensures that you meet Apple’s account deletion requirements and Google’s account deletion requirements.
You may not want to use the Customizable User Settings component to initiate the deletion of their data. For example, you may have special branding requirements. Instead, you can build your own custom component or use a Flow component. See the example below for details on using a Flow component for this purpose.
After a user initiates the deletion of their data, delete all the user’s data stored in the Salesforce platform, as per your local data protection and privacy regulations. For information on deleting user data from the Salesforce platform, refer to Data Deletion for Experience Cloud Sites, Data Deletion for the Salesforce Platform, and Let Users Scramble Their User Data.
You can also use a Flow component to receive a notification when a user initiates deletion of their data, as explained below.
Using an Apex query, you can programatically revoke the app user’s OAuth access token and delete their ThirdPartyAccountLink (TPAL). Note that Apex queries that return multiple tokens and TPALs, can result in performance issues and rapidly reach the transaction limit. You can get around this limit by performing queries in a batch job. Examples are shown below.
The recommended method for allowing users to initiate the deletion of their data is by using the Customizable User Settings component. However, you may want to instead use a Flow component, as explained here.
You need to know if a user has initiated the deletion of their data, so that you can then delete their data. One way to do this is by modifying the flow created in the previous example.
Query the OauthToken object with the userId of the user who wants to initiate deletion of their account. You can filter the query by appName to return the app tokens you want. If you are using flows, note that flows do not allow create, update, or delete actions to be taken in the same transaction (which is a single method in Apex) as a lookup or callout.
public void revokeToken(String userId){
//Look up OauthTokens for the user
List< OauthToken > tokens = [SELECT ID, DeleteToken FROM OauthToken
WHERE userid =: userId AND AppName = '<AppName>';
//Contruct the url to hit the revoke token endpoint with desired token
String baseUrl = '<base myDomain>';
String revokeEndpoint = '/services/oauth2/revoke?token=';
String tokenEncoded = EncodingUtil.URLENCODE(tokens[0].DeleteToken,'UTF-8');
baseUrl += revokeEndpoint += tokenEncoded;
//Http request to actualy hit the endpoint
HttpRequest req = new HttpRequest();
req.setEndpoint(URL);
req.setHeader('Content-Type','application/x-www-form-urlencoded');
req.setMethod('GET');
Http http = new Http();
HttpResponse res = http.send(req);
system.debug('Response was: '+res);
}
Use the userId of the user who wants to initiate deletion of their account to query for all associated TPALs. The query then deletes each returned TPAL.
A few things to note:
List<ThirdPartyAccountLink> tpals = [select Id, UserId, SsoProviderId, Provider, RemoteIdentifier from ThirdPartyAccountLink where UserId = '005xx00000#####'];
for (ThirdPartyAccountLink tpal : tpals) {
Auth.AuthToken.revokeAccess(tpal.SsoProviderId, tpal.Provider, tpal.UserId, tpal.RemoteIdentifier);
}
000392376

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.