react-native-native-build-info
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

react-native-build-info

RN build info

Installation

npm install react-native-native-build-info

Usage

import { getBuildTime } from "react-native-native-build-info";

// ...

const result = await getBuildTime();

Setup

Android

add this line to app/android/build.gradle

android {
  defaultConfig {
    ...
    buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
  }
}

iOS

add Run Script phase to the very bottom of Build Phases, add script below, clean & rebuild

infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
builddate=`date`
if [[ -n "$builddate" ]]; then
/usr/libexec/PlistBuddy -c "Add :CFBuildDate $builddate" ${infoplist}
/usr/libexec/PlistBuddy -c "Set :CFBuildDate $builddate" ${infoplist}
fi

License

MIT

Package Sidebar

Install

npm i react-native-native-build-info

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

24.2 kB

Total Files

18

Last publish

Collaborators

  • thelonelyastronaut