The offline metadata file present on the server decides whether the Bahmni Connect app in the devices needs to be upgraded or not.
The offline metadata file looks like this:
{ "latestAndroidAppUrl": "https://www.dropbox.com/s/url/for/android/apk", "latestChromeAppUrl": "https://www.dropbox.com/s/url/for/chrome/app", "compatibleVersions": [0.79, 0.80] } |
The offlineMetadata.json will be present in `/var/www/html/offlineMetadata.json'.
When the device is connected to network, it reads the metadata file and determines whether it has a update. If there is an update, 'Update' button will be shown in the header next to 'Sync' button.
There are two kinds of update:
For android app, the 'latestAndroidAppUrl' in the offlineMetadata.json contains the url of latest apk released. On clicking on Update button, the apk is downloaded from the specified url in offlineMetadata.json and installed automatically.
For Chrome app, the 'latestChromeAppUrl' in the offlineMetadata.json contains the url from where the chrome extension tar file can be downloaded. On clicking the Update button, the link with the url is shown so that extension can be downloaded and installed manually.
To install the extension manually, the tar file has to be unzipped and put in the location from where extension is loaded.
Note: Extension should not be deleted from chrome browser to update the app. Deleting the extension deletes the data as well.