Check version of app before request

I tried to take a look at how to update the application using a cordova plugin, unfortunately they do not seem stable solutions to me so I will opt to have the user download the application from an online site. my question is this is it possible to do a check before each request so as to verify that there is not an important update?

I have a custom api request wrapper function, which checks every api response. The api adds required version to each response in the headers.

Inside my app www folder I have a config.json which contains the app package version when I upload them to the appstores. (Maybe this can be checked through a plugin, but never searched)

The api wrapper function checks for the minimal required version from the api request. If it passes, it just forwards the response data to the calling function, and if it fails it redirects the app main view to a “Update required” page.

I will not use AppStore/Playstore, but it’s not a bad idea, since I already have a user verification for each operation, I could also add the program version control in the back-end part.
For now, thank you :slight_smile:

:+1:t2: Might be useful as well: in the same status header, the API adds the base url for images. The API wrapper function sets this on app root level, and prepends it to all image urls from the server. This way, I can easily change the images source on API side, from our dynamic image api to static CDN for caching purposes.