Socket
Socket
Sign inDemoInstall

cordova-plugin-buildinfo

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-buildinfo

Cordova/Phonegap Build Information Plugin. Get PackageName, Version, Debug and more...


Version published
Weekly downloads
1.9K
increased by2.7%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Code Climate MIT License

cordova-plugin-buildinfo

This plugin defines a global BuildInfo object.

BuildInfo object is available at the time the deviceready event fires.

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
	console.log('BuildInfo.baseUrl        =' + BuildInfo.baseUrl);
	console.log('BuildInfo.packageName    =' + BuildInfo.packageName);
	console.log('BuildInfo.basePackageName=' + BuildInfo.basePackageName);
	console.log('BuildInfo.displayName    =' + BuildInfo.displayName);
	console.log('BuildInfo.name           =' + BuildInfo.name);
	console.log('BuildInfo.version        =' + BuildInfo.version);
	console.log('BuildInfo.versionCode    =' + BuildInfo.versionCode);
	console.log('BuildInfo.debug          =' + BuildInfo.debug);
	console.log('BuildInfo.buildType      =' + BuildInfo.buildType);
	console.log('BuildInfo.flavor         =' + BuildInfo.flavor);
	console.log('BuildInfo.buildDate      =' + BuildInfo.buildDate);
	console.log('BuildInfo.installDate    =' + BuildInfo.installDate);
}

Installation

cordova plugin add cordova-plugin-buildinfo

Supported Platforms

  • Android
  • iOS
  • Windows
  • Browser
  • Electron

Properties

  • BuildInfo.baseUrl
  • BuildInfo.packageName
  • BuildInfo.basePackageName
  • BuildInfo.displayName
  • BuildInfo.name
  • BuildInfo.version
  • BuildInfo.versionCode
  • BuildInfo.debug
  • BuildInfo.buildType
  • BuildInfo.flavor
  • BuildInfo.buildDate
  • BuildInfo.installDate
  • BuildInfo.windows
    • logo
    • version

BuildInfo.baseUrl

Get the cordova.js file exists path.
Path last character is '/'.

PlatformValueType
AndroidPathString
iOSPathString
WindowsPathString
BrowserPathString
ElectronPathString

BuildInfo.packageName

Get the packageName of Application ID.

PlatformValueType
AndroidPackage NameString
iOSBundle IdentifierString
WindowsIdentity nameString
BrowserGet the id attribute of the widget element in config.xml file.String
ElectronGet the id attribute of the widget element in config.xml file.String

BuildInfo.basePackageName

Android only.

Get the packageName of BuildConfig class.

If you use the configure of "build types" or "product flavors", because you can specify a different package name is the id attribute of the widget element of config.xml, is the property to get the package name that BuildConfig class belongs. (ought be the same as the id attribute of the widget element of config.xml)

PlatformValueType
AndroidPackage name of BuildConfig classString
iOSBundle Identifier(equals BuildInfo.packageName)String
WindowsIdentity name(equals BuildInfo.packageName)String
Browserequals BuildInfo.packageNameString
Electronequals BuildInfo.packageNameString

BuildInfo.displayName

Get the displayName.

PlatformValueType
AndroidApplication LabelString
iOSCFBundleDisplayNameString
WindowsGet the DisplayName attribute of the VisualElements element in AppxManifest.xml file.String
BrowserGet the short attribute of the name element in config.xml file.String
ElectronGet the short attribute of the name element in config.xml file.String

BuildInfo.name

Get the name.

PlatformValueType
AndroidApplication Label(equal BuildInfo.displayName)String
iOSCFBundleNameString
WindowsWindows Store display nameString
BrowserGet value of the name element in config.xml file.String
ElectronGet value of the name element in config.xml file.String

BuildInfo.version

Get the version.

PlatformValueType
AndroidBuildConfig.VERSION_NAMEString
iOSCFBundleShortVersionStringString
WindowsMajor.Minor.Build ex) "1.2.3"String
BrowserGet the version attribute of the widget element in config.xml file.String
ElectronGet the version attribute of the widget element in config.xml file.String

BuildInfo.versionCode

Get the version code.

PlatformValueType
AndroidBuildConfig.VERSION_CODEinteger
iOSCFBundleVersionString
WindowsMajor.Minor.Build.Revision ex) "1.2.3.4"String
Browserequals BuildInfo.versionString
Electronequals BuildInfo.versionString

BuildInfo.debug

