1

I am wondering there is a way to access the applications version name/number via javascript in a react native application. I have a snippet of javascript which I inject into an application but I want to know the version of the application before I do some processing. Is there a straightforward way of doing this? I understand that I can use a module and then import that into an application.

The problem is that I have a javascript snippet that is downloaded over the air and injected into my application's WebView. However there are certain things that aren't available in the older versions of the application.

I want the javascript snippet to read the applications version number.

Is there a potential way around this?

Hades
  • 3,916
  • 3
  • 34
  • 74
  • you can `import packageJson from './package.json';` in your react native app to get the package `version` and `name`. If you are making a request, you can pass the version number to your server api/url to download version specific payload. – Amar Jul 11 '19 at 03:38

0 Answers0