You could use the build API for that. See documentation here: https://docs.mendix.com/apidocs-mxsdk/apidocs/build-api/
But if you want to automate the right version you might want to put some special text in the description of the deployment package. Then in an afterstarup microflow retrieve the list of packages and filter on this text. You then have your latest deployed package and you could get the details of it with the API and update the fieldd that shows it to your users.
Regards,
Ronald
I always just set the version number as plain text on a page in the app each time I make a build.
In Mendix 9, it support Get device Info in nano flow.
You can get version number and build number from the device info.
https://docs.mendix.com/appstore/modules/native-mobile-resources/