---
schema_version: "1"
id: 9cccdeb7881f6504a2dccc9976c62e81a52b6ea4b048da139bdead4b35dde141
title: Override Android App Links to Your Mobile Publisher App
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/branded_apps_override_links_android.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.branded_apps_override_links_android.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fcd9fc1c665211be105607eb15e3d02799f0939aef14901f44172579853a49d9
description: Mobile Publisher for Experience Cloud apps support app links on Android. By default, when a user taps an app link to your Mobile Publisher app, the link opens to the page inside your app. To override the default behavior and set certain links to open outside of your app, use an Apex class and a Visualforce page. For example, if you want the link to your app’s registration page to open in a web browser.
products:
  - Experiences
  - Mobile App
  - Cross Cloud
release: "264"
---
# Override Android App Links to Your Mobile Publisher App

Mobile Publisher for Experience Cloud apps support app links on Android. By default, when a user taps an app link to your Mobile Publisher app, the link opens to the page inside your app. To override the default behavior and set certain links to open outside of your app, use an Apex class and a Visualforce page. For example, if you want the link to your app’s registration page to open in a web browser.

Complete these steps to override the default behavior of app links to your Android app.

1. Create an Apex class named ReDirectToCustomUniversalAndAppLinks.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-branded_apps_exp_cloud-264-0-0-production-enus/cf85363c-215e-4784-bb6a-c5c83c4e7140/images/icon_note.png)
    
    Note You must use the same Apex class for both the Android and iOS versions of your app. If you already created the ReDirectToCustomUniversalAndAppLinks Apex class for the iOS version of your app, continue to step 2.
    
    1. From Setup, in the Quick Find box, enter Apex Classes, and then select **Apex Classes**.
    2. Click **Developer Console**.
    3. In the Developer Console, click **File**, select **New**, and then select **Apex Class**.
    4. Name the class ReDirectToCustomUniversalAndAppLinks.
    5. Add this code to the Apex class.
        
        ```java
        global class ReDirectToCustomUniversalAndAppLinks implements Site.UrlRewriter {
          global PageReference mapRequestUrl(PageReference srcUrl) {
            String url = srcUrl.getUrl();
            // Code for Android
            if (url!=null && url.endsWith('assetlinks.json')) {
              url = '/CustomAssetLink';
              return new PageReference(url);
            }
            // Code for iOS
            if (url!=null && url.endsWith('apple-app-site-association')) {
              url = '/CustomAASA';
              return new PageReference(url);
            }
          return null;
        }
        global PageReference[] generateUrlFor(PageReference[] srcUrls) {
          return null;
        }
        }       
        ```
2. [Create a Visualforce page](https://help.salesforce.com/s/articleView?id=platform.pages_creating.htm&type=5&language=en_US) named CustomAssetLink.
3. Edit this sample Visualforce markup to define the pages in your Experience Cloud site to open outside of your app.
    
    1. For the value of package\_name, replace YOUR\_ANDROID\_APP\_PACAKGE\_NAME with your app’s package name.
    2. For the value of sha256\_cert\_fingerprints, replace the example value with your app’s SHA-256 fingerprint.
    3. To override certain links to your app, add and define new values in the relation field.
    
    CustomAssetLink.vfp
    
    ```
    <apex:page standardStylesheets="false" sidebar="false"
                          showHeader="false"
                          applyHtmlTag="false"
                          applyBodyTag="false" contentType="text/json">
    [
      {
        "relation": [
          "delegate_permission/common.handle_all_urls"
        ],
        "target": {
          "namespace": "android_app",
          "package_name": "YOUR_ANDROID_APP_PACAKGE_NAME",
          "sha256_cert_fingerprints": [
         "AB:C1:2D:E3:FG:45:67:8H:IJ:K9:01:23:LM:2N:OP:Q4:R5:67:ST:8U:90:12:V3:45:6W:XY:78:9Z:AB:C0:1D:23"
          ]
        }
      }
    ]
    </apex:page>
    ```
4. Enter the edited markup into the **Visualforce Markup** field of the CustomAssetLink Visualforce page, and save.
5. Make the CustomAssetLink Visualforce page available to your Experience Cloud site and mobile app.
    
    1. From Setup, in the Quick Find box, enter Visualforce Pages, and then select **Visualforce Pages**.
    2. Click the CustomAssetLink label for the Visualforce page that you created.
    3. In the Page Detail settings, select **Available for Lightning Experience, Experience Builder sites, and the mobile app**.
    
    ![The Visualforce page settings for CustomAssetLink](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-branded_apps_exp_cloud-264-0-0-production-enus/cf85363c-215e-4784-bb6a-c5c83c4e7140/branded_apps_exp_cloud/images/branded_apps_link_override_customassetlink.png)
6. Enable the CustomAssetLink Visualforce page for your Experience Cloud site.
    1. From Setup, in the Quick Find box, enter Sites, and then select **Sites**.
        
        ![Entering Sites in the Setup Quick Find box and the link to Sites](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-branded_apps_exp_cloud-264-0-0-production-enus/cf85363c-215e-4784-bb6a-c5c83c4e7140/branded_apps_exp_cloud/images/branded_apps_link_override_sites.png)
    2. Click the site label for your Mobile Publisher app’s Experience Cloud site.
    3. Click **Public Access Settings**.
    4. Click **Enabled Visualforce Page Access**.
        
        ![The link to Enabled Visualforce Page Access from the top of a site's profile page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-branded_apps_exp_cloud-264-0-0-production-enus/cf85363c-215e-4784-bb6a-c5c83c4e7140/branded_apps_exp_cloud/images/branded_apps_link_override_visualforce.png)
    5. Click **Edit**, and then add the CustomAssetLink page to the list of enabled Visualforce pages.
    6. Save your changes.
7. Set the ReDirectToCustomUniversalAndAppLinks Apex class as the URL rewriter for your Experience Cloud site.
    1. In the Site Detail section of your Experience Cloud site, click **Edit**.
        
        ![The Edit button at the top of a site's detail page](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-branded_apps_exp_cloud-264-0-0-production-enus/cf85363c-215e-4784-bb6a-c5c83c4e7140/branded_apps_exp_cloud/images/branded_apps_link_override_site_details.png)
    2. In the URL Rewriter Class field, search for and select the ReDirectToCustomUniversalAndAppLinks Apex class.
    3. Save your changes.