# Cordova AppVersion Plugin

This Cordova/PhoneGap plugin reads the version of your app from the target build settings.

* Repository: <https://github.com/whiteoctober/cordova-plugin-app-version>
* Plugin ID/package name: `cordova-plugin-app-version`
* Tested version: 0.1.11

{% hint style="info" %}
To check the third party Cordova plugins, you need to create a custom build debugger ([Android version](/products_guide/debugger/installation/debugger_android.md#build-and-install-a-custom-monaca-debugger) or [iOS version](/products_guide/debugger/installation/debugger_ios.md#building-a-custom-monaca-debugger)).
{% endhint %}

## Demo

[<img src="https://docs.monaca.io/images/common/import_img.png" alt="" data-size="line">Import AppVersion plugin demo to your Monaca account](https://monaca.mobi/ja/directimport?pid=64b7790be78885e97fd49611)

![](https://docs.monaca.io/images/samples/app_version.png)

## Enable the plugin in the Monaca IDE

1. From the IDE menu, go to **Config → Manage Cordova Plugins** .
2. Click the **Import Cordova Plugin** button. Then, choose to import the plugin using a ZIP file or a URL/package name.

## API references

This section describes some of the main functions used in our [demo](https://monaca.mobi/directimport?pid=5b29c488e78885f330dba6cf). For complete API references, please refer to the [repository](https://github.com/whiteoctober/cordova-plugin-app-version).

### getAppName()

Get the name of the app.

```javascript
cordova.getAppVersion.getAppName()
```

**Return Value**

* `Promise`

**Example**

```javascript
cordova.getAppVersion.getAppName(function (appName) {
    alert( appName );
});
```

### getPackageName()

Get the package name of the app.

```javascript
cordova.getAppVersion.getPackageName()
```

**Return Value**

* `Promise`

**Example**

```javascript
cordova.getAppVersion.getPackageName(function (packName) {
    alert( packageName );
});
```

### getVersionCode()

Get the build identifier of the app.

```javascript
cordova.getAppVersion.getVersionCode()
```

**Return Value**

* `Promise`

**Example**

```javascript
cordova.getAppVersion.getVersionCode(function (verCode) {
    alert( versionCode );
});
```

### alertVersionNum()

Get the version number of the app.

```javascript
cordova.getAppVersion.alertVersionNum()
```

**Return Value**

* `Promise`

**Example**

```javascript
cordova.getAppVersion.getVersionNumber(function (versionNum) {
    alert( versionNum );
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://en.docs.monaca.io/tutorials/app_version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
