Giter Site home page Giter Site logo

cordova-plugin-buildinfo's Introduction

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.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);
}

Installation

cordova plugin add cordova-plugin-buildinfo

Supported Platforms

  • Android
  • iOS

Properties

  • BuildInfo.packageName
  • BuildInfo.basePackageName
  • BuildInfo.displayName
  • BuildInfo.name
  • BuildInfo.version
  • BuildInfo.versionCode
  • BuildInfo.debug
  • BuildInfo.buildType
  • BuildInfo.flavor

BuildInfo.packageName

Get the packageName of Application ID.

Platform Value Type
Android Package Name String
iOS Bundle Identifier 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)

Platform Value Type
Android Package name of BuildConfig class String
iOS Bundle Identifier(equals BuildInfo.packageName) String

BuildInfo.displayName

Get the displayName.

Platform Value Type
Android Application Label String
iOS CFBundleDisplayName String

BuildInfo.name

Get the name.

Platform Value Type
Android Application Label(equal BuildInfo.displayName) String
iOS CFBundleName String

BuildInfo.version

Get the version.

Platform Value Type
Android BuildConfig.VERSION_NAME String
iOS CFBundleShortVersionString String

BuildInfo.versionCode

Get the version code.

Platform Value Type
Android BuildConfig.VERSION_CODE int
iOS CFBundleVersion string

BuildInfo.debug

Get the debug flag.

Platform Value Type
Android BuildConfig.DEBUG Boolean
iOS defined "DEBUG" is true Boolean

BuildInfo.buildType

Android Only.

Get the build type.

Platform Value Type
Android BuildConfig.BUILD_TYPE String
iOS empty string String

BuildInfo.flavor

Android Only.

Get the flavor.

Platform Value Type
Android BuildConfig.FLAVOR String
iOS empty string String

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.