This article explains how to implement a mechanism that prompts users to update their app if they are using an outdated version. By adding a custom JavaScript code snippet to your website, you can ensure that users accessing your site through the app are notified to update their app to the latest version.
Overview
The provided JavaScript code checks the app version stored in the browser’s (app) localStorage. If the version is below a specified minimum required version, it displays a warning message along with a link to update the app.
Implementation Steps
- Access Your Website’s Code: Open the HTML file or the file that loads first in the app and where you want to add the update check.
- Insert the JavaScript Code: Copy and paste the following code snippet into your HTML file, preferably within the <head> or just before the closing </body> tag.
<script>
appilix.postMessage(JSON.stringify({ type: "show_app_update_prompt", props: { minimum_version_code: 5, // Prompt will be displayed on apps having version code less than the minimum_version_code force_update: false, // if true, users won't be able to cancel the prompt title: "Update Your App", description: "You are using the older version of this app. Please update the app to have better performance and functionality.", update_btn_text: "Update Now", update_url: "https://play.google.com/store/apps/details?id=com.ludo.king", // URL from where user will be able to update the app cancel_btn_text: "Continue Anyway", } }));
</script>
By implementing this JavaScript code, you can effectively manage app version updates and encourage users to keep their applications up to date.
Please note that it will only work if your published version of app is built after 05 September 2025.