react-native-package-time
v0.2.0
Published
Get the packaging time of the app.
Downloads
23
Maintainers
Readme
react-native-package-time
Get the packaging(build / compile) time for your app.
Installation
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.
Usage
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
});
API
| 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) |
How to run the example project
- 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.
Todo
- [x] Get the first installation time of the app.
- [x] Get the update installation time of the app.
License
MIT