0.2.0 • Published 3 years ago
react-native-package-time v0.2.0
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
yarnornpm install. - Go into the
/example/iosdirectory, and runpod install. (Optional, only for running example on iOS device) - Under the directory
/example, runyarn androidornpm run androidfor Android device, andyarn iosornpm run iosfor iOS device.
Todo
- Get the first installation time of the app.
- Get the update installation time of the app.
License
MIT