• Home
  • Features
  • Pricing
  • Contact
  • Account
  • Home
  • Features
  • Pricing
  • Contact
  • Account
Home/Knowledge Base/Special Customisations/How to Force App Users to Update Their App to the Latest Version

How to Force App Users to Update Their App to the Latest Version

349 views 4

Written by Ferdousur Rahman
October 8, 2024

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

  1. 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.
  2. 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.

Was this helpful?

4 Yes  2 No
Related Articles
  • How to Dynamically Change the Items of Bottom Navigation Bar
  • How to set user information to identify user for sending push notification to specific user
  • How to add a custom Back Button to go to the previous page?
  • How to show only icons in the Bottom Nav Bar?
  • How to display Dropdown Menus in Navigation Drawer

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

  How to set user information to identify user for sending push notification to specific user

How to add a custom Back Button to go to the previous page?  


Appilix
About
  • Contact Us

  • Privacy Policy

  • Refund Policy

  • Terms & Conditions

Discover
  • FAQs

  • Plans & Pricing

  • Changelogs

Resources
  • Web to App

Connect With Us

© 2024 Appilix. All Rights Reserved

  • Privacy Policy

  • Terms & Conditions