Introduction
The Bahmni Connect metadata file present on the server decides whether the Bahmni Connect app on the devices needs to be upgraded or not.
The Bahmni Connect metadata file looks like this:
Code Block |
---|
language | js |
---|
title | offlineMetadata.json |
---|
linenumbers | true |
---|
|
{
"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]
} |
When the device is connected to the network, it reads the metadata file and determines whether it has an update. If there is an update, the 'Update' button will be shown in the header next to the 'Sync' button. The offlineMetadata.json is present at `/var/www/html/offlineMetadata.json'.
There are two kinds of updates:
- Forced update/Hard Update - this means that the version installed on the device is not compatible with the server and it needs to be upgraded for the data to get synced to server. In this case, each time the app tries to sync the data to the server, it shows a popup with a link/button to upgrade the app.
- Non-forced update/Soft Update - this means that the version installed on the device is still compatible with the server and it need not be upgraded immediately to get the data synced. In this case, sync happens smoothly even if the app is not upgraded.
Upgrading the Android App
For the Android app, the 'latestAndroidAppUrl' in the offlineMetadata.json contains the url of latest apk released. On clicking the Update button, the apk is downloaded from the specified url in offlineMetadata.json and installed automatically.
Upgrading the Chrome App
For the 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 the 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 the extension is loaded.
Note |
---|
The extension should not be deleted from the Chrome browser to update the app. Deleting the extension deletes the data as well. |