This is what I ended up doing.
Step 1. The first section uses the PowerAppsforMakers data connector. You need to add this in connectors first. This basically counts the number of saved/published versions of the app. Courtesy of @Anonymous.
Step 2. Then I used a bit of a variation of the above from @mdevaney .
In app.startup..
ClearCollect(myAppVersions, PowerAppsforMakers.GetAppVersions("APPID"));
ClearCollect(myAppVersionsv2,Ungroup(myAppVersions,"value"));
ClearCollect(myAppVersionsv3,Filter(myAppVersionsv2, properties.lifeCycleId = "Published"));
Set(AppVersion, CountRows(myAppVersionsv3));
//load data from the offline collection if there is any
LoadData(OfflineAppVersion,"OfflineAppVersion",true);
Set(LocalAppVersion, Value(First(OfflineAppVersion).Value));
// check if the appversion matches the local saved version and if so, load data from local cache
If(LocalAppVersion <> AppVersion,
// ... do the stuff you want to do as well, like update the offline tables etc...
// then update the offline collection
ClearCollect(OfflineAppVersion, AppVersion);
//set the value of the local app version to the new app version
SaveData(OfflineAppVersion,"OfflineAppVersion")
)
Cheers
Stu