Though we can ask users to clear their browser cache and cookies is an option, which is not always feasible, Therefore i will suggest following two solutions-
A. Use a central data source to store app version:
1. Create a data source (e.g., SharePoint or Dataverse) with a record like:
{SettingName: "AppVersion", SettingValue: "1.0.1"}
2. On App Start, fetch the latest app version:
Set(CurrentVersion, "1.0.1"); // Local app version
Set(ServerVersion, LookUp(AppSettings, SettingName = "AppVersion").SettingValue);
3. Compare versions and reload if needed:
If(ServerVersion <> CurrentVersion,
Notify("A new version of the app is available. Reloading...", NotificationType.Information);
Exit(true);
);
4. Publish the updated app and increment the SettingValue in the data source.
B. Use local storage for version control:
1. Load the locally stored version on app load:
LoadData(LocalAppVersion, "LocalVersion", true);
If(IsBlank(LocalAppVersion),
Set(LocalAppVersion, "1.0.1"); // Default to the current version
);
2. Compare the local version with the server version and update:
If(ServerVersion <> LocalAppVersion,
Notify("A new version is available. Reloading...", NotificationType.Information);
SaveData(ServerVersion, "LocalVersion");
Exit(true);
);
3. Refresh the app to ensure users always get the latest version.