LoginSignup
16
13

More than 5 years have passed since last update.

IonicアプリのiOS10対応メモ

Posted at

iOS 10 で Cordova/Phonegap アプリが動かなくなった の記事を見かけてIonicアプリをアップデートして審査に出すまでに起きた事柄のメモです。

iOS10でCordovaアプリが起動しない?

deviceready イベントが発火しなくなった、ということなので記事とその参照先を参考にindex.htmlにmetaタグを追加した。

index.html
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src * 'unsafe-inline' 'unsafe-eval'">

Provisioning Profileが上手く認識されない

ちょうどApple Developer Programの更新時期を迎えていたので更新したつもりだったけど新しいProvisioning Profileが認識されず、実機にインストールできなくなった。

Xcode 8で追加された Automatically manage signing にチェックを入れるとよしなにやってくれた。

XcodeでArchiveしてストアにアップロードするときに弾かれる

実機で動作確認をしてようやくアップロード、というところでこんなメールが来た。

Dear developer,

We have discovered one or more issues with your recent delivery for "アプリ名". To process your delivery, the following issues must be corrected:

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

[iOS 10] 各種ユーザーデータへアクセスする目的を記述することが必須になるようです

QRコード読み取り用のプラグインがフォトライブラリへのアクセスを要求していると思われる。
Ionic/CordovaではiOS向けのInfo.plistはビルド時に生成されるので直接書き換えるのはよろしくない。

cordova-plugin-settings-hook を使うとconfig.xmlに書いたiOS向けの設定をInfo.plistに反映できるので、プラグインを追加してconfig.xmlに必要な設定を書く。

$ ionic plugin add cordova-plugin-settings-hook
config.xml
  <platform name="ios">
    <config-file platform="ios" target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
      <string>for QR Code reading</string>
    </config-file>
    ...
$ ionic build ios

ビルドしてみてアプリ名-Info.plistに NSPhotoLibraryUsageDescription の記述が追加されていたらOK。

iPad Pro向けのスクリーンショットを追加

5ヶ月ぶりにアップデートしたのでサポート端末にiPad Proが追加されており、そのスクリーンショットを要求された。
XcodeでiPad Proのエミュレータを起動してスクリーンショットを撮って貼り付け。

めでたく審査待ちに。

翌日リリースできました。

16
13
2

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
16
13