Get the debug flag.

PlatformValueType
AndroidBuildConfig.DEBUGBoolean
iOSdefined "DEBUG" is trueBoolean
WindowsisDevelopmentMode is trueBoolean
BrowserAlways falseBoolean
ElectronTrue when cordova build electron --debug is executed with the "--debug" flag.Boolean

BuildInfo.buildType

Android , Windows Only.

Get the build type.

PlatformValueType
AndroidBuildConfig.BUILD_TYPEString
iOSempty stringString
Windows"release" or "debug"String
Browserempty stringString
Electronempty stringString

BuildInfo.flavor

Android Only.

Get the flavor.

PlatformValueType
AndroidBuildConfig.FLAVORString
iOSempty stringString
Windowsempty stringString
Browserempty stringString
Electronempty stringString

BuildInfo.buildDate

Get the build date and time in the Date object returns.

Attention:

  • Android: Add the BuildInfo.gradle file to your Android project.
    The BuildInfo.gradle file contains the setting to add the _BUILDINFO_TIMESTAMP field to the BuildConfig class.
  • Windows: Add the buildinfo.resjson file to your Windows project.
    The buildinfo.resjson file into the "strings" folder.
    And also add a task to rewrite buildinfo.resjson in the CordovaApp.projitems file.
  • Browser and Electron: When cordova prepare is executed Build date and time is embedded in
    platforms/browser/www/plugins/cordova-plugin-buildinfo/src/browser/BuildInfoProxy.js file.
    (Or platforms/electron/www/plugins/cordova-plugin-buildinfo/src/browser/BuildInfoProxy.js file.)
    cordova prepare is also executed for cordova build, cordova run and cordova platform add.
    (Reference: Hooks Guide - Apache Cordova)
PlatformValueType
AndroidBuildConfig._BUILDINFO_TIMESTAMP valueDate
iOSGet the modification date and time of the Info.plist file acquired from the executionPath property of the main bundle.Date
WindowsResource value of "/buildinfo/Timestamp" string.Date
BrowserThe date and time when cordova prepare was executed.Date
ElectronThe date and time when cordova prepare was executed.Date

BuildInfo.installDate

Get the install date and time in the Date object returns.

Attention:

  • Browser and Electron: Installation date and time is unknown.
PlatformValueType
AndroidThe firstInstallTime property of PackageInfoDate
iOSGet the creation date and time of the document directory.Date
WindowsThe installedDate property of Windows.ApplicatinoModel.Package.currentDate
BrowserNot available.null
ElectronNot available.null

BuildInfo.windows

Windows Only.

Get the windows extra information.

PlatformValueType
Androidundefinedundefined
iOSundefinedundefined
WindowsObjectObject
Browserundefinedundefined
Electronundefinedundefined
Property nameValueType
architectureWindows.ApplicationModel.Package.current.id.architectureinteger
descriptionWindows.ApplicationModel.Package.current.descriptionString
displayNameWindows.ApplicationModel.Package.current.displayNameString
familyNameWindows.ApplicationModel.Package.current.id.familyNameString
fullNameWindows.ApplicationModel.Package.current.id.fullNameString
logoObjectObject
publisherWindows.ApplicationModel.Package.current.id.publisherString
publisherIdWindows.ApplicationModel.Package.current.id.publisherIdString
publisherDisplayNameWindows.ApplicationModel.Package.current.publisherDisplayNameString
resourceIdWindows.ApplicationModel.Package.current.id.resourceIdString
versionWindows.ApplicationModel.Package.current.id.versionObject
Property nameValueType
absoluteCannonicalUriWindows.ApplicationModel.Package.logo.absoluteCanonicalUriString
absoluteUriWindows.ApplicationModel.Package.logo.absoluteUriString
displayIriWindows.ApplicationModel.Package.logo.displayIriString
displayUriWindows.ApplicationModel.Package.logo.displayUriString
pathWindows.ApplicationModel.Package.logo.pathString
rawUriWindows.ApplicationModel.Package.logo.rawUriString
BuildInfo.windows.version
Property nameValueType
majorWindows.ApplicationModel.Package.current.id.version.majorinteger
minorWindows.ApplicationModel.Package.current.id.version.minorinteger
buildWindows.ApplicationModel.Package.current.id.version.buildinteger
revisionWindows.ApplicationModel.Package.current.id.version.revisioninteger

Keywords

FAQs

Package last updated on 30 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc