You can use the PackageInfo to query information about the application package. This works both on iOS and Android.
Or in async mode:
As noted on issue 20761, package_info on iOS
requires the Xcode build folder to be rebuilt after changes to the version string in
Clean the Xcode build folder with:
XCode Menu -> Product -> (Holding Option Key) Clean build folder.