Add info.firstInstallTime and info.lastUpdateTime from Android PackageInfo.

parent 5e1740de
...@@ -97,6 +97,8 @@ public class RNDeviceModule extends ReactContextBaseJavaModule { ...@@ -97,6 +97,8 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
PackageInfo info = packageManager.getPackageInfo(packageName, 0); PackageInfo info = packageManager.getPackageInfo(packageName, 0);
constants.put("appVersion", info.versionName); constants.put("appVersion", info.versionName);
constants.put("buildNumber", info.versionCode); constants.put("buildNumber", info.versionCode);
constants.put("firstInstallTime", info.firstInstallTime);
constants.put("lastUpdateTime", info.lastUpdateTime);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment