.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。

目次

概要

Cordova - Pluginの利用と開発

利用

Cordovaフレームワークに組み込まれていたネイティブ機能も含め、
Cordova3.0からは、ネイティブ機能を提供するものはすべてプラグインとして管理されるようになっている。

プラグインのパッケージ

公式で提供されているプラグイン

#プラグイン名概要リポジトリのURL
1Accelerometer加速度センサhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion.git
2Cameraカメラhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
3Captureカメラ・録音https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git
4Compassコンパスhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation.git
5Connectionネットワーク接続https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
6Contactsコンタクトhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts.git
7Deviceデバイス情報https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
8Eventsイベントhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-battery-status.git
9Fileファイルストレージhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
10ファイルトランスファーhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git
11Geolocation位置情報https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
12Globalization国際化https://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization.git
13InAppBrowser?アプリ内ブラウザhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
14Media音声・動画https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
15Notificationアラート・ダイアログhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
16バイブレーションhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git
17Splashscreenスプラッシュスクリーンhttps://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git

cordova pluginコマンドで管理

結果は、config.xmlに反映される。

一覧

cordova plugin ls

追加

cordova plugin add リポジトリのURL

削除

cordova plugin rm org.apache.cordova.core.camera(プラグインの識別子)

反映

config.xmlからPrepareコマンド
必要なファイルを(指定)プラットフォームにコピーする。

cordova prepare -d

この動作はカナリ複雑で、

platformsフォルダに出力される。

開発

プロジェクトを作成する。

Androidの場合、

platforms/android

iOSの場合、

platforms/iOS

ネィティブ側を実装

Androidの場合、

iOSの場合、

JavaScript側を実装

Androidの場合、

CordovaPlugin?.executeメソッド(のOverrideメソッド)が呼び出される。

iOSの場合、

・・・

ネイティブ・アクセス部分

プラグインの種類

標準的プラグイン

既定で有効

各種プラグインの追加

その他のプラグイン

既定で有効

各種プラグインの追加

各種プラグインの追加

リンクを外部ブラウザで開く

既定では、

参考

外部ブラウザからNativeに遷移

cordova-plugin-customurlscheme

Private-Use URI Scheme Redirectionのために
「cordova-plugin-customurlscheme」というpluginが利用できるが、
「Private-Use URI Scheme上書き攻撃」があるので、OAuth PKCEを使用する必要がある。

cordova-universal-links-plugin

参考

プッシュ通知

プッシュ通知サービスと連携

参考

地理位置情報

GPSサービスと連携

参考

審査不要のコード差し替え

以下が必要。

参考

参考


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS