Get some state timestamps of app.
yarn add react-native-package-time
or
npm i react-native-package-time
Don't forget to run pod install
under your project /ios
folder.
import PackageTime from 'react-native-package-time';
// or
import { getPackageTime } from 'react-native-package-time';
// Unix timestamp, in milliseconds.
getPackageTime().then((time): nubmer => {
console.log(time); // 1638201352000
});
Method | Param | Return Type | iOS | Android | Description |
---|---|---|---|---|---|
getPackageTime() | - | Promise<number> |
true | true | The packaging(build / compile) time of App |
getFirstInstallTime() | - | Promise<number> |
true | true | The first install time of App (It will not change until uninstallation) |
getLastUpdateTime() | - | Promise<number> |
true | true | The update install time of App (On iOS, Version or Build changes is required) |
- Clone the code from master branch.
- Go into the root directory of this project, and run
yarn
ornpm install
. - Go into the
/example/ios
directory, and runpod install
. (Optional, only for running example on iOS device) - Under the directory
/example
, runyarn android
ornpm run android
for Android device, andyarn ios
ornpm run ios
for iOS device.
- Get the first installation time of the app.
- Get the update installation time of the app.
MIT