LoginSignup
2
2

More than 5 years have passed since last update.

PhoneGap Buildのconfig.xmlメモ

Posted at

PhoneGap Build
https://build.phonegap.com/
でiOS、Androidのアプリを開発する場合、config.xmlにPluginや環境設定を記載しますが、自分が設定した内容をメモしています。

iOS info.plist向け

カメラ、フォトライブラリへのアクセス用の設定

iOS10から各種ユーザーデータへアクセスする場合に使用目的をinfo.plistに記載しないといけないそうです。
自分で作成したアプリもアップしたところ、すぐにリジェクトされて以下のメッセージのメールが届きました。

Dear developer,
We have discovered one or more issues with your recent delivery for "Climb Memo". To process your delivery, the following issues must be corrected:
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team

PhoneGap Buildのpluginでカメラ機能を利用して、HTML5上でinputタグ(type="file")を利用して画像の入力を実装していたため、以下のように記載したところ、無事OKとなりました。

config.xml
<plugin name="cordova-plugin-camera" source="npm" >
  <variable name="CAMERA_USAGE_DESCRIPTION" value="メモの写真を撮影するためカメラを起動します" />
</plugin>
<plugin name="cordova-plugin-media-capture" source="npm"  >
  <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="メモの写真を選択するためカメラロールにアクセスします" />
  <variable name="CAMERA_USAGE_DESCRIPTION" value="メモの写真を撮影するためカメラを起動します" />
</plugin>

アプリ上で初めてカメラ機能を起動した場合

アプリ上で初めてフォトライブラリ機能を起動した場合

ローカリゼーションの設定

日本での配信だけを予定しているため、ローカリゼーションを日本のみに設定しました。

config.xml
<config-file platform="ios" target="*-Info.plist" parent="CFBundleDevelopmentRegion">
    <array>
        <string>Japanese</string>
    </array>
</config-file>
<config-file platform="ios" target="*-Info.plist" parent="CFBundleLocalizations">
    <array>
        <string>ja</string>
    </array>
</config-file>

Android AndroidManifest.xml向け

プライバシーポリシーに関する記述の削除

apkファイルをアップロードしたところ、以下の警告が表示されました。

プライバシー ポリシーが必要な権限(android.permission.RECORD_AUDIO,android.permission.READ_PHONE_STATE,android.permission.GET_ACCOUNTS, android.permission.READ_CONTACTS)がAPK で使用されています。

今回は、この情報に関する設定をAndroidManifest.xmlから削除する形で対応しました。

AndroidManifest.xml
<gap:config-file platform="android" parent="/manifest" mode="delete">
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
</gap:config-file>

SQLite

config.xml
<plugin spec="https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free" source="git" />

cordova-plugin-x-socialsharing

config.xml
<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />

ステータスバーの非表示

config.xml
<plugin name="cordova-plugin-battery-status" />

紹介:PhoneGap Buildで開発したアプリ

Climb Memo

・Android(Google Play)
https://play.google.com/store/apps/details?id=com.akakura.climbingmemo
・iOS(App Store)
https://appsto.re/jp/3XQSib.i

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2