# Cordova AppVersion プラグイン

この Cordova プラグインは、対象のビルド設定からアプリ情報を取得します。

* Repo: <https://github.com/whiteoctober/cordova-plugin-app-version>
* Plugin ID/Package Name: `cordova-plugin-app-version`
* Tested Version: 0.1.11

{% hint style="info" %}
サードパーティー製 Cordova プラグインを確認する場合は、カスタムビルドデバッガー ( [Android 版](/products_guide/debugger/installation/debugger_android.md#kasutamubirudo-monaca-debaggnobirudotoinsutru) または [iOS 版](/products_guide/debugger/installation/debugger_ios.md#kasutamubirudo-monaca-debaggnobirudo) ) を作成する必要があります。
{% endhint %}

## デモ

[<img src="https://docs.monaca.io/images/common/import_img.png" alt="" data-size="line">プロジェクトをインポート](https://monaca.mobi/ja/directimport?pid=64b7790be78885e97fd49611)

![](/files/-MgyCmZ4yIOxe8b-bj3P)

## Monaca クラウド IDE でプラグインを有効にする

1. IDE メニューか&#x3089;**`設定 → Cordova プラグインの管理`**&#x3078;移動します。
2. `Cordova プラグインのインポート`ボタンをクリックします。 次に、\[ZIP ファイル] または \[パッケージ名 / URL] を使用してプラグインをインポートします。

## API リファレンス

このページでは、[デモ](https://monaca.mobi/directimport?pid=5b29c488e78885f330dba6cf) で使用されている主な API についてのみ説明します。API リファレンスについては、[こちら](https://github.com/whiteoctober/cordova-plugin-app-version) を参照してください。

### getAppName()

アプリの名前を取得します。

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

**戻り値**

* `Promise`

**例**

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

### getPackageName()

アプリのパッケージ名を取得します。

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

**戻り値**

* `Promise`

**例**

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

### getVersionCode()

アプリのバージョンコードを取得します。

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

**戻り値**

* `Promise`

**例**

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

### alertVersionNum()

アプリのバージョン番号を取得します。

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

**戻り値**

* `Promise`

**例**

```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://ja.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.
