How to: Set the App Bar Title

Posted on 26. July 2024 by Jan Bunk


Sometimes you may want the app to display a different title than the title on your website. For example because you want a shorter title that doesn't get cut off or because you don't want any title in the app bar as a design choice.

Using the JavaScript Function

You might want to check out the executeWhenAppReady() function of our app helper script. It ensures that your website doesn't try to interact with the app before it's ready or when your website is loaded using a regular browser (ReferenceError, function is not defined).

setSpecialTitle

Use this function to set the title to your desired string.

Keep in mind that when the user navigates to a new page, the app will show the new page's title. If you want to override it, you need to call setSpecialTitle again.

<script>
    try {
        // if you want to remove the title from the app bar, pass "" as the argument
        setSpecialTitle("Title for the App Bar");
    }
    catch (e) {
        // Can occur if:
        // - the app couldn't connect to the native code. Should be very unlikely.
        console.log(e);
    }
</script>